This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

TMS570LS3137: Data abort from call to Fapi_initializeFlashBanks

Part Number: TMS570LS3137

In summary, I am getting a data-abort (imprecise I think) from a call to Fapi_initializeFlashBanks, and I believe this code works, so (I think) the CPU is in an improper state prior to this call. What conditions are necessary prior to this call, or what can I look at to trouble-shoot this?

The details: I am storing user-configuration variables in 1 upper segment of flash, so this block of code is trying to erase only that segment. This code used to work -- before I implemented a bootloader, which allows the user to upgrade the firmware without JTAG, so this new bootloader code has new Flash-manipulation code that must be leaving the flash-controller, or something, in the wrong state. I have tried various things: calling Fapi_initializeFlashBanks from RAM or Flash, disabling or enabling the ARM FlashECC, all of which have no effect. Also I am calling Fapi_initializeFlashBanks from System mode. I have read through your F021 Flash API guide and it states to call Fapi_initializeFlashBanks before anything else.

Also in the abort-handler, the ESM-registers are all zero, and the CPSR-A flag is set, which I think means it is an imprecise data abort. 

Thanks,

Jim

  • Hello Jim,

    1. All the flash erase/program API related code can not be executed in the same bank as the sectors to be erased. You can either copy those code to SRAM and execute them in SRAM, or another flash bank.
    2. The clock used in the Fapi_initializeFlashBanks((uint32_t)CLK_FREQ)) should be the same as the system clock (HCLK).
  • QJ,

    The problem is not one of your two possibilities -- I am executing the Flash API calls from RAM, and I am using the same frequency as HCLK -- 160Mhz. Are there any other possibilities you can think of?

    Thanks,

    Jim

  • Jim,

    Is the upper segment for storing user-configuration variables in the bank1, and the your code located in bank0? Is there any interrupt triggered during your flash erase/program operation?
  • QJ,

    I fixed this problem -- the FAPI copy to RAM was occurring after the MPU was initialized, so the RAM-copy simply did not do anything; subsequently the call to FAPI functions was jumping to no-code. 

    Thanks for your help.

    Jim