Problem Uploading to STM32F405 from Arduino IDE

Post here first, or if you can't find a relevant section!
Post Reply
jneymeyer
Posts: 2
Joined: Tue Feb 27, 2024 12:32 am

Problem Uploading to STM32F405 from Arduino IDE

Post by jneymeyer »

We are doing a senior design project that involves uploading Arduino code to a Adafruit Feather STM32F405 Express. Everytime we try to upload it, we are met with an exit status 127 or an exit status 1. We follow the preferences/tools on the Adafruit website: https://learn.adafruit.com/adafruit-stm ... gKaofD_BwE

Any suggestions?
User avatar
fpiSTM
Posts: 1723
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Problem Uploading to STM32F405 from Arduino IDE

Post by fpiSTM »

So you used dfu? And you shorten the boot0 pin? Then press reset?
The STM32CubeProgrammer is well installed?
The bord is recognized as stm32bootloader ?
jneymeyer
Posts: 2
Joined: Tue Feb 27, 2024 12:32 am

Re: Problem Uploading to STM32F405 from Arduino IDE

Post by jneymeyer »

Does dfu pertain to the microcontroller settings on Arduino IDE? Or is that a software that is already uploaded on the computer?
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Problem Uploading to STM32F405 from Arduino IDE

Post by ag123 »

@jneymeyer

There are some pre-requisites
The first place to visit is the stm32duino wiki - which is hosted in Github instead of here.
https://github.com/stm32duino/Arduino_Core_STM32/wiki
Among that is the getting started guide
https://github.com/stm32duino/Arduino_C ... ng-Started
That is mainly to install the core (i.e. the stm32duino 'os' and codes).
And the 'official' STM core is here (that guide installs this):
https://github.com/stm32duino/Arduino_Core_STM32
this is the same as that in Adafruit's tutorial

In addition, you need, STM32CubeProgrammer
https://www.st.com/en/development-tools ... eprog.html
Do install this as stm32duino core has menus that lets you select this so that it upload directly from the IDE with STM32CubeProgrammer.
And that on its own, it can be used to upload firmware, The technical guides are all linked on STM32CubeProgrammer web page above.
STM32CubeProgrammer is practically the DFU 'driver' if you prefer to think that way.

To upload to stm32f405 feather: Normally in device manager you should be able to find a 'DFU' (device firmware upgrade) device (or some such relevant device) under usb devices if it is working correctly I'd think.

After you have uploaded successfully, disconnect that boot0, patch wire, and press reset, it should revert to the normal operating mode.
i.e. your sketch should be running.

you need to select the correct board (matching Adafruit feather express) from the menu in the IDE.
This matters, otherwise your sketch may simply *not work*. The deep down details is that the board (variant) does configurations
and initializations (e.g. setup the external crystal and system clock), the configuration is specifically tied to the crystal frequency on your board).
And that it initializes various macros so that they reference the peripherals e.g. LEDs correctly.

and always start with a simple sketch such as to blink the led

Code: Select all

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

void loop() {
	digitalWrite(LED_BUILTINN, ! digitalRead(LED_BUILTIN));
	delay(500);
}
Post Reply

Return to “General discussion”