Skip to content

Commit

Permalink
Merge pull request adafruit#3001 from hierophect/mimxrt-teensy-boot
Browse files Browse the repository at this point in the history
mimxrt10xx: Disable pin_reset on 1060 boards
  • Loading branch information
tannewt authored Jun 5, 2020
2 parents fffe171 + 74effee commit 6400113
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 8 deletions.
18 changes: 10 additions & 8 deletions ports/mimxrt10xx/boards/teensy40/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,6 @@
#include "shared-bindings/microcontroller/Pin.h"

void board_init(void) {
// SWD Pins
common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);//SWDIO
common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);//SWCLK
common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);//SWO

// FLEX flash
common_hal_never_reset_pin(&pin_GPIO_SD_B1_06);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_07);
Expand All @@ -43,9 +38,16 @@ void board_init(void) {
common_hal_never_reset_pin(&pin_GPIO_SD_B1_10);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_11);

// USB Pins
common_hal_never_reset_pin(&pin_GPIO_AD_B0_01);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_03);
// FLEX flash 2
common_hal_never_reset_pin(&pin_GPIO_AD_B0_04);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_08);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_09);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);
common_hal_never_reset_pin(&pin_GPIO_EMC_01);
common_hal_never_reset_pin(&pin_GPIO_B0_13);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_11);
}

bool board_requests_safe_mode(void) {
Expand Down
19 changes: 19 additions & 0 deletions ports/mimxrt10xx/boards/teensy41/board.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,27 @@

#include "boards/board.h"
#include "mpconfigboard.h"
#include "shared-bindings/microcontroller/Pin.h"

void board_init(void) {
// FLEX flash
common_hal_never_reset_pin(&pin_GPIO_SD_B1_06);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_07);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_08);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_09);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_10);
common_hal_never_reset_pin(&pin_GPIO_SD_B1_11);

// FLEX flash 2
common_hal_never_reset_pin(&pin_GPIO_AD_B0_04);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_06);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_07);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_08);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_09);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_10);
common_hal_never_reset_pin(&pin_GPIO_EMC_01);
common_hal_never_reset_pin(&pin_GPIO_B0_13);
common_hal_never_reset_pin(&pin_GPIO_AD_B0_11);
}

bool board_requests_safe_mode(void) {
Expand Down
3 changes: 3 additions & 0 deletions ports/mimxrt10xx/supervisor/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,10 @@ void reset_port(void) {

//reset_event_system();

// TODO: implement a proper fix for 1060 resets
#if !defined (MIMXRT1062_SERIES)
reset_all_pins();
#endif
}

void reset_to_bootloader(void) {
Expand Down

0 comments on commit 6400113

Please sign in to comment.