Nucleo F446RE Upload Error

Hello,

I am looking to use and learn the mbed framework with a Nucleo F446RE. I’ve written the generic blinking led project with the following code

#include <mbed.h>

DigitalOut myled(LED1);

int main() {
    myled = 0;
    wait_ns(10000);
    myled = 1;
    wait_ns(10000);
    
    return 0;
}

But, after running pio run -t upload I get the following response with an error

Building in release mode
Compiling .pio/build/nucleo_f446re/src/main.o
Linking .pio/build/nucleo_f446re/firmware.elf
Checking size .pio/build/nucleo_f446re/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   7.4% (used 9696 bytes from 131072 bytes)
Flash: [=         ]   6.1% (used 31720 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-17-00:18)
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

Error: init mode failed (unable to connect to the target)
in procedure 'program'
** OpenOCD init failed **
shutdown command invoked

*** [upload] Error 1

It appears the code does successfully build, but it can’t find the device in order to upload the compiled code.

I promise the device is connected (see image)

Here is my platformio.ini file if that helps

[env:nucleo_f446re]
platform = ststm32
board = nucleo_f446re
framework = mbed

I’m not entirely sure what to try next. I did attempt connecting the VDD and BOOT0 pins in order to do a reset of sorts. No success.

Any information or assistance would be greatly appreciated!

You’re heavily shorting out the Nucleo board if you plugged it into the breadboard like this, the two-column morpho connector is on the same row each…

Do you have the latest ST-Link drivers installed? Is the ST-Link firmware on the Nucleo up to date?

Have you tried setting upload_protocol = mbed in the platformio.ini and retried?

Hey @maxgerhardt. I adjusted it so the board debugger is no longer connected to the breadboard (thank you for pointing that out).

I updated the platform.ini file to use mbed for the upload_protocol option

[env:nucleo_f446re]
platform = ststm32
board = nucleo_f446re
framework = mbed
upload_protocol = mbed
upload_port = /Volumes/NOD_F446RE

And received the following output

Building in release mode
Checking size .pio/build/nucleo_f446re/firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM:   [=         ]   7.4% (used 9696 bytes from 131072 bytes)
Flash: [=         ]   6.1% (used 31720 bytes from 524288 bytes)
Configuring upload protocol...
AVAILABLE: blackmagic, cmsis-dap, jlink, mbed, stlink
CURRENT: upload_protocol = mbed
Looking for upload disk...
Using manually specified: /Volumes/NOD_F446RE
Uploading .pio/build/nucleo_f446re/firmware.bin
*** [upload] /Users/ecochra/.dev/nucleo/projects/nucleo-eeprom/.pio/build/nucleo_f446re/firmware.bin: No space left on device

I’m not sure if I’m on the right track now. I tried using the /dev/cu.usbmodem401103 as the upload_port option with no success.

As for the firmware, I doubt it is up-to-date, and I, unfortunately, don’t have an ST-Link to push updates with. Is there a manual to update the firmware?

That should be correct. I don’t see a problem in your Nucleo, it has all the jumpers set so that the ST-Link on the nucleo (upper part) is properly connected to the microcontroller below… The “ST-Link” jumpers are both set on the top and the IDD jumper is set too, power LED is on too.

Are there any files in the /Volumes/NOD_F446RE virtual drive? A FAIL.txt maybe?

Can you take a picture of the back of the Nucleo?

@maxgerhardt for the contents of the /Volumes/NOD_F446RE

Here is the back of the board.

And contents of FAIL.txt and DETAILS.TXT is?

@maxgerhardt with an interesting turn of events, I took the board off of the breadboard, and (for whatever reason) I was able to upload with no problem.

I believe when I checked the contents before, it would essentially show which ever error I was receiving from the upload output.