Browse Source

mimxrt: Fix CPU freeze when calling __WFE() in MICROPY_EVENT_POLL_HOOK.

This issue affected i.MX RT 1052, 1062 and 1064.  It seems to be addressed
by Errata ERR006223, which also mentions i.MX RT101x and 102x, but these
devices worked well even without the change.  As a side effect, the current
consumption at an idle REPL drops significantly with this fix.

Fixes issue #7235.
pull/9638/head
robert-hh 2 years ago
committed by Damien George
parent
commit
9d2e179fa5
  1. 1
      ports/mimxrt/boards/MIMXRT1052_clock_config.c
  2. 1
      ports/mimxrt/boards/MIMXRT1062_clock_config.c
  3. 1
      ports/mimxrt/boards/MIMXRT1064_clock_config.c
  4. 1
      ports/mimxrt/mpconfigport.h

1
ports/mimxrt/boards/MIMXRT1052_clock_config.c

@ -465,4 +465,5 @@ void BOARD_BootClockRUN(void) {
IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT2_MASK; IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT2_MASK;
/* Set SystemCoreClock variable. */ /* Set SystemCoreClock variable. */
SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK; SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK;
CLOCK_SetMode(kCLOCK_ModeRun);
} }

1
ports/mimxrt/boards/MIMXRT1062_clock_config.c

@ -487,4 +487,5 @@ void BOARD_BootClockRUN(void) {
IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT2_MASK; IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT2_MASK;
/* Set SystemCoreClock variable. */ /* Set SystemCoreClock variable. */
SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK; SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK;
CLOCK_SetMode(kCLOCK_ModeRun);
} }

1
ports/mimxrt/boards/MIMXRT1064_clock_config.c

@ -487,4 +487,5 @@ void BOARD_BootClockRUN(void) {
IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT2_MASK; IOMUXC_GPR->GPR5 &= ~IOMUXC_GPR_GPR5_VREF_1M_CLK_GPT2_MASK;
/* Set SystemCoreClock variable. */ /* Set SystemCoreClock variable. */
SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK; SystemCoreClock = BOARD_BOOTCLOCKRUN_CORE_CLOCK;
CLOCK_SetMode(kCLOCK_ModeRun);
} }

1
ports/mimxrt/mpconfigport.h

@ -241,6 +241,7 @@ extern const struct _mp_obj_type_t network_lan_type;
do { \ do { \
extern void mp_handle_pending(bool); \ extern void mp_handle_pending(bool); \
mp_handle_pending(true); \ mp_handle_pending(true); \
__WFE(); \
} while (0); } while (0);
#define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p) | 1)) #define MICROPY_MAKE_POINTER_CALLABLE(p) ((void *)((mp_uint_t)(p) | 1))

Loading…
Cancel
Save