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.

Shared RAM location problem

Hi,

I'm using a F28377S and I'm facing some weird problems between my bootloader and my application. 

Both share the same memory for sections : ebss, esysmem, sysmem. They are located in RAM GS7 to GS11. Sometimes, when my application jumps to bootloader for a firmware update, I get an Invalid_BankError when using the flashapi Erase method and all the flash gets erased, including where my bootloader is located... It happens on very specific occation when I'm using a big buffer for logging in the application.

My guess is that some memory is badly initialized when I jump in the bootloader and something is broken when it calls the flashapi but, I can't put my finger on it exactly. Is there something in the linker file I should have? Is there a procedure to clean RAM memory I should do?

Any input will be appreciated!

Thanks

  • Simon,

    1) What is the library that you use?  Hope you are using F021_API_F2837xS_FPU32.lib?

    2) What is the bank number that you passed when you got a Invalid_BankError?

    3) F28377S has one core but two Flash wrappers (FMC0 and FMC1) as explained in the TRM.  

    FMC0 has to be initialized for Flash operations on Bank0.  F021_CPU0_W0_BASE_ADDRESS is the base address for FMC0 registers.

    FMC1 has to be initialized for Flash operations on Bank1.  F021_CPU0_W1_BASE_ADDRESS is the base address for FMC1 registers.

    Call Fapi_initializeAPI(F021_CPU0_W0_BASE_ADDRESS, User_configured_frequency) and Fapi_setActiveFlashBank(Fapi_FlashBank0) functions before doing Flash operations on Bank0.

    Call Fapi_initializeAPI(F021_CPU0_W1_BASE_ADDRESS, User_configured_frequency) and Fapi_setActiveFlashBank(Fapi_FlashBank1) functions before doing Flash operations on Bank1.

    Thanks and regards,

    Vamsi

  • Hi,

    I'm linking with F021_API_F2837xD_FPU32.lib. I have some boards with F2837xS and some with F2837xD. I only use one core so I consider them all like F2837xS since it's the final controller type. The reason I link with the F2837xD library is, if I'm not mistaken, when it was released, there was only this library available but I could be mistaken. That's another of my questions on E2E, should I absolutly link with the correct library depending on the chip type (S/D) ? If yes, I'll have to work out something.

    I don't think it's necessary related to my problem since I've had the problem on boards with F2837xS DSP and xD ones.

    I only use bank 0 for flash programming. If I set activeBank to something else than 0 or 1, could that cause a full erase?

    During initialization, I use :

    Fapi_initializeAPI with : #define F021_CPU0_REGISTER_ADDRESS 0x0005F800


    Thanks
  • Simon,

    Regarding the API selection: Your other post mentioned that you use only one core but did not tell anything about second bank usage. Hence, I mentioned that you have to move to F2837xS API. If you use only one core and the first bank always, you can either use F2837xD or F2837xS API.

    Regarding the bank that you pass: You can not assign a bank other than 0 in F2837xD and 0/1 in F2837xS (if you plan to use second bank in F2837xS, you have to use F2837xS API).

    Some debug tips:
    1) Make sure you have an EALLOW before Fapi_setActiveFlashBank() (before any API function)?
    2) There is no way of erasing an entire bank unless you issue erase command for each sector. Please check your code thoroughly. I can help review the code if needed.

    Thanks and regards,
    Vamsi
  • Simon,

    Are you still getting the Invalid_BankError error?

    Can I close this thread?

    Thanks and regards,

    Vamsi

  • Let's close it for now. When I work on this again, I'll reopen it if I have problems.

    Thanks!