2025-03-18 10:43 AM - edited 2025-03-18 11:38 AM
Hi,
I'm new to stm32 boards and I'm using it on platformIO with Arduino framework.
I have problems with the led LD4 (st-link led).
- When I use the USB cable (JP3 jumper on U5V -> powering the board using usb) the power led LD6 is green but the LD4 is red. When I upload the code the LD4 blinks red and then stable red again once flash is completed and nothing happens (in the code I turn on/off led LD1 and print something).
- When I use external power (7.6V battery on VIN, JP3 jumper on VIN) the power led LD6 is green, the LD4 is green as well. Once I upload the code the LD4 blinks red and then stable red again once flash is completed and nothing happens.
- Also, I tried doing the same thing with framework STM32cube but no luck (same behaviour).
Could you help me, what am I doing wrong?
- This is my .ini file:
#include <Arduino.h>
#define LED_PIN PB0 // Default user LED (LD1)
void setup() {
Serial.begin(115200);
pinMode(LED_PIN, OUTPUT);
Serial.println("Setup Complete");
}
void loop() {
digitalWrite(LED_PIN, HIGH); // Turn LED on
delay(500);
digitalWrite(LED_PIN, LOW); // Turn LED off
delay(500);
}
- This is the output after flashing:
Archiving .pio/build/nucleo_f767zi/libFrameworkArduino.a
Indexing .pio/build/nucleo_f767zi/libFrameworkArduino.a
Linking .pio/build/nucleo_f767zi/firmware.elf
Checking size .pio/build/nucleo_f767zi/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 0.3% (used 1332 bytes from 524288 bytes)
Flash: [ ] 1.1% (used 23012 bytes from 2097152 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, stlink
CURRENT: upload_protocol = stlink
Uploading .pio/build/nucleo_f767zi/firmware.elf
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-17:03)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
[stm32f7x.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08004534 msp: 0x20080000
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
2025-03-18 10:57 AM
@Danilo_ wrote:with Arduino framework.
For Arduino questions, you should go here:
Or the Arduino forums
2025-03-18 11:26 AM
Hi Andrew,
The problem arises even when I use stm32cube as framework.
I don't think it's a frawework related issue.
I'll post my question on the link recommend by you.
Thanks!
2025-03-18 1:08 PM - edited 2025-03-18 1:11 PM
Hello @Danilo_ and welcome to the community;
Since you are using an external power supply, I suggest you to refer to the UM1974 / Section 6.4 Power supply and power selection.