AnsweredAssumed Answered

iMX RT102xEVB : Failed to run the application From SDRAM via QSPI XIP

Question asked by WEI-TA CHEN on Sep 27, 2019
Latest reply on Oct 7, 2019 by WEI-TA CHEN

Dear all,


    just like the info from

 iMX RT105x : Running the Application From SDRAM 


    Our environment is MCUXpresso v11.0.1 + SDK2.6.1.


    We have created a simple bootloader running in XIP QSPI flash (0x60000000) and this bootloader copies the application image sits in QSPI to the external SDRAM (0x80000000).

The SDRAM is initialized by DCD (evkmimxrt1020_sdram_ini_dcd.c) when loader runs in QSPI.



The applicatoin image is built for SDRAM which refer to build procedure as below and it works if we only executed it in SDRAM to instead of copy the application image via QSPI loader.


Then choose 'Link Application to RAM' in 'Managed Linker Script'.




However, we still met the similar problem 'PRECISERR Bus Fault.' with below sample code:


#define QSPI_IMAGE_ADDRESS 0x60300000

#define SDRAM_ADDRESS 0x80000000

    memcpy((void*)SDRAM_ADDRESS,(void*)(JUMP_ADDRESS),binary_file_size); // .bin size

    SCB->VTOR = (uint32_t)(SDRAM_ADDRESS);

    JumpApplication(*(uint32_t*)(SDRAM_ADDRESS), *(uint32_t*)(SDRAM_ADDRESS+4));


After comparing the ResetISR address in .map file, application binary info and dump info of SDRAM_ADDRESS via CMSIS DAP on baord debugger, we still can't find obvious error info or clues for the SDRAM executed failed problem.


Does anyone can help to provide or check below info maybe a correct debug direction?


1. For application image, should we remove XIP_BOOT_HEADER_ENABLE and XIP_BOOT_HEADER_DCD_ENABLE?


The remain preprocessor options will be:



I guess it won't help because application image had chosen 'Link Application to RAM', which will not generate FCB / IVT /DCD header in generate binary file and re-initialize SDRAM via DCD area.


2. For the sample code of jumpApplication in bootloader, should we disable Cache and IRQ before assign SDRAM_ADDRESS to SCB->VTOR?





    SCB->VTOR = (uint32_t)(SDRAM_ADDRESS);


Does anyone know what am I missing?


Thanks in advance.