0

I use armclang build my program,and the progarm will let LED on in board.But when I downlaod program to stm32f407 by st-link, the LED is not on.So I run the program in debug mode by st-link, zhe LED will ON,it mean that the program is running.

I found that the program can run in O3 optimization, and can't run in O2 optimization.

why?

I use armcc build the program,everything is ok.So is the problem with armclang or am I overlooking some configuration.

Please enlighten me, thank you

  • 3
    You have an undefined behaviour bug. – Martin James Dec 15 '19 at 07:44
  • 2
    Without any code and build scripts we can't figure out the problem – Saad Dec 15 '19 at 08:50
  • 5
    Occam's razor suggests that you should first blame your own newly minted code used by only you before blaming the tools used by thousands of professional developers in real-world applications every day for years! So to help, we need to see the code, because it is not armclang - rather you have probably developed code with undefined behavior - such behavior may change between compilers and with different compiler options. If you have a debugger, debug it - see exactly what is happening. Normally you'd debug with `-g -O0` (at which your code may well work as it happens). – Clifford Dec 15 '19 at 09:56

1 Answers1

0

To run the program in the board without debug mode, you should reset the board with the black button.

Camilo
  • 27
  • 7