Hi,
MCU version 20KB RAM, 128 KB FLASH category 5. I tried solutions on the web available for different STM32 MCU with no success. BOOT0 pin is fixed to GND in my custom PCB.
My final code flow is like below:
1)Reset Handler
2)System init MSI as a system clock, reset all other clock settings and does something like below
SCB -> VTOR = FLASH_BASE | VECT_TAB_OFFSET; /* Vector table relocation in Internal Flash*/
3) Main Function
int main(){ HAL_RCC_DeInit(); Systick -> CTRL = 0; Systick -> LOAD =0; Systick -> VAL =0; __disable_irq(); HAL_FLASH_Unlock(); void (*foo)(void) = 0x00000004; __HAL_SYSCFG_REMAPMEMORY_SYSTEMFLASH(); SCB -> VTOR = 0; __set_MSP(0x20005000); foo(); while(1); }
When i debug, code jumps to the location 0x00000004 but after some instructions device jumps again to reset handler.
Can you correct me to make embedded USBDFU bootloader work ?
Thanks in advance,