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.

Is it Bootloader Flash start Address should be in 0x00000000 ?

 Hi QJ Wang

Is it possible to flash the Bootloader SW in any other location instead of 0x00000000. 

If it is possible how to set the flash start address for bootloader using HL_sys_link.cmd ?

Software (BOOT or APPL) Sub- Division Memory Sub- Division Memory Range Memory length (HEX)
BOOT  VECTORS 0x00000000 - 0x00000020 0x00000020
FLASH0 0x00000020 - 0x000FFFFF 0x000FFFDF
APPL  APP_STATUS_ADDRESS 0x00100000 - 0x00100020 0x00000020
VECTORS 0x00100020 - 0x00100040 0x00000020
FLASH1 0x00100040 - 0x003FFFFF 0x002FFFBF 

Thanks in advance.

Santhosh.

  • Presumably, the bootloader is going to have to provide at least a reset vector and probably some others so the bootloader is going to have to live in an address range that covers the initial location of the vector table. I seem to remember seeing some processor where the level of a pin at powerup controlled the vector table address but, unless your processor has that, I think at least the vector table part of the bootloader is going to have to be a 0x0.

  • The reset exception vector table is located at the beginning of the flash (0x00000000). Hercules MCU devices don't have VTOR register to relocate the vector table.

    1. I prefer to place the bootloader to the beginning of the flash

    2. It is also ok to place the bootloader at other locations, for example the last sector of the flash. The application is programmed to the beginning of the flash. After reset or power-up, the application is executed first and jump to the bootloader whenever the application needs to be updated.

  • Hi Jim,

    1, In that Application vectors 0x00100020 to 0x00100040 address is not require?

    Software (BOOT or APPL) Sub- Division Memory Sub- Division Memory Range Memory length (HEX)
    BOOT  VECTORS 0x00000000 - 0x00000020 0x00000020
    FLASH0 0x00000020 - 0x000FFFFF 0x000FFFDF
    APPL  APP_STATUS_ADDRESS 0x00100000 - 0x00100020 0x00000020
    VECTORS 0x00100020 - 0x00100040 0x00000020
    FLASH1 0x00100040 - 0x003FFFFF 0x002FFFBF 

    2, How to check this TMS570 MCU has this feature of powerup controlled the vector table address ?

    3, Can you check the HL_sys_intvecs.asm of Bootloader and Application 

    Bootloader

    this jump address to 0x100020 -0x08 it is the location in APP_STATUS_ADDRESS which is 0x00000000 value is present, but what is the purpose of this jump address ?

    Application:

    3, Is it possible to update the bootloader in 0x00000000 location without a debugger ?

    The Startup section only used to jump to application or bootloader address

    if the application is available it jumps to application else bootloader. Since it enters always application if i need to update the bootloader it is possible through the application address i will do some super bootloader to update the main bootloader 

    Please check and confirm as soon as possible.

    Thanks in advance.

    Santhosh.

  • Hi QJ Wang

    FYI 

    Please check my above query regarding the bootloader 

    Thanks in advance 

    Santhosh

  • 1, In that Application vectors 0x00100020 to 0x00100040 address is not require?

    It is required. If any exception happens in your application, code will jump to exception vector table at 0x100020, then jump to the exception handler (undef, dabt, pabt, svc, irq, and fiq).

    A bootloader is a simple and small application, designed to update the firmware (to fix bugs, or just to update with new features) without actually attaching a JTAG adapter to the PCB. It is important to implement it bug free (no undef, data abort, prefetch abort, and no svc).

    2, How to check this TMS570 MCU has this feature of powerup controlled the vector table address ?

    You can generate a data abort or undef abort on purpose in your application to check if the code is jump to the exception handler defined in your application.

    (for example, data abort in APP --> bootloader INT vect table PC= 0x10 + 0x08 +  0x100020-0x08 --> data abort in APP exception vector table --> your data abort handler

    3, Can you check the HL_sys_intvecs.asm of Bootloader and Application 

    You need to add the exception handlers to your APP HL_sys_intvecs.asm

    this jump address to 0x100020 -0x08 it is the location in APP_STATUS_ADDRESS which is 0x00000000 value is present, but what is the purpose of this jump address ?

    For ARM Cortex-R4/5 microcontroller, the Program Counter (PC) always pointers two instructions (8 bytes) beyond the current executed instruction.

    For example , after the UNDEF interrupt is received by the CPU, the CPU branches to 0x4.

    b #100020-0x08 

    The branch offset must take account of the prefetch operation, which causes the PC to be 2 words (8 bytes) ahead of the current instruction.

    The destination is PC + offset = 0x04 + 0x08 + 0x100020 - 0x08 = 0x100024  --> which is the address of UNDEF instruction in Application's Interrupt Vector table.

  • 3, Is it possible to update the bootloader in 0x00000000 location without a debugger ?

    The bootloader example doesn't support self-update.

  • Yes, I understood that bootloader example doesn't support self-update.

    Is it possible to share common memory in flash with bootloader and application.

    Startup code which should only has the jump or goto address to application or bootloader ?

    if the Application encryption value is 0x5A5A5A5A the enter to Application location else Bootloader location 

    Is it possible to do it in Assembly language only the startup code to jump application location else bootloader location.

    ,

    Please check and confirm as soon as possible.

    Thanks in advance.

    Santhosh.

  • Is it possible to share common memory in flash with bootloader and application.

    Yes, they can share the common memory in flash., or they can share the same EEPROM.

    if the Application encryption value is 0x5A5A5A5A the enter to Application location else Bootloader location

    Yes, you can do it. The application or bootloader can program a shared variable for example magic word (0x5a5a5a5a) to flash or EEPROM, and the startup code reads this variable and jumps to bootloader or application.

    Is it possible to do it in Assembly language only the startup code to jump application location else bootloader location.

    Sure.

    1. C code: for example jumping to 0x80000 in flash

    ((void (*)(void))0x80000)();

    2. Assembly code

    asm(" mov r0,  #0x80000");

    asm(" b r0");

    or 

    asm(" mov PC, #0x80000");