2022-11-13 07:07 AM
I configured lwip in cube for stm32f107, when I generate code for keil and run it the micro hangs, but if I write a program without cube, it runs without any problem.
What is the problem?
Note: If I get the output for CubeIDE, it runs without any problem.
2022-11-13 07:46 AM
>>What is the problem?
Hard to say, perhaps debug it?
Could be stuck in some while() loop, perhaps the Hard Fault Handler or Error Handler.
Try stopping in the debugger, determine where it is within the code.
Uncheck "run to main()" if it doesn't get to main before stalling.
Check SystemInit() code, this should be called prior to main()
2022-11-13 08:19 AM
It is hard to describe.
The program is stopped here and does not go to main.
; Reset handler
Reset_Handler PROC
EXPORT Reset_Handler [WEAK]
IMPORT SystemInit
IMPORT __main
LDR R0, =SystemInit
BLX R0
LDR R0, =__main
BX R0
ENDP
The program only works if I press the F5 button 4 times
2022-11-15 12:18 AM
2022-11-22 01:52 AM
In my opinion, st does not make suitable setup files for keil.
They don't even take the time to test to see what the problem is.
It is not known what this company and its employees are doing.
I sent a message to ST on August 6 but they did not reply.
Do they have a ticket system to solve problems?
2022-11-22 05:39 AM
@HKabi.1 Keil is a larger software house than ST, they made these startup files. They also provide the C compiler and assembler, and the debugger. Their support is good (€).
Check the cables and target power supply. Try to disconnect and reconnect USB cable of the ST-LINK.
2022-11-22 07:03 AM
This problem has nothing to do with keil or stlink.
It happens when the project is built with stmcube for keil.
2022-11-22 04:34 PM
When you said " I write a program without cube" do you mean that you wrote also the startup, or you've started from a template provided in a Keil pack for STM32?
If the latter, it is easy to compare the files.
I remember having similar issue with program stuck at the reset address but cannot recall was it caused by bad connections or by outdated firmware of ST-LINK. It wasn't in the code.
2022-11-22 05:31 PM
Check the stack size and a possible printf()/malloc() usage.
And, of course, this:
2022-11-23 12:32 AM
I use startup from a template provided in a Keil pack for STM32.
Even if you turn on the device when stlink is not connected, the device will not work.