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.

TMS320F28377S: HOW TO USE SPI BOOT LODER FOR UPDATING THE FIRMWARE

Part Number: TMS320F28377S


I am using TMS320F28377S microcontroller and I want to update its firmware using external flash memory (Microchip SST26VF032B). Please tell me how I can do this. Actually I want to update firmware over the air, and by using PEN DRIVE. In this, first i want to copy the firmware file on flash and then start SPI bootloader to update the firmware .I found "SimpleLink" is available for the TI wireless MCU. So any similar solution is available for TMS320F28377S ???

  • Hi Sam, 

    We have received your request and identifying the domain expert who can help answer your questions.  Do you already have a solution for firmware update working through SPI without the over the air capability?  

    Regards, 

    Krishna

  • Thanks for replay,

    Do you already have a solution for firmware update working through SPI without the over the air capability?  --No I are trying to develop it, I am trying to use SPI boot loader given in C2000

  • Ok thanks!  To specifically answer your earlier question, the domain experts have confirmed that we do have a solution similar to the SimpleLink one. 

    Please let us know how we can be of further assistance.

    Cheers!  

    Krishna 

  • This is the point I want to cover.

    1) Updating firm ware using external flash-- Where to store the firmware file in flash? (We are able to interface flash memory using SPI and we can write in it using SCI).  

    2) SPI Boot loader  is used to update firmware or any think else is required? 

    3) In case of power failure  how to restore the old firmware?

    Thank's  

  • Hi Sam, 

    Can you please clarify your explanation with a block diagram of exactly what you are trying to accomplish?  We will be able to help you better. 

    In regards to you question in item 3.  This is a system level decision that you would have to make on how to implement.  One simple and very commonly used method is to create a small permanently resident monitor or a bootloader image that is always present and has the ability to communicate with a host.  On power up it waits for a command from the host to see if there is a new program available.  There could be a timeout of a reasonable duration and if no command is received from the host, the monitor program can simply launch the application already available.  If an application is not available to launch, it can just go back to the monitor and continue to wait for a command from the host.  If there is a command from the host, then an appropriate handshake can begin to start the process of updating the program image into a bootable location.  Once the image is loaded the application can be launched.  If there is power failure during the update process, then the update is not complete and the application cannot be launched.  So on the next power, the target will start the process again from within the monitor and wait a command from the host to repeat the update from the beginning. 

    Another alternative is to have two images: one old and one new.  Only one image could be updated at a given time and there could be a method set up to choose which image to boot from. 

    Hope this is helpful. 

    Cheers!

    Krishna  

     

  • Please see the attached pdf for the flow chart.

    And as you say " small permanently resident monitor or a bootloader image that is always present and has the ability to communicate with a host"-- Please tell how to write this type of code. I don't have any idea about this. 

    SPI update.pdf

  • Hi Sam, 

    I asked for block diagram that shows your system, not a flow chart.  The flow chart does not help understand what you are trying to do.  So here are some more specific questions for you: 

    1.  First you said:  I am using TMS320F28377S microcontroller and I want to update its firmware using external flash memory (Microchip SST26VF032B).  So what I understand is:  you have a TMS320F28377S microcontroller based system that already running on some firmware it has in its internal flash.  Is this correct?

    2.   Subsequently you want to update the firmware in the TMS320F28377S device internal flash, using the new program available in Microchip external flash.  Is this correct?  If so, how does the new program get into the external flash?  How is the external flash interfaced to the  TMS320F28377S.  

    3. Which bootmode have you configured for the TMS320F28377S device.

    Have you reviewed in detail the TRM chapter 4 (ROM Code and Peripheral Booting)?  www.ti.com/.../spruhx5

    Cheers!

    Krishna

  • As you ask,

    • you have a TMS320F28377S microcontroller based system that already running on some firmware it has in its internal flash.  Is this correct?

    Yes , You are right, we are developing this for upgrade firmware on filed. And microcontroller running on firmware. 

    •  Subsequently you want to update the firmware in the TMS320F28377S device internal flash, using the new program available in Microchip external flash.  Is this correct? 

    Yes

    • If so, how does the new program get into the external flash?  How is the external flash interfaced to the  TMS320F28377S.  

    The external flash in interfaced by SPI and SPI A port of microcontroller is used for this. (we already interface it, but I having no idea how to use it for firmware upgrade). 

     

    •  Which boot mode have you configured for the TMS320F28377S device.

    Boot form flash, 

    Presently we put GPIO 72 and GPIO 84 on pull high and pull down TRST pin to pull low, this is for boot form flash. 

     

     

  • Hi Sameer, 

    You are not fully replying to all my questions.  It is possible that you do not have all the answers, so please contact the right people and answer all the questions being asked.  Please note that to help you in this manner is going to be impossible, if you do not provide clarity.  So let us try this again and I will pick up with the last question you answered (which was helpful). 

    1. You have configured Flash boot mode with GPIO 72 and 84 pulled high.  Okay.  Did you use CCS to load the application into internal flash memory?

    2. Does your application work as configured in the above step 1?  If yes, how do you confirm that?  If no, let us work on fixing this first.

    3. If your application is working from the internal flash, then what is the purpose of the external flash?

    4. What is the size of your application?

    5. Have you reviewed in detail the TRM chapter 4 (ROM Code and Peripheral Booting)? https://www.ti.com/lit/pdf/spruhx5 Do you have any specific questions?

    6. Do you have an external host computer that interfaces to your target over SCI?

    Look forward to clear and complete answers to the above. 

    Regards,

    Krishna 

  • As you ask,

    1. You have configured Flash boot mode with GPIO 72 and 84 pulled high.  Okay.  Did you use CCS to load the application into internal flash memory?

    Yes, I am using CCS 9.2 (complier version is TIv 18.12.4) to load the application using JTAG XDS100 .

    2. Does your application work as configured in the above step 1?  If yes, how do you confirm that?  If no, let us work on fixing this first.

    My application is working fine and there is no issue in running code from microcontroller internal flash.Our product is already in production and there is no issue in running the application code.

    3. If your application is working from the internal flash, then what is the purpose of the external flash?

    As I mention in my first post, we want to up date firmware on field. For this we can use SCI port or PEN DRIVE.

    We are already using two flash utility are available in C2000 (serial_flash_programmer, usb_flash_programmer) for firmware update but for field use they are unreliable (we have to carry laptop with us for firmware update).  So we decide to put a GSM modem in device,  which communicate with microcontroller by SCI. The firmware file is transferred byte by byte in external flash and then we can update the firmware using external SPI flash.  Please see the attachment.

    4. What is the size of your application?

    The size of  .out file generated my CCS is 600kb. 

    5. Have you reviewed in detail the TRM chapter 4 (ROM Code and Peripheral Booting)? https://www.ti.com/lit/pdf/spruhx5 Do you have any specific questions?

    Sorry. I read the chapter four and I also see the flow chart  but I am not able to understand how to implement it as per my requirement.

    6. Do you have an external host computer that interfaces to your target over SCI?

    No in our product there is no host computer. it is a solar inverter. we are connecting GSM modem with SCI. 

    Any solution, similar to SimpleLink  for TMS320F28377S is available  then please suggest.  

    dig.pdf

     

  • Hi Sameer, 

    Thank you for taking the time for providing the answers clearly, it is very helpful and we are now able to understand what you are trying to accomplish.  Thanks for the block diagram also and it complements your answers well. 

    Okay, so I think you can use your GSM modem as the external host.  You do not need the external flash using SPI communication.  Please review the section 4.10.4.2 SCI Boot Mode.  Please ensure you understand the entire flow and ask questions specifically from that section if you need clarification. 

    The entire solution can be fully constructed using the internal flash memory and SCI boot mode. Please see the datasheet: http://www.ti.com/lit/pdf/sprs881 The total flash memory available is 1MB.  Your application size is 600KB, so you cannot have two images of the application saved.  However, you can design this in a way where, if there is a power failure in the middle of an update, the target can still recover such that you can repeat the update process again.

    Looking at your block diagram, I understood what you said in steps 1 and 2 (although I don't think you need step 2).  Can you please explain what you mean by step 3 and step 4?  Are steps 3 and 4 fully working also?  Do you agree that you do not have enough flash memory space to put two application images (old and new)?  

    Thanks,

    Krishna

    • Can you please explain what you mean by step 3 and step 4?  Are steps 3 and 4 fully working also?  Do you agree that you do not have enough flash memory space to put two application images (old and new)?  

    Step 3 is working in our program. But presently I am able to transfer the byte only on external flash. I don't know how to call SPI boot loader to use this file ( which is step 4). 

    • Do you agree that you do not have enough flash memory space to put two application images (old and new)?

    Yes, Internal flash of microcontroller do not have enough memory. This is the reason I want to use external flash.

    So please tell... 

    1) How to boot microcontroller form external flash.? 

    2) So please tell how to run program form external SPI flash?

    3) Any related example is available in C2000 documents??

  • Hi Sameer, 

    Thanks again for further clarity regarding your SPI boot requirements.  So it looks like you would like to do SPI boot using the external flash when you have a new image.  Secondly, you would like to boot from internal flash when you are not able to use the external flash image (due to power loss during programming or something like that).  The second method will use flash boot.  So you want to use SPI boot sometimes and also flash boot at other times.  Is my understanding correct?  

    If it is correct, have you reviewed 4.10.4.3 SPI Boot Mode in detail.  Do you have any questions related to that?

    Thanks,

    Krishna

  • Hi Sameer, 

    The design you have chosen for firmware upgrade seems to be quite complex.  To keep things simple you may consider a solution which does the following: 

    1. Use SCI boot,

    2. Download a single image and maintain a single image on target.

    3. If the download fails, you stop and retry

    4. Once the application is downloaded, you run it, do a few checks and if they look correct, you can mark the application as "valid"

    With this method you do not need external flash or the associated complexity.  However, please note that using the method described above, it will take some time to do this development.  If you would like to take this approach, please review the section 4.10.4.2 SCI Boot Mode.  Once you understand it, let us talk about it further. 

    Cheers!

    Krishna