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.

TMS320VC5402: One data over two seems not correctly programmed

Part Number: TMS320VC5402

Hi all,

I am investigating on a failed board in the production.
The design is pretty old and the production is quite big, we hade few hundred of this board.

In one of them, I am not able to program it correctly.

So I have two question, how could we explain that in the bootloader and in the external flash memory only one of the two words are correctly programmed?

One over two is stuck at FFFF, do you have ever seen such problem?

I am wondering if a critical part in the RAM is not damage preventing the full word to be correctly written in the IPROG, DATA or external flash?

How can I load my bootloader directly with my blackhawks USB XDS510 ?

I tired the load memory function but without success...

Please find attached the comparision between memory read by CCS versus the .hex file content.
00 are replaced by FF.


Thank you in advance for your help,

Regards,

  • Hi Avid,

    In one of them, I am not able to program it correctly.

    So I have two question, how could we explain that in the bootloader and in the external flash memory only one of the two words are correctly programmed?

    The bootloader is in on-chip ROM. Are you saying there is a secondary bootloader in the external flash, along with application program/data?

    So you're attempting to reprogram the flash, and the flash isn't correctly written on one board, while it's correctly written on the other board? Do you have any other boards to check whether you see the same behavior?

    How is external flash interfaced?

    • Is the External Bus Interface being used? What is the configuration?
    • What type of flash is being used? Do you have the datasheet?

    Are you able to erase the flash? Typically a "0xFFFF" pattern would mean the word hasn't been written. Can you confirm this by checking the datasheet?

    I am wondering if a critical part in the RAM is not damage preventing the full word to be correctly written in the IPROG, DATA or external flash?

    IPROG and DATA aren't mentioned in the VC5402 datasheet. Are these DARAM memory regions defined in your linker command files?

    Do you mean you suspect the internal RAM contents which is being written to the flash is correct and/or doesn't contain the correct data?

    Can you connect to the board via JTAG and step through the programmer code? Can you inspect the internal DARAM contents before it's written to the flash?

    How can I load my bootloader directly with my blackhawks USB XDS510 ?

    Do you have the executable .out file for your bootloader, prior to any format conversion for flashing? If you can connect to the board via JTAG (which I assume is the case since you shared a snapshot of the Memory Browser window in CCS), then you should be able to load the bootloader .out file like any other executable.

    Regards,
    Frank

  • Hi Frank,

    Thank you for your prompt reply. Here are my answers :

    Are you saying there is a secondary bootloader in the external flash, along with application program/data?

    No sorry if my explanation was not clear, in fact, the bootloader is in ROM as you mentioned and we have also the firmware in the external flash. The bootloader and FW are programmed via a bootloader loader.out that enable CAN communication where we are able to load both bootloader and FW. What I have seen is that both the bootloader and written data into flash we are missing half of the words.

    So you're attempting to reprogram the flash, and the flash isn't correctly written on one board, while it's correctly written on the other board?

    Yes correct.

    Do you have any other boards to check whether you see the same behavior?

    No it is the first one with this problem.

    How is external flash interfaced

    The external flash (S29AL008J) is connected through address bus A15-A0 and parallel data bus D15-D0 directly to the DSP

    Are you able to erase the flash?

    Yes I am able to erase the flash, and also to program it without problem. So it doesn't come from the flash I would say.

    0xFFFF means it is empty. So I agree with you the data is not written.

    But it is the same in the internal ROM. As per my screenshot from the DSP ROM memory, we could see that only one word over two is correctly written.

    Are these DARAM memory regions defined in your linker command files?

    I don't know how to check that, could you help me?

    Can you connect to the board via JTAG and step through the programmer code?

    Yes I can, that's how I was able to get the screenshot of the ROM region

    Can you inspect the internal DARAM contents before it's written to the flash?

    I will try to see if I can put a breakpoint there. I will keep you posted.

    Do you have the executable .out file for your bootloader

    Yes I have, so I will try to do so. 

    I hope I replied to all your request,

    Regards,

    Avid

  • Hi Avid,

    Thanks for the response, but I'm still unclear on what you're trying to do.

    the bootloader is in ROM as you mentioned
    The bootloader and FW are programmed via a bootloader loader.out

    The bootloader is in on-chip ROM and can't be updated. Please see www.ti.com/.../spra618, 1.2 On-Chip ROM Description. What do you mean the bootloader is programmed by bootloader_loader.out? How are you loading bootloader_loader.out?

    The on-chip ROM bootloader can transfer use code from different external sources. In this case, I imagine you're using the parallel boot mode, please see www.ti.com/.../spra618, Parallel Boot Modes (8-bit and 16-bit supported), and transferring the user code from the external flash. Is this correct?

    You should have some method of programming the external flash. Typically this is accomplished with a separate executable (.out file). Is this how you program the flash?

    But it is the same in the internal ROM. As per my screenshot from the DSP ROM memory, we could see that only one word over two is correctly written.

    From what I can determine, your screenshot shows memory in external memory space @ 0x8000. Please see the VC5402 datasheet (www.ti.com/.../tms320vc5402, memory map).

    I don't know how to check that, could you help me?

    What are your definitions of IPROG and DATA? Where did you obtain these definitions? Please see the memory map in the datasheet.

    It seems like you should be stepping through your flash programmer. Do you have the .out file for it, and can you load this via JTAG?

    Regards,
    Frank

  • Hi Frank,

    Thank you for your answer.
    I have done a lot of researches and thanks to your link, it is now more clear to me.

    Actually, I understood that as we put MP/MC to one, and regarding the address, we are looking into the external flash.

    So basically, a way to program the bootloader to our external flash is to run a bootloader_loader.out code. This enable the CAN communication (with MCP2515) and therefore we are able to load the bootloader code + the firmware code into the external flash.

    Now, in my particular failed board that I am investigating, I have about the half of the data in the external flash. As you have seen in my screenshot one data over two seems empty.


    This is not coming from the Flash component, I have tested it and I can read and write it correctly via XJTAG software, a specific boundary scan SW where I have access to load a hex file into the flash directly. 

    But when I try to program my external flash through the CAN and therefore ask the DSP to decode the CAN request and write into the flash, then I have only half of the information. I am afraid that a RAM section is faulty explaining why only half of the word is sent to the external flash.

    BTW, I don't know how to load my bootloader + firmware code directly in the external flash via CCS. If there is a way please fill free.

    Also, let's say that I am able to dump an image of an external memory into a file from a good board and reinject it directly into the flash of my failed board, the DSP should run properly? In my config no need for any programation inside DSP's register right?

    What are your definitions of IPROG and DATA?

    I have understood that the internal code is copying a part of the PROG into the IPROG at the startup. The DATA area is defined in my MAP file generated with my .OUT file.

    So a corruption in IPROG or DATA could explain why I am missing half of my words?

    Thank you in advance,


    Regards,

  • Hi Avid,

    My understanding is the DSP is connected to:

    • MCP2515 CAN controller via SPI. This provides communication with a CAN bus.
    • S29AL008J flash via External Bus Interface.

    You have a DSP program bootloader_loader.out. This program:

    • enables communication with CAN
    • communicates with some other device on the CAN bus
    • receives data to write to flash from the other device on the CAN bus
    • writes the data to the flash

    After the flash has been programmed, the DSP would be set in MP/MC=0 mode and use parallel boot mode to boot from the flash.

    Is my understanding correct?

    MP/MC to one

    Ok, that means you're in Microprocessor mode. However, this means you aren't executing the on-chip ROM bootloader. Please see the VC5402 datasheet, on-chip ROM with bootloader.

    a way to program the bootloader to our external flash is to run a bootloader_loader.out code

    How do you load bootloader_loader.out to the DSP memory? Are you loading this from JTAG? Without loading bootloader_loader.out to DSP memory, there is no way to communicate with the CAN bus and write the flash, right?

    This is not coming from the Flash component, I have tested it and I can read and write it correctly via XJTAG software, a specific boundary scan SW where I have access to load a hex file into the flash directly.

    Ok, so you're saying you have some other method of writing the flash aside from bootloader_loader.out, and you can also verify the flash contents is correct? But that when you connect to the DSP using JTAG (without having executed bootloader_loader.out), and view the flash memory contents, it appears every other word hasn't been programmed, despite the fact that you've verified it's correctly programmed?

    But when I try to program my external flash through the CAN and therefore ask the DSP to decode the CAN request and write into the flash, then I have only half of the information. I am afraid that a RAM section is faulty explaining why only half of the word is sent to the external flash.

    Or that when you program the flash using bootloader_loader.out, only then the flash contents is incorrect?

    I have understood that the internal code is copying a part of the PROG into the IPROG at the startup. The DATA area is defined in my MAP file generated with my .OUT file.

    What is the "internal code"? Code in DSP ROM? Part of bootloader_loader.out? How is the "internal code" being loaded?

    Are you looking at the map file for bootloader_loader.out? Can you please share a snippet of the map file showing the IPROG and DATA memory regions?

    So a corruption in IPROG or DATA could explain why I am missing half of my words?

    I suggest the following. Ensure MP/MC=0 so the bootloader doesn't execute. Load a debug build of bootloader_loader.out via JTAG. Then step through the code and check:

    • Are words properly received in DSP memory from the CAN bus, or is there corruption?
    • Are words correct in DSP memory buffers which will be programmed to the flash prior to programming?
    • Are words correct in the flash after programming? Verify this with your "XJTAG software" method which is independent of the DSP.

    Regards,
    Frank