Skip to content

Commit d2d0b3b

Browse files
liugang-gavinArto Kinnunen
authored andcommitted
targets:TARGET_IMX: Fix the flash init risk
The flash access may fail when implementing flash initialization. So there is risk for interrupt handler which linked in flash space. Add the critical section to avoid the risk. Signed-off-by: Gavin Liu <[email protected]>
1 parent 91a5aa2 commit d2d0b3b

File tree

1 file changed

+2
-0
lines changed
  • targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX

1 file changed

+2
-0
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/flash_api.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,9 @@ void flexspi_nor_flash_read_data_ram(uint32_t addr, uint32_t *buffer, uint32_t s
278278

279279
int32_t flash_init(flash_t *obj)
280280
{
281+
core_util_critical_section_enter();
281282
flexspi_update_lut_ram();
283+
core_util_critical_section_exit();
282284

283285
return 0;
284286
}

0 commit comments

Comments
 (0)