Arduino IDE STM32 F411CE Write failed at address: 0x8000000

Development environment specific, Arduino, Eclipse, VS2013, Em::Blocks etc
Post Reply
tsulis
Posts: 3
Joined: Sat Dec 04, 2021 12:09 pm
Answers: 1

Arduino IDE STM32 F411CE Write failed at address: 0x8000000

Post by tsulis »

Hi,

I am new to STM32, recently i purchased STM32F411CE (BlackPill), at once i was able to program from Arduino IDE but later i stuck with no luck : Write failed at address: 0x8000000.

my machine is macOS bigSur (11.5.2), Arduino IDE 1.8.16 and Arduino Board Manager STMicroelectronics 2.1.0. Upload code via USB cable.

(entering DFU Mode by pressing BOOT0 (hold) then NRST (press-release) then release BOOT0)

Arduino IDE Config:
via USB : CDC(generic 'Serial' supersede U(S)ART
upload method : STM32CubeProgrammer DFU

Perhaps any tips and tricks?
-------------------------------------------------------------------
STM32CubeProgrammer v2.9.0
-------------------------------------------------------------------



USB speed : Full Speed (12MBit/s)
Manuf. ID : STMicroelectronics
Product ID : STM32 BOOTLOADER
SN : 366E355E3036
FW version : 0x011a
Board : --
Device ID : 0x0431
Device name : STM32F411xC/E
Flash size : 512 KBytes (default)
Device type : MCU
Revision ID : --
Device CPU : Cortex-M4



Memory Programming ...
Opening and parsing file: Blink.ino.bin
File : Blink.ino.bin
Size : 23948 Bytes
Address : 0x08000000


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 1]
erasing sector 0000 @: 0x08000000 done
erasing sector 0001 @: 0x08004000 done
Download in Progress:
Error:
Write failed at address: 0x8000000



Error: failed to download Segment[0]
Error: failed to download the File

RUNNING Program ...
Address: : 0x8000000
Start operation achieved successfully
Thank you.
by tsulis » Sat Dec 04, 2021 5:48 pm
tsulis wrote: Sat Dec 04, 2021 12:35 pm Hi,

I am new to STM32, recently i purchased STM32F411CE (BlackPill), at once i was able to program from Arduino IDE but later i stuck with no luck : Write failed at address: 0x8000000.

my machine is macOS bigSur (11.5.2), Arduino IDE 1.8.16 and Arduino Board Manager STMicroelectronics 2.1.0. Upload code via USB cable.

(entering DFU Mode by pressing BOOT0 (hold) then NRST (press-release) then release BOOT0)

Arduino IDE Config:
via USB : CDC(generic 'Serial' supersede U(S)ART
upload method : STM32CubeProgrammer DFU

Perhaps any tips and tricks?
-------------------------------------------------------------------
STM32CubeProgrammer v2.9.0
-------------------------------------------------------------------



USB speed : Full Speed (12MBit/s)
Manuf. ID : STMicroelectronics
Product ID : STM32 BOOTLOADER
SN : 366E355E3036
FW version : 0x011a
Board : --
Device ID : 0x0431
Device name : STM32F411xC/E
Flash size : 512 KBytes (default)
Device type : MCU
Revision ID : --
Device CPU : Cortex-M4



Memory Programming ...
Opening and parsing file: Blink.ino.bin
File : Blink.ino.bin
Size : 23948 Bytes
Address : 0x08000000


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 1]
erasing sector 0000 @: 0x08000000 done
erasing sector 0001 @: 0x08004000 done
Download in Progress:
Error:
Write failed at address: 0x8000000



Error: failed to download Segment[0]
Error: failed to download the File

RUNNING Program ...
Address: : 0x8000000
Start operation achieved successfully
Thank you.
SOLVED!

strange happens with native USB C cable. My blackpill usb is USB C connector. When i use native USB C cable then all this errors happened, but when i use Micro USB cable with little converter from micro usb to USB C, i can upload code as it should.
Go to full post
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: Arduino IDE STM32 F411CE Write failed at address: 0x8000000

Post by ag123 »

try using the built-in DFU bootloader.
the finger dance is:

1 - press both reset and boot0
2 - *hold* boot0, but release reset
3 - release boot0 1 sec later
normally the OS would have some logs that a DFU device is connected, that'd hint on the correct procedure.

then use stm32cube programmer etc to install the sketch/firmware (using dfu mode)
in arduino ide normally there is option to sketch > export compiled binary, and the binary should be found in your sketch folder.
but if stm32cube programmer works, it'd likely just work from within arduino ide, save an extra 'manual' step

edit:
there is something 'strange', it seemed you have a h/w failure, not common.
you may want to try with a different device if you have one handy

the other things to find out is things like the flash is write protected. this seemed unlikely as the erase succeeded
if indeed it is write protected, you may need to resort to an st-link v2 and there is this thing about 'connect under reset'

there are also stories here about unstable clocks for usb, which cause dfu to fail to connect. but it didn't seem likely as the erase part succeeded.
tsulis
Posts: 3
Joined: Sat Dec 04, 2021 12:09 pm
Answers: 1

Re: Arduino IDE STM32 F411CE Write failed at address: 0x8000000

Post by tsulis »

ag123 wrote: Sat Dec 04, 2021 4:23 pm try using the built-in DFU bootloader.
the finger dance is:

1 - press both reset and boot0
2 - *hold* boot0, but release reset
3 - release boot0 1 sec later
normally the OS would have some logs that a DFU device is connected, that'd hint on the correct procedure.

then use stm32cube programmer etc to install the sketch/firmware (using dfu mode)
in arduino ide normally there is option to sketch > export compiled binary, and the binary should be found in your sketch folder.
but if stm32cube programmer works, it'd likely just work from within arduino ide, save an extra 'manual' step

edit:
there is something 'strange', it seemed you have a h/w failure, not common.
you may want to try with a different device if you have one handy

the other things to find out is things like the flash is write protected. this seemed unlikely as the erase succeeded
if indeed it is write protected, you may need to resort to an st-link v2 and there is this thing about 'connect under reset'

there are also stories here about unstable clocks for usb, which cause dfu to fail to connect. but it didn't seem likely as the erase part succeeded.

Hi ag123,

i try your suggestions on finger dance but still an error show up
Write failed at address: 0x8001000
another one is
Write failed at address: 0x8000800
is there any time-sensitive on how long to press the buttons? because i do test on both with different time-release interval. errors are different code.
tsulis
Posts: 3
Joined: Sat Dec 04, 2021 12:09 pm
Answers: 1

Re: Arduino IDE STM32 F411CE Write failed at address: 0x8000000

Post by tsulis »

tsulis wrote: Sat Dec 04, 2021 12:35 pm Hi,

I am new to STM32, recently i purchased STM32F411CE (BlackPill), at once i was able to program from Arduino IDE but later i stuck with no luck : Write failed at address: 0x8000000.

my machine is macOS bigSur (11.5.2), Arduino IDE 1.8.16 and Arduino Board Manager STMicroelectronics 2.1.0. Upload code via USB cable.

(entering DFU Mode by pressing BOOT0 (hold) then NRST (press-release) then release BOOT0)

Arduino IDE Config:
via USB : CDC(generic 'Serial' supersede U(S)ART
upload method : STM32CubeProgrammer DFU

Perhaps any tips and tricks?
-------------------------------------------------------------------
STM32CubeProgrammer v2.9.0
-------------------------------------------------------------------



USB speed : Full Speed (12MBit/s)
Manuf. ID : STMicroelectronics
Product ID : STM32 BOOTLOADER
SN : 366E355E3036
FW version : 0x011a
Board : --
Device ID : 0x0431
Device name : STM32F411xC/E
Flash size : 512 KBytes (default)
Device type : MCU
Revision ID : --
Device CPU : Cortex-M4



Memory Programming ...
Opening and parsing file: Blink.ino.bin
File : Blink.ino.bin
Size : 23948 Bytes
Address : 0x08000000


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 1]
erasing sector 0000 @: 0x08000000 done
erasing sector 0001 @: 0x08004000 done
Download in Progress:
Error:
Write failed at address: 0x8000000



Error: failed to download Segment[0]
Error: failed to download the File

RUNNING Program ...
Address: : 0x8000000
Start operation achieved successfully
Thank you.
SOLVED!

strange happens with native USB C cable. My blackpill usb is USB C connector. When i use native USB C cable then all this errors happened, but when i use Micro USB cable with little converter from micro usb to USB C, i can upload code as it should.
Post Reply

Return to “IDE's”