cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 IAP UART Bootlader

voyvoda .
Senior
Posted on February 19, 2018 at 08:50

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-bootloader
14 REPLIES 14
Andrew Neil
Evangelist III
Posted on February 19, 2018 at 09:51

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

 
Posted on February 19, 2018 at 13:21

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)

{

}

}
Mike_ST
ST Employee
Posted on February 19, 2018 at 14:23

Hello,

Please make sure that you are calling the HAL_Init() function at the beginning of your main() function.

This should start the SysTick.

Posted on February 19, 2018 at 13:25

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

Posted on February 19, 2018 at 13:30

When I debug the code. it never comes to the function SysTick_Handler()

what is the trigger event of the SysTick_Handler() ?

Posted on February 19, 2018 at 13:32

engin kavak wrote:

HAL_GetTick() always returns 0.

So what have you done to find out why that happens?

Posted on February 19, 2018 at 13:39

So have you enabled the SysTick?

Time for some basic reading:

https://secure-ecsd.elsevier.com/covers/80/Tango2/large/97801240808jpg

Posted on February 19, 2018 at 13:41

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 Processors

Author:

 

Joseph Yiu

eBook ISBN:

9780124079182

Paperback ISBN:

9780124080829

Hardcover ISBN:

Imprint:

Newnes

Published Date:

18th October 2013

Page Count:

864
Posted on February 19, 2018 at 14:20

I debug the code via ST-Link