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.

TMS320F28388D: Flash uncorrectable error occurs when rebooting device after rewriting the bootloader

Part Number: TMS320F28388D
Other Parts Discussed in Thread: UNIFLASH

Tool/software:

Hello everyone,

I have an application that rewrites the bootloader of my device which boots from flash.

If I load the application and bootloader to the device everything works fine. However, when I rewrite the bootloader using my application, the device does not reboot but receives flash uncorrectable error. I have tried reading the flash memory of bootloader before and after rewriting the bootloader and the memory is identical.

If I try reading memory using UniFlash, the device suddenly boots and everything works fine until I try to reboot it again when again it doesn't boot.

Thanks and regards

  • Hi blackmamba,

    The Flash API for devices cannot program in the same Flash bank that the application is running in. For your application, when it tries to rewrite the bootloader (assuming you mean flash kernel/secondary bootloader that you have stored in Flash), during an update the Flash API would have to be run from RAM.

    Can you provide some screenshots of the error you're seeing as well?

    Thanks and regards,

    Charles

  • Hi,

    our application is stored in flash sectors S1 to S7 and bootloader is stored in sector S0. So we are trying to rewrite the sector S0 from different flash sector. The flash API is stored in RAM.

    When reading memory, we see that the memory is successfully rewritten, but the program doesn't start running.

    With debugger we can see that the processor goes to location 0x3FB114 and here is a.screenshot of NMI registers.

    Thank you and regards

  • Hi,

    >So we are trying to rewrite the sector S0 from different flash sector. The flash API is stored in RAM

    In this scenario, is the Flash API run from RAM?

    Thanks,

    Charles

  • Hi,

    Yes, the Flash API is run from RAM.

    All flash operations are run successfully and we can see that the memory is loaded with our bootloader. However, the bootloader doesn't start running.

    Thanks

  • When writing the bootloader, is it possible after it's finished downloading to memory to do a device reset? When the device resets back to the application, does it recognize the revision difference between the current updated bootloader address and the previous custom bootloader? How does it determine whether to branch to the bootloader?

    Thanks,

    Charles

  • After downloading to memory, we try to do a device reset but the device doesn't reset back to application. It gets stuck during boot on location 0x3FB114.

    The bootloader is downloaded to flash address 0x80000, from which the device is set to boot so it should branch to bootloader on its own following a reset. This works fine when we load the bootloader using Uniflash, but not when trying to download through the application.

    We did manage to replicate the error by loading using UniFlash with the "Auto ECC Generation" option unchecked. The device also doesn't boot without this option, but gets stuck during reboot on the same memory location (0x3FB114).

    Thank you

  • Hi blackmamba,

    I'll need a few more days before I can get back to you, thank you for your patience.

    Thanks and regards,

    Charles

  • Is there any progress regarding this problem?

    Thanks and regards.

  • Hi,

    Can you show what the disassembly says when trying to reboot?

    Thanks,

    Charles

  • Hi,

    Below is the short snippet from CCS where my code stuck after I reload bootloader and do CPU reset.

    Thanks and regards.

  • Hello,

    Are you using the Fapi_AutoEccGeneration mode when programming the bootloader via the application? 

    Kind regards,

    Skyler

  • Hi,

    Within my application I used function Fapi_issueProgrammingCommand (executed from RAM) with option Fapi_DataOnly (the 6th argument within this function). Also, in my application I disable ECC using function Flash_disableECC(FLASH0ECC_BASE);.

    Kind regards.

  • Hello,

    Can you program with the Fapi_AutoEccGeneration mode? ECC is automatically enabled on power-up, so after a reset you will encounter ECC errors unless you program ECC for the flash image.

    Kind regards,

    Skyler

  • Hi Skyler,

    For now I can not use Fapi_AutoEccGeneration mode. I will try to explain why, maybe You can help me.

    We have our PC program which sends .srec file to our application which than load our bootloader  to flash memory (sectro S0). This PC program send one by one row of srec file to our application, application than load this line into the flash.

    Below I will past the part of the srec file that generate CCS:

    Each row has 15 words of data. To use Fapi_AutoEccGeneration mode, I need to change srec file so every row has 4, 8 or 16 words of data. This is (I think according to TI forum) not possible to do within CCS. So I try to use srec_cat tool but without success.

    I would be glad if you could help me?

    Kind regards

  • Hello,

    You're correct, there's no way to change the length of the rows in the srec file. I suggest that you add some logic in your PC host program such that it can read in the required amount of data from the srec file and send the data 4, 8, or 16 words of data at a time.

    Kind regards,

    Skyler