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.

TM4C123G in-system firmware update



Rather than updating the code via JTAG, I would like my application to be able to update itself, in-system. I don't think I can use the standard boot loader routines, because the UART, I2C, and SSI interfaces aren't available, and I doubt I can implement their protocol on top of ours

Since I'll be overwriting my code memory, I will need to leverage existing ROM routines, or put something like BLInternalFlashErase() and BLInternalFlashProgram() into RAM, or keep such a routine in a preserved part of Flash (that only gets programmed via JTAG).

My application would load the (<32K) code image into RAM, verify it, disable interrupts, call the programming routine(s), then reset.

Does this sound reasonable, or am I reinventing the wheel?

  • Andy Sapuntzakis said:
    …because the UART, I2C, and SSI interfaces aren't available, and I doubt I can implement their protocol on top of ours

    If none of the conventional ports are available to the outside world(you did not mention USB), how are you going to download the new firmware?

    Andy Sapuntzakis said:
    Since I'll be overwriting my code memory, I will need to leverage existing ROM routines, or put something like BLInternalFlashErase() and BLInternalFlashProgram() into RAM, or keep such a routine in a preserved part of Flash (that only gets programmed via JTAG).

    That would be in the bootloader area..

     

    A few more details are needed I guess.

     

  • The processor's link to the "outside world" while in-system uses a shared RS-485 connected UART1. No USB on the device we use.

    I thought the bootloader routines were in ROM - doesn't the TM4C always boot from Flash?

  • Andy Sapuntzakis said:
    The processor's link to the "outside world" while in-system uses a shared RS-485 connected UART1. No USB on the device we use.

    You can adapt the standard UART bootloader to use the RS485 port, then connect a RS485 to ‘PC’ adapter(be it RS232, USB or Ethernet) to your RS485 link, and use the LM Flash programmer to flash the firmware.

    Andy Sapuntzakis said:
    I thought the bootloader routines were in ROM - doesn't the TM4C always boot from Flash?

    The ROM bootloader will be executed when the flash is empty(after a reset and there’s no jump to the reset vector at address 0).

    In your case, you’ll need to adapt the bootloader so you can use the RS485 link, flash this bootloader at address 0, and flash your main application above that bootloader(say at address 0x00001000H).

    If you want to upgrade the(a slave’s) firmware, you’ll have to, stop all communication on the RS485 link(that will be a function of the master), send a ‘jump to bootloader’ command to the desired slave you need to upgrade, then once the slave has entered the bootloader(you can/could check that with the master), flash the firmware(at address 0x1000H, in this case) using the LM Flash programmer(or alike) via the RS485/PC adapter.

    This is one option, you could also have the master do the flash programming(but it’ll need the binary firmware file), it all depends on your hardware/software/time you want to put in it...