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.

F035 Erase of Bank 0 triggers ABORT

Hi

I am using the F035 Flash API library on the TMS570. So far it has been working well - I have been able to successfully erase and program using the library and now I have

unfortunately come across a problem. I have a Bootloader code that runs in Bank 0 of Flash. When running in Bank 0 I can successfully erase and program

sectors in Bank 1, 2 and 3. However if I am running in Bank 1 of Flash, I can successfully erase sectors in Bank 2 and 3, but not in Bank 0.

When I call the Flash_Erase_B function, an ABORT (prefetch) interrupt is triggered. According to the TMS570 tech ref manual, an ABORT is triggered if an access is made

to 1.) an illegal address, 2.)  a protected address, 3.) or a valid address with an ECC error.

I have all ECC checking turned off, and I have also have not turned on any of the Flash protection registers and I really can't see how passing in a Bank 0 sector start address

could be deemed as an illegal address.

In conclusion, do you have any idea what might be causing this to occur. Like I mentioned all F035 Flash API functions work well on every bank except Bank 0.

Many Thanks

Kieran

  • I still have a problem with this, but now I have noticed that if I place a breakpoint on Flash_Erase_B and then single step the code through the disassembly, then the chosen sector of Bank 0 can successfully be erased. However without stepping through the code an abort interrupt is always generated.

    Hopefully this can narrow down the problem, but I am still unsure as to why this is happening to Bank 0 only.

  • Because your code is located in Flash Bank0. While you erase or program flash bank_x, bank_x is not readable. To fix your problem, please copy your code from flash to RAM and set the PC to RAM (running code from RAM), then, everything should be fine.

    Regards,

    Haixiao

  • I am quite sure my code is NOT located in Bank 0. Some code runs in Bank 0 before it jumps to Bank 1. Once in Bank 1, it calls the F035 Flash API. Upon looking at the addresses in the generated memory map file, it is quite clear the functions in the F035 Flash API are all located in Bank 1 address space. When I debug, I can see that at no point apart from initial startup - am I ever in Bank 0.

    Your solution also doesn't seem to explain why it does work when I single step the code.

    I would prefer for now, to save RAM, and try to keep the F035 library running in flash. Do you have any other suggestions?

  • Bank0 is special. All the interrupt and abort entry are located in bank0. So, sometimes, you are not aware of that the code goes through bank0. In your case, I don't know what exactly cause the problem. which sector are you trying to erase? ector0 or other sectors? I will suggest you to samply your code, load it into the RAM to see if works for bank0.

  • I use the example in the following application notes (http://focus.ti.com/mcu/docs/litabsmultiplefilelist.tsp?sectionId=96&tabId=1502&literatureNumber=spna117a&docCategoryId=1&familyId=1870)  as a start point. I modified the .cmd file to map the code into the flash bank1. After that, I try to erase bank0 sectors (Hypertermal input '9'). I did not see any problem. I attached the .cmd file for your reference.http://e2e.ti.com/cfs-file.ashx/__key/CommunityServer-Discussions-Components-Files/312/7875.linker_5F00_flash.cmd

    .

  • Thanks for that.

    I did manage to get it working so that it can erase sectors on Bank 0. However I have been unable to get Sector 0 of Bank 0 to Erase. All other sectors can be erased

    successfully. Can this sector be erased? I am now running all the Flash API functions from RAM.

  • Yes, you can erase sector 0 using Flash API from RAM. I will travel soon and don't have time to show you an example. If you need more help, please start a new post.