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.

TMS320F28035: Serial Programming via SCI Boot Mode

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE

Hello E2E Members,
I have been working on a motor control project on TMS320F28035 controller. So far I have been able to develop the software for the same. However, I want to give a firmware update feature at the customer site. I came across a few articles and application notes for the same. A few of them involves using the ROM bootloader to program the device via ports like CAN, SCI etc and some asks to write a secondary bootloader and split my available flash to accomodate two firmware applications and update the firmware in the complimentary firmware location i.e. memory will be segrated in tree parts :- SBL, Application 1 and Application 2.
For now I want to go ahead with serial flash programming using the SCI boot mode by setting the two boot pins (GPIO34 and GPIO37 in this case).
Process I have understood :-
1. Hardware boot selection needs to be done i.e SCI boot mode in our case.
2. A flash kernel needs to be uploaded via SCI port available on the controller.
3. The flash kernel should be able to erase the flash memory and download new firmware image via the same SCI port.
4. The new firmware image will be sent over SCI port and the flash kernel takes care of the upload.
5. On a system reset, we can enter the normal operation of firmware by disabling the BOOT pins. So it can boot from the flash memory.
Please confirm if the process flow is correct. If not, please suggest possible corrections.
Further queries :-
1. I am not sure about the exact implementation of the same, I can generate the HEX files from CCS for my application program but do I need a third party software to transmit that HEX to MCU?
2. Can I make my own desktop software to send the flash kernel and application firmware? What are the points I should consider in that?
3.I visited the example code for flash programmer present in the C2000ware. I have found "f2803x_flash_kernel" in the same directory, Can I use this directly as my flash kernel? Are there any modifications to be done?Please recommend if any.
Thank you
Regards
  • Shwetank, just returning from the holidays, I'll get back to you by the end of the day. Thanks, Sira

  • awaiting further response.

    Thanks

  • Shwetank,

    Your steps 1 through 5 are correct.

    On your questions:

    1. Yes, the .hex can be generated in CCS. There are a couple of different options on how you can download this .hex to the MCU. I'll address this further in my next point.

    2. We provide a desktop Serial Flash Programmer utility in C2000Ware. This is "tuned" the SCI Flash Kernels we provide i.e. there's a specific command protocol that is followed. So 3rd party software will not work here directly. So there is really no need for you to create a desktop utility. Normally, in practical applications, the host will not be a desktop PC. It may be another MCU. So customers will use our utility as reference code, and build their own host software.

    3. Yes, you can use this as your Flash kernel.

    Thanks,

    Sira

  • Dear Sira,

    Thanks for validating the flow for firmware transfer.

    I have tried to program the TMS using the serial flash utility, however, it gets stuck in the application autobaud stage. I will be debugging the same and hopefully will be able to program the same.

    As you suggested the flash utility can be used as a reference code to build our own software, combining that with the serial flash application note() I want to write my software to first program the Kernel and then the application firmware.

    Problems I am facing:-

    1. The application note gives the list of commands, but the flow of those commands i.e. what commands( packets ) are to be sent, is not clear to me. Would be helpful if you can suggest any project on the same.

    2. I have understood the autobaud process i.e. sending one character ('A') to set the baud rate. But what commands should I send once the autobaud is received. Should I go on with DFU CPU command? the erase command? etc...

    3. Tried sending autobaud character, received the autobaud character from TMS that should set the baud rate. Now if I send another command as described in section 5.1 of the application note, no acknowledgment is received.

    Commands sent :-

    1. SCI boot mode was selected.

    2. Autobaud character was sent via serial comport to TMS and received back the autobaud character indicating correct baud rate setting

    3. Sent the Erase CPU1 command, no acknowledgment received, TMS gets booted to the application already flashed in it and can not send any more boot commands to it.

    Thanks

  • Shwetank,

    The serial flash programmer utility source is present here 

    C:\ti\c2000\C2000Ware_3_03_00_00\utilities\flash_programmers\serial_flash_programmer\serial_flash_programmer

    Referring to the source will help you address questions 1 and 2 you had.

    For 3, so it appears you are not able to get this working out of the box. What hardware are you using? A F2803x controlCARD?

    Can you send a screenshot of the command prompt so I can see what works and where it is stopping?

    Thanks,

    Sira

  • Sira,

    I am using a USB to TTL directly from the PC to TMS320F28035 on the SCI pins. I was now able to serially flash the TMS using the serial flash utility, apparently the HEX files need to be formatted using your HEX2000 utility in the sci8 format.

    That worked and I was able to program my TMS using the serial utility.

    Also found the utility source code and tried to use it on my own software(custom PC software for my use) and was able to send the kernel using that.

    1. Was able to run the serial utility completely.

    2. Was able to upload the kernel using my own software that I built using the source code of serial utility.

    The last problem I am facing is while sending the Application to be flashed. ( Kernel autobaud was done, Kernel transfer done, application autobaud done, Application can not be sent)

    As far as I have understood the kernel can be sent directly to the TMS i.e. the HEX file directly. However, the application HEX needs to be sent in packets?

    Still trying to identify the packet format for HEX transfer using the utility source code and Kernel CCS code. Let me know if you can shed more light on that.

  • Shwetank,

    Good to hear that you were able to get everything working when using the TI serial flash programmer utility. Is this custom hardware, or is this a TI ControlCARD?

    And it looks like you're running into issues when using your own utility that's based on our serial flash programmer utility software.

    I am not well-versed in the command protocol, so let me ask a colleague for guidance on this.

    Thanks,

    Sira

  • Shwetank,

    Have you looked at Section 4.1.1 of sprabv4? Step 5 says "the application can be downloaded using the same format as the flash kernel."

    Let me get back to you (Monday) on what portion of the utility source to look at.

    Thanks,

    Sira

  • Shwetank,

    For F2803x, it essentially has 1 function since it doesn’t have DFU/erase/etc commands like the newer devices.

    Look at the f05_DownloadImage() in f05_DownloadImage.cpp at \utilities\flash_programmers\serial_flash_programmer\serial_flash_programmer\source

    Thanks,

    Sira