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.

TM4C123GH6PM: Remote / Firmware over the air Updates

Part Number: TM4C123GH6PM
Other Parts Discussed in Thread: CC3200, EK-TM4C123GXL

Hi Folks,

I've been digging into the options for using the boot_loader to update the application on the TM4C123GH6PM Tiva processor. Specifically looking at the TivaWare BootLoader User's Guide SPMU301E document.

What I'm having a problem wrapping my head around is the process when doing remote updates. I think I understand how to put the device in update mode and send the new application from an external program to UART0 or I2C.

But how would I do it if I have the new application already in a local character array? For example received via cell module on UART2. How would I run the bootloader and send the character array from UART1 to UART0? Assume the hardware of UART1 and UART0 are tied together on the PCB.

I noticed there are UART function such as UARTReceive() and UARTSend(). Would I just send my data using the UARTReceive() function and then jump to the bootloader? This isn't making sense to me either.

Thanks for any suggestions. (I'm coming from the CC3200 side where I wrote the new application to flash, set a variable and then rebooted. During the reboot process the boot_loader would check the flags and then validate the new application saved in flash.)

thanks again,
Bob

  • Hi,

    But how would I do it if I have the new application already in a local character array? For example received via cell module on UART2. How would I run the bootloader and send the character array from UART1 to UART0? Assume the hardware of UART1 and UART0 are tied together on the PCB.

    Sorry, I'm not clear what you want to do. What do you mean you already have a new application in a local char array. Why is the firmware in an array? You mention UART2, UART1 and UART0. Which one are you using? I suppose you have read the bootloader user's guide. The flash bootloader is a small piece of software that will reside at address 0x0. This bootloader will configure one of the UART ports of your choice (e.g. UART2) to receive your program image from an external host. The bootloader is not meant to be an application that transfers data from one UART port to another UART port as a gateway application. Of course, you may modify the bootloader but that is not really recommended to blow up the bootloader into an full fledge application.  Once the application firmware is updated, it can jump back to the bootloader so that you can update the firmware again. The application firmware will be programmed at an non 0x0 address like 0x2800. This means that it is your application firmware who decides when to jump back to the bootloader to start another firmware update. 

    Why don't you try the bootloader examples in TivaWare? C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c123gxl\boot_serial is an example bootloader and C:\ti\TivaWare_C_Series-2.2.0.295\examples\boards\ek-tm4c123gxl\boot_demo1 is an example application. The boot_serial will configure the UART port and download the application image "boot_demo1" through the UART port and then program to the flash. At each power cycle, the bootloader will determine if the application is already programmed. If the application is already present then it will just jump to the application and the application will start. In this simple application example boot_demo1, it will blink the LED and wait for some seconds and then jump back to the bootloader to wait for another firmware update. This is how the TivaWare bootloader works. 

  • Ignore the character array statement, it isn't important.

    Basically I can download a new firmware image over the air (using a cell phone module connected to UART2.)  Now I need to get this image to the bootloader.  How do I do that?

    Can I write directly to flash from my application and then trigger the bootloader to get it from flash?

    The important part is the TIVA chip will be far away from human interaction, so it must do everything automatically.

    thanks for the reply,

    Bob

  • Hi Bob,

      Personally, I have not seen people doing it this way. You are saying your application has already downloaded the new firmware via UART2. Please correct me if my understanding is not correct. How can you be sure you have enough memory to store the new image. TM4C123 only has 256kB of flash and 32kB of SRAM. Your application may occupy much of the flash already. You can only store a portion of your new firmware in the SRAM. You will be asking yourself to program the new firmware currently stored in the SRAM to flash if this is what you envision to do. You will be asking to erase the flash while running the code from flash at the same time. This will not work. 

      I think you will need to modify the bootloader so that it knows where to find the new firmware image that is already downloaded and let the bootloader do the flash programming. 

      I will suggest you look at the bl_main.c file and look for the "Updater" function. This is the function that program the flash with the new firmware. 

  • Thanks.  I appreciate the feedback.   I'll respond tomorrow evening (from originating account) and close out the question.

    take care,

    Bob

  • Hi Charles,

    I forgot to answer one of your questions.  The cell module I'm using (on UART2) has 1.5MB of user file space.  It will hold the images and the bootloader will get from there.  (Previous designs used the CC3200 where the flash size was much larger than TIVA's...)

    thanks again,
    Bob