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.

Boot from flash executes main() but maybe not BIOS_start()

DSP: TMS320C28346

PC: Windows XP

IDE: Code Composer 4.1.2

BIOS: 5.41

I have 2 LEDs attached to my MCU.  My main() function turns one on and the other off.  Then, a 10 Hz task toggles them.

After I build my application in Code Composer, I use the following command:

"C:\Program Files\Texas Instruments\ccsv4\tools\compiler\c2000\bin\hex2000.exe" -b -spi8 -boot -lospcp 2 -spibrr 0 sw.out

I wrote sw.b00 into my SPI flash device, but when I power up, I see one LED on and the other off.  This tells me that execution stopped after main(), but before the task started running.  Everything works fine when I launch the same application via the debugger/JTAG.

Anyone have any guidance?

  • Since the last post, I've figured out how to step through the assembly during boot time, and I think I've figured out what my problem is.  My .b00 file contains a section for ".hwi_vec".  Apparently the bootloader tries to copy that section to 0x00000D00, but maybe it is EALLOW protected and so nothing gets written.  Then when the OS starts (and depends on a timing source), the table is invalid.

    Is the vector table supposed to be written this way, or in the initialization code?  How do I get DSP/BIOS to write out the vector table during initialization?

  • I updated my application so that it reads flash again during main() and updates the vector table with EALLOW.  Now everything works.  My long term plan is to create a 2nd level bootloader (I need it anyway so I can make decisions about which software image to load) which I will be sure to use EALLOW.  Still, is this a bug in the bootloader, or should I be doing something differently?

  • Assuming this part is similar to the 28335, the "bootloader" does not handle boot from FLASH options, only boot from an external interface (XINTF) or one of the peripheral devices.  In one of the myriad documents required to operate/understand any TI DSP chip, this nugget of information is mentioned as a task left to the user.

    If you plan to copy from FLASH to run out of RAM, there are posts around that discuss that though the procedures are quite different if you are using DSP/BIOS, particularly so if you are using version 6.x.  I have made a few posts regarding the later, both here and over at the Eclipse forum.

    Mark

  • My Flash device is connected SPI-A, so technically I'm talking about boot from SPI.  Whether it's SPI, SCI, or any other bootable source, it seems like a bug that the bootloader wouldn't use EALLOW to update PieVecTable.  I know the bootloader is just treating everything from the source as data and it shouldn't need to know if it's going to a protected region or not.  That's why it should probably just EALLOW everything.

  • As you can see from this link, I am facing the same problem with you.

    It seems that the hwi vector table is not properly written during the bootloading sequence, as I check the vector table addresses and their contents are not correct. They seem to be corrupted and eventually the BIOS never starts and the program does not execute correctly.

    I would like to ask you

    1. Has anyone from TI officially verified your findings? Have they proposed any other way to correctly boot from SPI-A with BIOS?
    2. As I am going to follow another route in my design, it would be very helpful if you could lead me to this. Thus, I would like to ask you to guide me on how to update the vector table during main, as I guess that would solve a lot of my problems.

    Thank you.

    Best Regards,

    Athanasios.