cancel
Showing results for 
Search instead for 
Did you mean: 

Can't run code without USB connection

PSzcz.2
Associate II

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 :)

1 ACCEPTED SOLUTION

Accepted Solutions
TDK
Guru

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".

View solution in original post

3 REPLIES 3
PSzcz.2
Associate II

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

TDK
Guru

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".

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