2018-02-18 11:50 PM
Hello,
I want to use the STM32 IAP UART Bootlarder in the CubeMX. The example is working fine. However I have a problem with my own code. When I use HAL_Delay() function, the code is crashing. If I do not use the HAL_Delay() function, everything is so good.
What could be the problem ? Can anybody help ?
Best Regards
#stm32-f4 #bootloader #stm32-uart-bootloader2018-02-19 12:51 AM
Can anybody help ?
Not from the vague description you've given.
What debugging have you done?
When you say, 'crash' - what does that actually mean?
Some debugging tips for you:
http://www.8052.com/faqs/120313
http://www.ganssle.com/articles/developingagoodbedsidemanner.htm
2018-02-19 05:21 AM
Hello Andrew
It waits in the while in the below code, because HAL_GetTick() always returns 0. There is no increment on the uwTick.
__weak void HAL_Delay(__IO uint32_t Delay)
{ uint32_t tickstart = HAL_GetTick(); uint32_t wait = Delay; /* Add a period to guarantee minimum wait */ if (wait < HAL_MAX_DELAY) { wait++; } while((HAL_GetTick() - tickstart) < wait) { }}2018-02-19 05:23 AM
Hello,
Please make sure that you are calling the HAL_Init() function at the beginning of your main() function.
This should start the SysTick.
2018-02-19 05:25 AM
I Just change the memory address at the file 'STM32F407VETx_FLASH.ld' like below.
Original:
FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K
Modified
FLASH (rx) : ORIGIN = 0x8004000, LENGTH = 512K
2018-02-19 05:30 AM
When I debug the code. it never comes to the function SysTick_Handler()
what is the trigger event of the SysTick_Handler() ?
2018-02-19 05:32 AM
engin kavak wrote:
HAL_GetTick() always returns 0.
So what have you done to find out why that happens?
2018-02-19 05:39 AM
So have you enabled the SysTick?
Time for some basic reading:
https://secure-ecsd.elsevier.com/covers/80/Tango2/large/97801240808jpg
2018-02-19 05:41 AM
Linking to the book's URL puts the post in moderation.
So the details are:
The Definitive Guide to ARM® Cortex®-M3 and Cortex®-M4 ProcessorsAuthor:
Joseph Yiu
eBook ISBN:
9780124079182Paperback ISBN:
9780124080829Hardcover ISBN:
Imprint:
NewnesPublished Date:
18th October 2013Page Count:
8642018-02-19 06:20 AM
I debug the code via ST-Link