This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Modify bootloader address

Hi Sir,

As check below link, we know how to re-write the bootloader address.

https://devzone.nordicsemi.com/f/nordic-q-a/26300/how-to-use-nrfjprog-to-write-uicr-bootloaderaddr 

1. But could we re-write the bootloader address in Application layer?

2. If we program two application image in the flash (example,like one in 0x26000, another in 0x46000)

   Could we jump to difference application address from bootloader?

Thank you.

BRs, Han

Parents Reply
  • Hi Edvin,

    1. From item 1, If we don't change the "start_addr" and keep the original code, it works ( start addr is 0x26000). (bootloader's main())

    2. From item 3, if we common the code as below, it works because it will go through the original part that start w/ 0x26000.

    ======

        //jump_addr = * ( __IO uint32_t * ) ( 0x46000UL + 4UL );

        //jump2app = ( pFunction ) jump_addr;

        /* Initialize user application's Stack Pointer */

        //__set_MSP ( * ( __IO uint32_t * ) ( 0x46000UL ) );

        //jump2app();

    ======

    Thank you,

    BRs, Han

Children
  • I am not able to follow the logic from your main() function.

    If you try:

    typedef  void ( *pFunction ) ( void );
    
    int main(void)
    
    {
    
        uint8_t op_mode = 0U;
    
        pFunction jump2app;
    
        uint32_t jump_addr;
    
           
    
        jump_addr = * ( __IO uint32_t * ) ( 0x26000UL);
    
        jump2app = ( pFunction ) jump_addr;
    
        /* Initialize user application's Stack Pointer */
    
        __set_MSP ( * ( __IO uint32_t * ) ( 0x26000UL ) );
    
        jump2app();
    
    ....
    
    }

    What happens then? 

    Is it possible to send your project, so that I can try to understand how your implementation is working? Right now, I know only that it isn't working. Not what the part that isn't working looks like.

    BR,

    Edvin

Related