usb host bootloader

Hi all
I have problem with usb host boot loader , if the button is pressed the bootloader reads the binary code from the usb stick and writes this own at application memory from 0x8008000
after debugging it seems this is ok .

if the button is not pressed , the bootloader should jump at the application , but it does not do , it stucks in the default handler .

in the application code I set the target ROM1 start 0x800800
and I defined VECT_TAB_OFFSET to 0x800

but no way it doesnt not work . my bootloader code depends on the code of the discovery kit of
stm32f407 from ST, my MCU is stm32f407.
Could you guide me to solve it problem please ?

Regards
S. Sami

Parents
  • #define NVIC_VectTab_FLASH       0x90000    // FW is linked to Flash Base 0x90000
    #define SP_OFFS                     0
    #define RESET_OFFS                  4
    
    int main()
    {
      void (*user_code_entry)(void);
      register uint32_t MSP __ASM("msp");
    
      // Bootloader code, i.e. look for new FW on SD Card and flash it
      ....
    
      SCB->VTOR       = NVIC_VectTab_FLASH;
      user_code_entry = (void (*)(void))(( *((unsigned int *)(NVIC_VectTab_FLASH + RESET_OFFS))) );
      MSP             = *((unsigned int *)(NVIC_VectTab_FLASH + SP_OFFS));
    
      user_code_entry();  // starts Reset Vector from FW
    
      while(1); // should never reach this...
    }
    

Reply
  • #define NVIC_VectTab_FLASH       0x90000    // FW is linked to Flash Base 0x90000
    #define SP_OFFS                     0
    #define RESET_OFFS                  4
    
    int main()
    {
      void (*user_code_entry)(void);
      register uint32_t MSP __ASM("msp");
    
      // Bootloader code, i.e. look for new FW on SD Card and flash it
      ....
    
      SCB->VTOR       = NVIC_VectTab_FLASH;
      user_code_entry = (void (*)(void))(( *((unsigned int *)(NVIC_VectTab_FLASH + RESET_OFFS))) );
      MSP             = *((unsigned int *)(NVIC_VectTab_FLASH + SP_OFFS));
    
      user_code_entry();  // starts Reset Vector from FW
    
      while(1); // should never reach this...
    }
    

Children
More questions in this forum