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.

Error while trying to boot from SPI Flash

Other Parts Discussed in Thread: TMS320C5505, TMS320C5515

Hi,

I am working on c5505 DSP , and I am trying to boot using SPI flash.
However, when I try to use the programmer with my "file.out" (built with Hex55.exe), it gives me an error :  

WRITE ERROR at 0x0000

I am using the SST25VF032B SPI Serial Flash. So I wanted to know if it is
Compatible with the TMS320C5505 DSP, and, if it is, what could be the cause of this issue.

I tried with two different programmers I found on this forum:

The programmer_C5515_EVM.out, and the one I found in the evm5505_v1 folder, but I experienced the same issue with both.

Does anyone have a suggestion why I would be getting this error?

Regards,

Antoine

  • Can you post the hex55 command you use to generate the .bin file for programmer to download?

    Have you looked into this wiki page?

    http://processors.wiki.ti.com/index.php/C5515_Boot-Image_Programmer

    Regards.

  • To create the .bin file, I used the command :

    hex55 -i filename.out -o boot_image_file_name.bin -boot -v5505 -b -serial8


    I forgot to mention that I first tried on the TMS320C5515 EVM, and the boot from SPI EEPROM worked without any error.

    Actually, to create the .bin file, I followed this wiki page : http://processors.wiki.ti.com/index.php/C5000_Creating_Boot-Images

    Then, in order to program the boot image, I followed the wiki page you mentioned.

  • The C5515 EVM and the EzDSP use different memory with different address on SPI peripheral. The link you used is for C5515.

    Use this link to Spectrum Digital for C5535 EzDSP and C5515 EVM for programming tool and schematics:

    http://support.spectrumdigital.com/

    http://support.spectrumdigital.com/boards/ezdsp5535/revc/

    http://support.spectrumdigital.com/boards/evm5515/revb/

    Regards.

  • Hi,

    Thank you for your answers, but i'm coming back on this thread because I still haven't found any solution to my problem. 

    I will try to explain again as accurately as I can what I have done from the beginning, and since the last time I posted here.

    I have a custom board using the TMS320C5505 . My objective is to be able to boot using SPI flash. 

    I first tried on the TMS320C5515 EVM, and the boot from SPI EEPROM worked. My custom board is wired the same way as the EVM. 


    First, to create the .bin file, I followed the same process than for the EVM. (with a recent version of the Hex55 utility)

    Then, to programm my board, I tried different programmers : The EVMc5515 programmer,  the C5535 EzDSP programmer as you told me, and other. But I always experienced the same issue : "WRITE ERROR"

    To solve it, I tried to change the EEPROM, at first it was the SST25VF032B SPI Serial Flash,  then I changed it for the same used on the EVM. I also tried to make a small programm ( 4Kb) in case the size was the problem, but it still doesn't work. 

    (I want to precise that the boot from the SD card works, but for my application, I need to boot from the SPI flash)

    If any of you have a solution or suggestion, please tell me.

    Regards,

    Antoine


  • This is the matrix from your posting:

                                  SPI          USB

    C5515EVM          Works     Works

    C5505Custom    Fails       NA

    Since you are booting from USB, you are using encrypted boot image, correct? And it works on C5515EVM, the .bin file is good for C5505.

    Second observation, you are using same EEPROM on custom board, thus EEPROM is also good for C5505.

    I assume there is no USB on custom board to try, correct?

    My suggestion is to compare schematic and scoped SPI transaction signals.

    Hope this help.

    Regards.

  • I am using encrypted boot image only for booting from the SD card. The .bin I create for booting from SPI is not encrypted.

    On the custom board, there only is a SD slot, and a Jtag port, no USB port . 

    When I compared the scope obtained with the same programmer, I notice a different clock frequency on the SPI clk pin : 491 Khz for the EVM, and 1.4Mhz for our custom Board. Can this difference be the cause of my issue?

    I also didn't understood some of the options of the hex55 utility to convert the .out in .bin,

    I used the Hex55 utility with the "-b" option but I have seen that there is other possibilities for generating hex file, like -i or -x. Does the programmer works only with .bin file (generated with the "-b" option), or is it possible to use another format of hex file (Intel, Motorola, Ascii...)? 

    I would aslo like to know why the programmer can only be used with Serial8 and what does that means exactly.

    Thank you for your help.

    Regards,

    Antoine

  • Yes. SPI boot mode peripheral speed is 500kHz. Please refer to data sheet and bootloader apps note. Are you using external clock source on CLKIN?

    "The bootloader assumes that the CLKIN pin is connected to the LVCMOS-compatible clock source with a frequency of 11.2896-, 12.0-, or 12.288-MHz. These frequencies were selected to support boot mode peripheral speeds of 500 KHz for SPI and 400 KHz for I2C. These clock frequencies are achieved by dividing the CLKIN value by 25 for SPI and by 32 for I2C."

    For detailed information on the available hex conversion utility output formats, see the TMS320C55x DSP Assembly Language Tools User’s Guide (SPRU280).

    hex55.exe is a generate utility tools with CCS with various options to support multiple devices. We only tested a subset of the options for C5505: hex55 -boot -v5505 -serial8 -b -o my_app.bin my-app.out. You can test out other options if you wish. Also, C5505 uses the hex55.exe revision 4.3.5 or later. Earlier versions may not support the boot table features correctly.

    Regards.

     

     

  • Hi Steve,

    I work with Antoine on the same project.

    Yes, we have seen on the datasheet (chapter on boot sequence) that the SPI clock frequency is set to 500KHz for the boot, but the programmer can work with a different frequency for loading the new firmware (just need to be compatible with the EEPROM), can't it ?

    We don't understand why the programmer tries to load the new firmware on our board at 1.4Mhz and loads it at 491KHz on the EVM board.

    On user guide, it explains that the bootloader set the system clock to CKLIN x 3 (36MHz in our case) when CLK_SEL=1 and set to 36.864MHz when CLK_SEL=0.

    Like you have explained, the SPI frequency is defined from the system clock divided by 25; on our board the system clock is 36MHz, so the SPI frequency is set to 36Mhz/25=1.44MHz. That it is seemed correct, isn't it ?

    Our configuration: the CLKIN is sourced by a 12MHz, but we have tried to sourced by the RTC clock (32.768KHz), we observed same results.

    Best regards,

    Diane

  • Diane,

    > We don't understand why the programmer tries to load the new firmware on our board at 1.4Mhz and loads it at 491KHz on the EVM board. <

    A. I will check with the SW team.

    > On user guide, it explains that the bootloader set the system clock to CKLIN x 3 (36MHz in our case) when CLK_SEL=1 and set to 36.864MHz when CLK_SEL=0. <

    A. Wher you get this CLKIN x 3?

    The ROM bootloader expects the SPI peripheral clock be ~12.288MHz. This is done by, if CLK_SEL = 1, it expects a CLKIN frequency be 11.2896 MHz, 12.0 MHz or 12.288 MHz, and PLL is bypassed. If CLK_SEL = 0, PLL multiplies the 32.768 kHz RTC clock by 375 to generate a 12.288 MHz peripheral clock. This peripheral clock is then divided by 25 to become the SPI bootloader clock, 12.288 MHz/25 = 491 kHz.

    > Like you have explained, the SPI frequency is defined from the system clock divided by 25; on our board the system clock is 36MHz, so the SPI frequency is set to 36Mhz/25=1.44MHz. That it is seemed correct, isn't it ? <

    A. If CLK_SEL = 1, yes, SPI bootloader clock will be 36 MHz/25 = 1.44 MHz.

    Please note in data manual, section 6.4.2, "A LVCMOS-compatible clock input of a frequency less than 24 MHz can be fed into the CLKIN pin for use by the DSP system clock generator." 36 MHz sends too high.

    > Our configuration: the CLKIN is sourced by a 12MHz, but we have tried to sourced by the RTC clock (32.768KHz), we observed same results. <

    A. I am confuse here. Isn't your board uses 36 MHz for CLKIN? Also, if RTC clock (32.768 kHz) is used, it should work. Can you confirm the CLK_SEL is correct?

    Regards.

  • Steve,

    Sorry for the confusion.

    When I get 36MHz, I mean at the output of the PLL. the CLKIN is sourced by a 12Mhz and the PLL is configurated for multiplying it by 3.

    It is written on the Bootloader user guide section 2.2, but i didn't notice that it is in case of none boot image was found.

    You said that the SPI frequency is set at 500KH, but it is only for the boot sequence.

    How does the programmer configure the PLL ?

    Regards,

    Diane

  • The bootloader is in the ROM which is executed at power up to perform boot sequence. If CLK_SEL = 1, the PLL is bypassed and CLKIN is routed to SPI as peripheral clock to be divided by 25 to become 491 kHz to boot for the boot sequence.

    How you configurate for multiplying by 3 to 36 MHz? Also, if CLK_SEL = 1, PLL is bypassed for boot.

    Regards.

  • The 36 MHz is set either by the bootloader, only in case when there is no program (no valid boot image) to load.

    The boot sequence (refer to datasheet of TMS320c5505) is:

    - set the system clock to approximatively 12Mhz (bypassing the PLL when CLOCK_SEL=1 or use the PLL with RTC clock when CLOCK_SEL=0)

    - then, try to load and boot program on different peripherals (configuration of SPI at 500KHz)

    - when no program was found, the boot sets the PLL out approximatively to 36MHz.

    I think that the system clock is still 36MHz after the boot, when the programmer is running. That's why i ask if the programmer configure the PLL before loading the new program ?

    Is the programmer able to load the new program at a frequency upper than 500Khz on SPI ?

    Regards,

    Diane

  • Ok. I start seeing what you are doing.

    First, this is in the Boot Configuration paragraph. SPI peripheral clock is gated.

    "By the time the bootloader releases control to the user code, all peripheral clocks will be "off" and all domains in the ICR, except the CPU domain, will be idled."

    Second, the bootloader's 36 MHz setting is to loop for USB boot. I would recommend programming the PLL instead of using this leftover setting. Can you quickly test by using the GEL file to program the PLL before executing the programmer?

    Regards.

  • Hi Steve,

    We finally found the solution to our problem by downloading the programmer source code and rewriting the programmer.

    First, we reconfigured the pin mapping according to our configuration, and then, I wrote a new function to send data on the SPI. By looking at the scoped spi transaction, I saw that even if there was a part in the programmer code suggesting that it deals with 24 bits adresses, it doesn't.

    Every time the programmer tried to write a byte in the flash memory, it sent a 16 bits address followed by our data. This is why the writing failed.

    So I wrote a new function that is sending 24 bits addresses and this is now working.

    Thank you for the support you provided.

    regards,

    Antoine

  • Great! Problem solved. Glad to help.

    Regards.

  • Hi Antoine,

    Where can I download the programmer source code from?

    Thanks,

    HR

  • Hi Antoine,

    Thanks !!

    HR