What is wrong? Help please

I just start with PlatformIO and a NUcleo F446RE, but if I upload my program I get this, and what is wrong:

    • Executing task in folder Nucleo_f446re_CableRobot: C:\Users\asw.platformio\penv\Scripts\platformio.exe run --target upload

Processing nucleo_f446re (platform: ststm32; board: nucleo_f446re; framework: arduino)
-------------------------------------------------------------------------------------------Verbose mode can be enabled via -v, --verbose option
CONFIGURATION: Redirecting...
PLATFORM: ST STM32 (15.1.0) > ST Nucleo F446RE
HARDWARE: STM32F446RET6 180MHz, 128KB RAM, 512KB Flash
DEBUG: Current (stlink) On-board (stlink) External (blackmagic, cmsis-dap, jlink)
PACKAGES:

  • framework-arduinoststm32 @ 4.20100.211028 (2.1.0)
  • framework-cmsis @ 2.50700.210515 (5.7.0)
  • tool-dfuutil @ 1.9.200310
  • tool-openocd @ 2.1100.211028 (11.0)
  • tool-stm32duino @ 1.0.2
  • toolchain-gccarmnoneeabi @ 1.90201.191206 (9.2.1)
    LDF: Library Dependency Finder → Library Dependency Finder (LDF) — PlatformIO latest documentation
    LDF Modes: Finder ~ chain, Compatibility ~ soft
    Found 29 compatible libraries
    Scanning dependencies…
    No dependencies
    Building in release mode
    Checking size .pio\build\nucleo_f446re\firmware.elf
    Advanced Memory Usage is available via “PlatformIO Home > Project Inspect”
    RAM: [ ] 1.4% (used 1856 bytes from 131072 bytes)
    Flash: [= ] 7.5% (used 39288 bytes from 524288 bytes)
    Configuring upload protocol…
    AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, stlink
    CURRENT: upload_protocol = stlink
    Uploading .pio\build\nucleo_f446re\firmware.elf
    xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:19)
    Licensed under GNU GPL v2
    For bug reports, read

debug_level: 1

srst_only separate srst_nogate srst_open_drain connect_deassert_srst

target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08006e40 msp: 0x20020000
** Programming Started **
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
=============================== [SUCCESS] Took 7.26 seconds =============================== * Terminal will be reused by tasks, press any key to close it.
*

…but there is no error message visible at all? It flashed and reset successfully.

Yes okay, but it not running? so how do I set it in run?

The code you programmed should be running. What’s your code?

if I go to the debug console I see this:

undefinedC:\Users\USER2.platformio\packages\toolchain-gccarmnoneeabi\bin\arm-none-eabi-gdb.exe: warning: Couldn’t determine a path for the index cache directory.
Reading symbols from c:\Users\USER2\Documents\PlatformIO\Projects\Nucleo_f446re_CableRobot.pio\build\nucleo_f446re\firmware.elf…
(No debugging symbols found in c:\Users\USER2\Documents\PlatformIO\Projects\Nucleo_f446re_CableRobot.pio\build\nucleo_f446re\firmware.elf)
PlatformIO Unified Debugger → Redirecting...
PlatformIO: debug_tool = stlink
PlatformIO: Initializing remote target…
xPack OpenOCD x86_64 Open On-Chip Debugger 0.11.0+dev (2021-10-16-21:19)
Licensed under GNU GPL v2
For bug reports, read
OpenOCD: Bug Reporting
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
srst_only separate srst_nogate srst_open_drain connect_deassert_srst

Info : tcl server disabled
Info : telnet server disabled
Info : clock speed 2000 kHz
Info : STLINK V2J40M27 (API v2) VID:PID 0483:374B
Info : Target voltage: 3.268993
Info : stm32f4x.cpu: Cortex-M4 r0p1 processor detected
Info : stm32f4x.cpu: target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for stm32f4x.cpu on pipe
Info : accepting ‘gdb’ connection from pipe
target halted due to debug-request, current mode: Thread
xPSR: 0x61000000 pc: 0x08006222 msp: 0x2001ff20
Info : device id = 0x10006421
Info : flash size = 512 kbytes
Info : flash size = 512 bytes
0x08006222 in HardwareSerial::write(unsigned char const*, unsigned int) ()
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Unable to match requested speed 2000 kHz, using 1800 kHz
Unable to match requested speed 2000 kHz, using 1800 kHz
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08006e58 msp: 0x20020000
target halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x08006e58 msp: 0x20020000
Temporary breakpoint 1 at 0x8006e3c
PlatformIO: Initialization completed
PlatformIO: Resume the execution to debug_init_break = tbreak main
PlatformIO: More configuration options → Redirecting...
Note: automatically using hardware breakpoints for read-only addresses.

Temporary breakpoint 1, 0x08006e3c in main ()

Which is normal. It tells you it successfully hit the main() breakpoint in the Arduino framework. It shold then go on to call your setup() and loop() functions.

If I press on the buttons Run from the debugger the led on the Nucleo start flashing green/red

O sorry just start with PlatformIO, and before I always work with the Arduino IDE, without debugging… so this stuff is all new for me… And it is not easy for me all the english tutorials…

but if the led is flashing, it is running?

The LED on the ST-Link part just indicates debugger activity, that’s normal when you trigger any debugging options like halt, run, step-over, et cetera.

If the code still doesn’t seem like it’s running I need to see the platformio.ini and src/main.cpp content.

Can I zip the project directory and put it to download somewhere… because it is really a lot already…

it was a progam in a arduino, and now I try to get it running on a STM32

[env:nucleo_f446re]

platform = ststm32

board = nucleo_f446re

framework = arduino

monitor_speed = 115200

lib_extra_dirs = ~/Documents/Arduino/libraries

Do things step-by-step. Use a simple blinky to verify that you can generally upload executable code to the board, otherwise there’s no point in trying a more complicated sketch. The Nucleo does have an on-board LED.

Does this program blink the LED properly?

#include <Arduino.h>
#define LED LED_LD2

void setup() {
  pinMode(LED, OUTPUT);
}

void loop() {
  digitalWrite(LED, LOW);
  delay(1000);
  digitalWrite(LED, HIGH);
  delay(1000);
}

But I did that, and that was working… and I also have a TFTShield for the Arduino Uno/Mega… and I have run a demo for the tft screen on the Nucleo and it was a lot lot faster as on the Mega…

So thats why I start with this…

but the tft demo just start in run…? and now I get this?
So I don’t understand why the TFT demo starts in run… and this program not?

and I have also a Nucleo F446ZE, and also on that one, I did a blink test… with the different User leds… green and blue…

so that i thought it was time for the next step… :slight_smile:

Hard to say what’s going on without the code. Best to use “Start Debugging” and see if e.g. setup() completes correctly, loop() is executing or whether it’s crashing somewhere.


Yes, I don’t know if it is running or not? Don’t know where to look… :slight_smile:

I know the program was running in the Arduino IDE… Now I have it in PlatformIO… can build and upload…

only, in the program I use the serial monitor… and now the serial monitor does give any answer…

So or the controller is not running… or there is something wrong with the serial monitor? I Don’t know what is wrong, or what I do wrong…

I’ve never seen the UI elements pointed to by the green arrows – it seems you have different extensions installed besides PlatformIO, like the rivaling “Arduino” extension?