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.

CCS/TMS570LC4357: Bootloader

Part Number: TMS570LC4357
Other Parts Discussed in Thread: CODECOMPOSER, UNIFLASH

Tool/software: Code Composer Studio

I am using the TI example bootloader example.

The code compiles and the example functions on both UARTs.

I now need to bring together the bootloader and my project such that the bootloader will jump to my code when told to (menu item 3).

The bootloder example looks to go to APP_START_ADDRESS defined as 0x200100.

Currently stepping through the code, Code Composer hangs when trying to jump to that address.

I currently have Code composer configured in both projects to "erase "Necessary Sectors Only (for program load) so that loading one program does not erase the other as they both have to be loaded sequentially.

(I have not gotten to the point where I'm downloading the hex yet, just trying to load the two programs manually to be sure I understand the compiler settings.)

Here are my questions:

  • Where in code Composer is the address for the load configured?
  • Does the default setting in a project place the code in the first bank or do I need to modify something expecting a bootloader?
  • How can I configure code composer to generate the appropriate hex file for non CodeComposer code loading?
  • Can you confirm I would need to use a YMODEM protocol tool like HyperTerminal?

Much thanks

  • Hello John,

    1. The CCS will allocate flash space based on the address defined in cmd file, and load the code to that address

    MEMORY{

        VCTOR (x) :       origin=0x00004000 length=0x00000020

        FLASH0  (RX) : origin=0x00004020 length=0x00100000

    ..

    }

    SECTIONS{

       .intvecs : {} > VECTORS

       .text   align(32) : {} > FLASH0

    ....

    }

    The code will be loaded to the flash starting at 0x4000

    2. No

    3. CCS Project ->property->ARM Hex Utility, then enable the utility, select the format

    4. The Bootloader sample code use YModem protocol. You can develop your bootloader with different protocol.

  • Thanks

    I have set the boot loader to

    VECTORS (X) : origin=0x00000000 length=0x00000020

    FLASH0 (RX) : origin=0x00000020 length=0x001FFFE0

    FLASH1 (RX) : origin=0x00200000 length=0x00200000

    STACKS (RW) : origin=0x08000000 length=0x00001500

    RAM (RW) : origin=0x08001500 length=0x0007EB00

    and the application to:

    VECTORS (X) : origin=0x00000000 length=0x00000020

    FLASH0 (RX) : origin=0x00008100 length=0x001F7EFF

    FLASH1 (RX) : origin=0x00200000 length=0x00200000

    STACKS (RW) : origin=0x08000000 length=0x00001500

    RAM (RW) : origin=0x08001500 length=0x0007EB00

    I have hand loaded the jump address to the application to the address of "_c_int00"

    It looks like it should make the jump (I have checked the load of the jump address), but as  code compose doesn't  have visibility between the two applications, I cant actually step into the second initialization.

    How can I see it make the jump (Code composer will not step into the unseen application space and the application is not initializing)?

    It looks like its going to "undefEntry" in the vector table

    In usung the following to make the jump:

    JumpAddress = (uint32_t)APP_START_ADDRESS;

    ((void (*)(void))JumpAddress)();

  • Hello,

    "underEntry" means there is no valid code at the APP_START_ADDRESS. Please program your application to flash sectors starting at APP_START_ADDRESS. You can use either bootloader or Uniflash to program the application for testing.
  • I thought that initially too, however I checked the progress in the jump address by placing some UART prints in the booted application so I could track the transition and see where things went wrong. The code was successfully jumped to after all...

    I followed the progress as the "new" application booted up. It went through the "_c_int00" MCU functions fine, then began to go into the application. After several calls it failed (i.e. function A, called Function B, that tried to call function C. After some debugging (i ended up making function C a simple NOP return) I came to the conclusion that it had something to do with the stack. The second application works fine when it starts by itself, just not if its 'jumped' to from the boot loader.

    I see the MCU start up process resets the stack which should have resolved the issue, but no luck.

    I now have the bootloader and application in the same project to get better visibility, but the issue does not occur in this configuration..

    Any thoughts?

    J

  • Hi John,

    From Registers window, please check the error status and address. Those may help you figure out which instruction causes the problem.

  • great resource