Skip to main content
Associate III
December 6, 2025
Question

Application runs after flashing from STlink, but not after power cycle

  • December 6, 2025
  • 3 replies
  • 922 views

Hello All,

 

I am using touchgfx for one of my application using on STM32757I-Eval kit.

I am facing issue with running the application after successfully flashing the application, first time if I load from STM cube programmer, I can see the Program is running on display, but as I remove the Power from usb stlink and reconnect it back the Application is not loading and running.

Could you please help me to understand why it happens and how can I rerun the application so that I don't have to program it again and again.

Please let me know how to resolve it ?

 

Regards,

Shiv

3 replies

MM..1
Chief III
December 6, 2025

Your code can have three or more issues: 

!. Not run at all based on BOOT setup OB.

2. Run to Error handler while good practice place led blink here

3. Run to hard fault same as 2.

On flashing process is app run other way.

Shiv09Author
Associate III
December 6, 2025

Hello @MM..1 ,

 

Thanks for quick reply, Yes there could be some trouble. Just for some more information. here are the OB settng from my cubeprogrammer and the Main.c function, this might give some more clue.

 

After power cycle, at least the debug log "MX_USART1_UART_Init" at line 207, should be received. I am not able to receive it as well. 

Shiv09_1-1765006340569.png

Shiv09_0-1765006314340.png

Andrew Neil
Super User
December 6, 2025

@Shiv09 wrote:

 but as I remove the Power from usb stlink and reconnect it back the Application is not loading and running.


Not sure what you mean by that ?

Is your board powered via the ST-Link ?

So what you're saying is that your system doesn't restart after a power cycle ?

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Shiv09Author
Associate III
December 6, 2025

Hello @Andrew Neil ,

 

Yes the board is powered by stlink, If I remove the USB connected to my PC, and reconnect it the program doesnt load or run.

Yes after power cycle the application doesn't run.

Andrew Neil
Super User
December 6, 2025

OK - I've edited the title to clarify that.

 

Does pressing the Reset button get it started?

 

Note that you can connect to a running (or "stuck"/"crashed") system without having to reset & do a download:

https://community.st.com/t5/stm32-mcus-embedded-software/processor-stuck-if-i-run-code-without-debugger/m-p/802267/highlight/true#M63401

So you can examine what's actually happening in this case ...

A complex system that works is invariably found to have evolved from a simple system that worked.A complex system designed from scratch never works and cannot be patched up to make it work.
Shiv09Author
Associate III
December 8, 2025

Hello @unknown ,

 

Thanks for the reply !

Yes agreed, such issue could happen because of the points you mention. Below are the responses might be this could give more clarity of issue. if you need any additional information then please let me know.

 

1. Verify the BOOT0/BOOT1 pins – make sure they are configured to boot from flash memory.

-> Yes the SW1 position is at FLASH, Pointing at 0.  BOOT0 Jumper is OPEN(no jumper connected, JP3).


2. Check the linker script – confirm that the application is being written to the correct flash start address.

-> Attached 2 files, this might provide clue, 1 is for the Flash.ld and other is for RAM.ld


3. Make sure Option Bytes are correct – especially the Read-Out protection and Write protection settings.

--> Attached below 2 images for the settings.


4. Try erasing the full chip and flashing again to ensure no previous code is interfering.

-> Yes tried to erase flash every time I am flashing a new code (by clicking Erase flash  menory -> Full chip erase,  even Erase external memory).

 

Shiv09_0-1765178473977.png

Shiv09_1-1765178529936.png