Skip to main content
MMerc.1
Associate III
Mar 18, 2022 9:05 AM UTC
Question

STM32L433 IAP

Hi,

I have 2 partitions on the STM32L433cct6 :

  1. IAP (to upgrade via USB) : 0x08000000 - 0x0800C000
  2. Application : 0x0800C000 - 0x08040000

I have a function to jump to the application :

/* Jump to user application */
JumpAddress = *(__IO uint32_t*) (USBD_DFU_APP_DEFAULT_ADD + 4);
Jump_To_Application = (pFunction) JumpAddress;
/* Initialize user application's Stack Pointer */
__set_MSP(*(__IO uint32_t*) USBD_DFU_APP_DEFAULT_ADD);
Jump_To_Application();

But it doesn't work.

Do you have any ideas ?

Best regards

This topic has been closed for replies.

4 replies

Tesla DeLorean
Guru
Mar 18, 2022 11:18 AM UTC

Use a debugger, follow​ the transfer of control.

Make sure SCB->VTOR​ gets set to the new address on the otherside.

Be aware of what interrupts are active, and what memory structures are used and there state.

Perhaps avoid reinitializing PLLs and clocks already in functional state.​

Tips, Buy me a coffee, or three.. PayPal Venmo (See Profile) Up vote any posts that you find helpful, it shows what's working..
MMerc.1
MMerc.1Author
Associate III
Mar 18, 2022 12:34 PM UTC

Hi,

Thank you for your reply.

I forgot to relocate the vector table... So I uncommented the following line :

#define USER_VECT_TAB_ADDRESS

I have another problem : when I place "Start_Application" function before "HAL_Init", it works fine. But, when I put the "Start_Application" function after "HAL_Init", it doesn't work.

Do you know why ?

Best regards

MMerc.1
MMerc.1Author
Associate III
Mar 21, 2022 8:26 AM UTC

Hi,

Any ideas ?

Mohamed Aymen HZAMI
ST Employee
Mar 23, 2022 11:32 AM UTC

Hello @MMerc.1​,

Make sure to define the right offset of the vector table.

M Aymen