AnsweredAssumed Answered

STMF429IGT Usb Bootloader AN3990 [SOLVED]

Question asked by __Dan__ on Aug 8, 2015
Latest reply on Aug 21, 2015 by Jimmy
Hello, I'm trying to run this bootloader on a custom board with a 429IG on it. My target application runs fine, but I need to be able to update on site through usb.
So far, the bootloader writes the image on the chip, but it seems it doesn't jump to the application address.
Here are my settings:
Bootloader side:

#define APPLICATION_ADDRESS        (uint32_t)0x08010000
#define VECT_TAB_OFFSET  0x00

Bootloader linker:

MEMORY
{
  FLASH (rx)      : ORIGIN = 0x08000000, LENGTH = 0x10000
  RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 192K
  MEMORY_B1 (rx)  : ORIGIN = 0x60000000, LENGTH = 0K
  CCMRAM (rw)     : ORIGIN = 0x10000000, LENGTH = 64K
}


Application side:

#define FLASH_BASE            ((uint32_t)0x08000000)
#define VECT_TAB_OFFSET  0x00010000
....
SCB->VTOR = FLASH_BASE | VECT_TAB_OFFSET;

Application linker:

MEMORY
{
  FLASH (rx)      : ORIGIN = 0x08010000, LENGTH = 1024K - 0x10000
  RAM (xrw)       : ORIGIN = 0x20000000, LENGTH = 192K
  MEMORY_B1 (rx)  : ORIGIN = 0x60000000, LENGTH = 0K
  CCMRAM (rw)     : ORIGIN = 0x10000000, LENGTH = 64K
}

The bootloader is around 40k so it fits with the first 4 sectors.

The jump code in the BL is the following:

if (((*(__IO uint32_t*)APPLICATION_ADDRESS) & 0x2FFE0000 ) == 0x20000000)
      {
        /* Jump to user application */
        JumpAddress = (APPLICATION_ADDRESS + 4);
        Jump_To_Application = (pFunction) JumpAddress;
        /* Initialize user application's Stack Pointer */
        __set_MSP(*(__IO uint32_t*) APPLICATION_ADDRESS);
        Jump_To_Application();
      }

I have tried to remove the condition and force the jump but nothing happens. I've read countless posts on the forum about that, (thanks Clive1 among others) but I still can't figure it out.
Here's the interesting part of the memory view from the ST-LINK Utility after flashing the BL, and writing the target app from the usb key (the chip was fully erased prior to the procedure).


mem1.jpg


If anyone has an idea, I'm all ears :)
Thanks,
Dan.

Edit1: picture didn't upload.
Edit2: marked as solved

Outcomes