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 <gang.liu@nxp.com>
pull/12711/head
Gavin Liu 2020-04-02 15:52:12 +08:00
parent b53d40b269
commit f8a8401a13
1 changed files with 2 additions and 0 deletions

View File

@ -278,7 +278,9 @@ void flexspi_nor_flash_read_data_ram(uint32_t addr, uint32_t *buffer, uint32_t s
int32_t flash_init(flash_t *obj)
{
core_util_critical_section_enter();
flexspi_update_lut_ram();
core_util_critical_section_exit();
return 0;
}