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.

custom flash bootloader

hello i am new to TI MCUs, and relatively new to MCUs in general

i am working with the TMS320F228335 and have an application in flash sectors A and B, is it possible to load a bootloader to flash sector C and boot straight to there on power up, then jump back to the application in A?

and how would i load two seperate applications onto flash in CCSv5? so far i have just been working with example codes.

Thankyou

  • Hi Michael,

    You'll need to place your bootloader in the sector where the boot to flash boot mode branches to.  The bootloader needs to be the first application that runs on every boot to ensure that you can always do your firmware upgrade.  Take a look at the linker command file to figure out this location.  You can also use the linker command file to move both the bootloader and your real application around in Flash.

    You should be able to load two separate applications just like you would load one application.  Just do them sequentially.  You may have to adjust the erase settings so that it doesn't erase the first application.  You should be able to do this from the Tools, On-Chip Flash menu.

    Regards,

    Trey

  • thanks. i found the location in the example code. i notice that it links to _c_int00 eventually. should this be run before or after the bootloader operations? and where does it jump to after that?

  • _c_int00 is some initialization code that needs to be run to setup the processor and the C environment.  You can find this code in the lib directory of the compiler...typically c:\ti\ccsv5\tools\compiler\c2000....

    You'll want this to be part of your bootloader, but probably not your application (since it will already have been run by the bootloader).

  • And lastly,

    How would i perform a jump to another memory location (the application) on the F28335. I am having trouble finding any examples of this.

    Thankyou

  • Michael,

    It requires some "fancy" pointer junk to do.  Take a look at this code:

    void (*hostFunction)(void);

        //Grab function pointer and call function
        hostFunction = (void (*)(void))*(uint32_t *)&(commandPacket.pucArgs[0]);
        //Fingers crossed that we return successfully!
        hostFunction();

    First I declare a pointer to a function, then i associate an address with that pointer.  In this case that address is coming from this commandPacket.pucArgs variable.  Then once the pointer is set you can branch to the function just like you were calling any other function.

    Trey

  • Hey Michael,

    Were you able to figure this out ? Any examples available for this particular application ?

    Please advise.

    Kamal Joshi
  • Hi Kamal,

    If you would like additional help with your question, I recommend creating a new thread that would allow it to receive better support. There's a better chance of your question getting answered there, instead of posting in an older thread.

    Thanks,
    Ozino