cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo F103RB run on startup

PJW62
Associate II

Hi,

I'm going to say that this is a really nooby question, however I cannot find the answer anywhere.
Background, I'm using a nucleo F103RB, and I've programmed it using CubeIDE. I can connect the board, debug and  run the program fine. The board is powered via Vin at the correct voltages, with JP1 disconnected and JP5 set to E5V.

I need to be able to run this program immediately after the board powers on, without a USB connection. How do I upload a release build of my program to it, because whenever I try using cubeprogrammer, it doesn't run the program after it has restarted. When I've tried dragging and dropping the .elf file in, it's given me a write error.

Thanks in advance for your help,

P

18 REPLIES 18
PJW62
Associate II

Everything is powered correctly, the board lights up but has the ST-Link waiting for connection. The clock is set up to come from the ST-Link. My code runs straight from a while loop in main after the peripheral initialisation.

I program the board via usb, set the jumpers to run via external power, then power it via my circuitry without usb connection, the board powers on, but does nothing except wait for connection. I plug USB back in and run the release code from cube IDE. The board powers and runs as expected.

If I check the storage in cube programmer it has the correct program in it.

Thanks

P

Does the ST-Link get powered-up in that state?


Yeah the ST-Link comes on and flashes Red while waiting for connection

Have you checked for a clock signal at the Target MCU?

PJW62
Associate II

yeah it's getting a signal, I don't know if it's correct or not though

Is it the same in both the working & non-working cases?

Yeah

PJW62
Associate II

I've just tried running it by dragging the .bin into the drive. This also didn't work. The only time it works is when it's been uploaded via STM32CubeIDE by pressing run. Any other time it is powered on, it doesn't run the code. Is there some sort of code CubeIDE sends to tell it to run, or something I need to put into my code to tell it to run on power on?

Thanks

PJW62
Associate II

I've done some more testing, I need to trigger a reset after power on, best way of doing this is with a POR chip