Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Broadcom: Set JTAG pins to Pull Down on initialization #5798

Merged
merged 5 commits into from
Jan 4, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions ports/broadcom/common-hal/microcontroller/Pin.c
Original file line number Diff line number Diff line change
Expand Up @@ -48,14 +48,13 @@ void reset_pin_number(uint8_t pin_number) {
pin_in_use[pin_number] = false;
never_reset_pin[pin_number] = false;
// Reset JTAG pins back to JTAG.
BP_PULL_Enum pull = BP_PULL_NONE;
if (22 <= pin_number && pin_number <= 27) {
gpio_set_function(pin_number, GPIO_FUNCTION_ALT4);
return;
} else {
gpio_set_function(pin_number, GPIO_FUNCTION_INPUT);
}
// Set the pull to match the datasheet.
BP_PULL_Enum pull = BP_PULL_NONE;
if (pin_number < 9 ||
(33 < pin_number && pin_number < 37) ||
pin_number > 45) {
Expand All @@ -65,7 +64,7 @@ void reset_pin_number(uint8_t pin_number) {
pin_number != 44 &&
pin_number != 45) {
// Most pins are pulled low so we only exclude the four pins that aren't
// pulled at all.
// pulled at all. This will also set the JTAG pins 22-27
pull = BP_PULL_DOWN;
}
gpio_set_pull(pin_number, pull);
Expand Down