Skip to main content
PSzcz.2
Associate
September 2, 2021
Solved

Can't run code without USB connection

Hello, sorry for asking this but I'm new to operating STM32 microcontrollers and the IDE it came with. I wrote a simple code to read the pin state and write to an LED once detected. All runs well on debugging. The problem for me is that when I unplug the USB connection (the board is powered through a power supply) the code suddenly stops and no LEDs light up after the button is pressed.

Is there a step I'm missing like compiling to memory? I've spent some time looking for an answer but sadly I got no luck in solving this.

If possible, could someone lead me towards finding a solution for this? Thank you :)

This topic has been closed for replies.
TDK
TDKBest answer
September 2, 2021

Make sure you're compiling to FLASH and not RAM. This is usually the default.

Possibly the ST-Link is holding it in reset. Try removing J8.

"If you feel a post has answered your question, please click ""Accept as Solution""."

3 replies

PSzcz.2
PSzcz.2Author
Associate
September 2, 2021

I forgot to mention I am using a STEVAL-SPIN3204 board for my program. If that's any help.

TDK
TDKBest answer
September 2, 2021

Make sure you're compiling to FLASH and not RAM. This is usually the default.

Possibly the ST-Link is holding it in reset. Try removing J8.

"If you feel a post has answered your question, please click ""Accept as Solution""."
PSzcz.2
PSzcz.2Author
Associate
September 10, 2021

Thank you for the information, with the connector now disconnected the program runs without the USB connection now too. Thank you.