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.

TM4C1292NCPDT: 07/06/2017 Regarding execution of firmware image from flash

Part Number: TM4C1292NCPDT
Other Parts Discussed in Thread: EK-TM4C1294XL

Hi,

I am working on a boot code. Flash memory is partitioned to accommodate boot loader, a common memory area to update flags, and two firmware images. They are positioned in the flash memory as,

Boot code: 0x00.0000 - 0x00.3FFF

Firmware image 1: 0x00.4000 - 0x07.FFFF

Common memory area: 0x08.0000 - 0x08.3FFF

Firmware image 2 : 0x08.4000 - 0x0F.FFFF

My boot code is to be such that the firmware images have to be compared and validated based on the flags in the common memory area and to execute the firmware image. Is there any similar implementations done? How to execute firmware image directly from the flash? Is there any function to execute the firmware image from the flash memory address?

Thanks and regards

Sandra

  • Hi Sandra,
    This post maybe helpful in answering your question. e2e.ti.com/.../2139115
  • There is a lot of information about boot-loaders the TivaWare library. There is an example boot-loader project that demonstrate use of a boot-loader with two example application projects.

    C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c1294xl\boot_serial

    C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c1294xl\boot_demo1

    C:\ti\TivaWare_C_Series-2.1.4.178\examples\boards\ek-tm4c1294xl\boot_demo2

     In short, each project is linked as a standalone firmware program but instead of starting at zero, it has its "vectors" at the start of some memory block. The boot-loader then decides which program to run (or to run an update routine). The boot-loader then loads the stack pointer and program counter of the application program chosen to run. This is done with an assembly language routine in:

    C:\ti\TivaWare_C_Series-2.1.4.178\boot_loader\bl_startup_ccs.s

  • Hii Bob Crosby,

    Thank you for your reply. In the project boot_demo2, inside the jumptobootloader(), SVC handler of bootloader is called by calling to the address 0x2c. To execute my firmware image at flash address 0x4000, how should I call? I tried by using the function ((void (*)(void))0x00004000)(); . Should I do anything else while using this function?

    Thanks & Regards

    Sandra

  • Hi Charles,

    Thank you for your reply. Please tell me how to store a variable in flash and how to use it later.

    Thanks & Regards
    Sandra
  • There are lots of ways to do this. I created a CCS assembly language project with a single .asm file and a simple link file. Upon compilation you get a warning about no entry point. That makes sense because this is not executable. I have attached this simple project. You can then program the file constant.out into the flash just like an executable program (Run->Load->"Load Program"), but when subsequently programming your boot loader or application program avoid erasing the constants by setting (tools->"On chip flash") Erase Method to "Necessary Pages Only".

    /cfs-file/__key/communityserver-discussions-components-files/908/constants.zip