2016-12-20 06:00 AM
Posted on December 20, 2016 at 15:00
I am porting older code to the HAL library using cubemx for an STM32F4_Discovery board.
My application consists of a 'bootloader' that resides in the lower segment of flash.
The actual application resides in higher segments.
The bootloader can optionally flash those segments with new code and will then jump to that code.
This code is regular code created via cubemx with a little different loader script to make the code reside higher in memory.
So when the bootloader jumps to that code ALL initialization is done for the SECOND time, but now for the application in high memory. This used to work fine, but with the HAL library at least the Systick interrupt is NOT coming.
So function HAL_Delay() is not working for example.
I would have hoped that the HAL init code would work irrespective of the state of the processor, but alas...
What I have tried is to execute some DeInit-functions before the jump, e.g.
USBD_LL_DeInit(&hUsbDeviceFS);
HAL_DeInit();
jumptoapp();
But that doesn't work.
The question is how can I start the app from the bootloader so that the initialization done in the app works and my code runs.
Thanks in advance,
Sietse
Solved! Go to Solution.
2016-12-23 02:11 AM
To answer my own question.
I had to change the vector table location in the system control block by changing the value of VECT_TABLE_OFFSET in system_stm32f4xx.c
Its working fine now.
2016-12-20 06:42 AM
Posted on December 20, 2016 at 15:42
Hi
Achterop.Sietse
I have moved your post to
https://community.st.com/s/topic/0TO0X000000BSqSWAW/
where product related questions are asked.
Thanks
Oli
2016-12-23 02:11 AM
To answer my own question.
I had to change the vector table location in the system control block by changing the value of VECT_TABLE_OFFSET in system_stm32f4xx.c
Its working fine now.
2016-12-23 03:15 AM
Hi
Achterop.Sietse
,Thank you for posting your findings and how you fixed the issue, it is good to hear that it was solved.
-Nesrine-
2018-03-02 08:16 AM
I had the same issue, your suggestion was the solution.
Thank you very much