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 ROM serial flash programming problem

Other Parts Discussed in Thread: TMS320F2811, CONTROLSUITE

Hello,

I have been trying to flash my application via serial port  for TMS320F2811 device like given in the example 

http://www.ti.com/lit/an/spraaq2/spraaq2.pdf

Currently, I am using the CKFA code modified for F2811 device and trying to flash via the hyperterminal from my PC. I am able to boot from UART and send data via serial port to Boot ROM and tried transferring CKFA.bin as given in the example and it works..it asked for relocking baudrate and erase flash and after erasing flash, I transferred the AppCode.bin given for 128kW to check if the application is getting programmed and it successfully completed and showed application programmed.

I tried to do the same procedure for my existing software application .out file which i flash with JTAG normally. The .out file and .map file, I rename them to AppCode.out and .map as given in the example and run the batch file given in the example to generate .bin file  for F2811 device. Now CKFA gets loaded properly and when i start transferring my new .bin file, the application programming starts normally and keeps giving the "." as progress and after some time...it does not end and it just stays without giving any error and does not show application programmed, I have removed cheksum verification since the expected checksum by the CKFA code will be different now.

I am attaching a picture of hyperterminal where it stops.

I am unable to figure it how it works for the sample application and not for my application, Is there any specific changes required in CKFA code like increasing RAM size or buffer size, does it stop because of that?? Please suggest

  • Hi,

    We have a new serial_flash_programmer in controlSUITE. Please see www.ti.com/lit/sprabv4

    I would start debugging this by loading the CKFA code and using JTAG and trying to load your application while the CPU is running the kernel.

    sal
  • Hi Sal,

    I tried debugging the CKFA code and tried to load the application, but the serial port functionality does not work when i debug using my JTAG. I am unable to send any character via hyperterminal. And regarding the serial flash programmer you have suggested, it does not support F2811 device. Please suggest.

    One more thing, since we haven an external watch dog, i have added a GPIO pin toggle in the Flash callback to trigger the watch dog in the CKFA code, but whenever i add this code the SCI communication does not work, when i comment out the GPIO code it works.

    void MyCallbackFunction(void)
    {

    if(SCIARegs.SCIFFRX.bit.RXFIFST == 16)
    {
    while((SCIARegs.SCIFFRX.bit.RXFIFST>1) && (BufferIndexMax>0))
    {
    *BlockBufferPtr++ = SCIA_FIFO_GetWordData_swapEndian();
    BufferIndexMax--;
    }
    if(SCIARegs.SCIRXST.bit.RXERR || SCIARegs.SCIFFRX.bit.RXFFOVF)
    {
    if(BlockRemain == 0)
    {
    SCI_SendStatus("\n\rChange configuration to 128 kW FLASH ");
    Example_Error(104);
    }
    else
    {
    SCI_SendStatus("\n\rSerial-Comm Failure - 2 ");
    Example_Error(105);
    }
    }

    }
    // Toggle pin, service external watchdog etc
    //GpioDataRegs.GPFTOGGLE.all = 0x0080;
    *GPFTOGGLE = 0x0080;
    MyCallbackCounter++;

    Aviinaash S
  • I suggest looking at the flash kernels in controlSUITE and porting them to your device. The bootloaders between devices should be identical and the SCI modules are likely very similar.

    I would look at the differences between the SCI registers and the pin mappings for the device, as well as the boot select pins.

    sal
  • Thanks Sal, I will look at the flash kernels and try a similar approach for my F2811 device.

    But my major query in the previous post was, we have to serve an external watchdog in our board, by toggling one of the GPIO pins of the F2811 device. So as provided in the document, I am toggling the GPIO pin in the Flash callback function but it does not seem to work, the moment i try to initialize the GPIO mux register and GPIODIR register for the particular pin, I am unable to send or receive any data via my SCI, is there any particular reason for that or am i doing it wrong? Please suggest. For testing purpose i called the Flash_ToggleTest API which toggles the pin infintely, for that pin and it seems to serve the watchdog in that case. So what could be wrong?

    Thanks and Regards

    Aviinaash S

  • Is it a pin you are using for SCI communication? I would check to see if you are muxing the wrong pins and somehow re-configuring the pins used for SCI communication.

    Are you seeing the c28x return back to the flash loading application when executing?

    sal
  • I am also having the same problem Aviinaash Sankaranarayanan,

    Did you fixed the problem i tried the all the ways still the process stops at data transfer only.


    if you completed this task please share with me it helps me a lot.

    Goutham kumar

  • Hi Sal,

    Thanks for your suggestions, it was the mux register set to wrong values. I debugged further in this issue, I found out that I am flashing 4kW buffer at a time. With my application upto 31 iterations the Flash programming API returns success, but in the last buffer, the Flash programming API never returns, my code is always stuck in the callbackfunction, I put a debug message in the callback function and in the last 4KW flash programming it never returns and my callback function debug message keeps printing. What could be the reason for the Flash API to not finish programming and return.

    Thanks and Regards,
    Aviinaash S
  • Hi,

    I need a little more information because I am not sure what changes you have made.  What programming tool are you using?  Did you port the serial flash kernels to your device?  

    What Flash API function are you calling?  Have you checked to see if the Flash Pump is ready before programming?  Have you checked if there were any errors before programming?

    Is the whole application 4k words?  

    sal

  • Thanks SAL for your help. I modified the CKFA code to be much simpler and it seems this problem is happening only when i use hyperterminal tool, I used another tool for file transfer instead of hyperterminal and it is able to program the flash properly without any problems. After flashing and rebooting, I am able to load the code properly from FLASH and things are working fine now. I donno why hyperterminal was missing 2 bytes of data during the transfer, which caused it to wait infinitely with the buffer not getting full.