Page 1 of 1
Issues Flashing with CubeProgrammer
Posted: Fri Feb 05, 2021 4:10 pm
by twoface
Hi All,
I'm trying to do a DFU program upload via arduino for an STM32F401CC. I'm using CubeProgrammer to upload the compiled bin and verify the contents of the STM32's flash is being written starting at 0x8 -- it's all there. I'm using a jumper to pull B0 high and am verifying it shows as STM32 BOOTLOADER in the device manager, then I'm disconnecting it. Everything shows that the program is upload correctly, but my program isn't actually running (make onboard PC13 LED blink). I'm using a board I got off amazon but verified the STM32F401CC is genuine. Is there something I'm missing? I'm coming over to ARM after years of using the ESP32.
Re: Issues Flashing with CubeProgrammer
Posted: Fri Feb 05, 2021 6:55 pm
by stevestrong
Which core do you use and which board have selected in Arduino IDE?
Re: Issues Flashing with CubeProgrammer
Posted: Fri Feb 05, 2021 7:02 pm
by twoface
Board: Generic STM32F4 Series
Board Part: Generic F401CC
I'm using these as part of the STM32 package.
Here is my output when uploading a program:
Code: Select all
Sketch uses 22168 bytes (8%) of program storage space. Maximum is 262144 bytes.
Global variables use 3624 bytes (5%) of dynamic memory, leaving 61912 bytes for local variables. Maximum is 65536 bytes.
-------------------------------------------------------------------
STM32CubeProgrammer v2.6.0
-------------------------------------------------------------------
USB speed : Full Speed (12MBit/s)
Manuf. ID : STMicroelectronics
Product ID : STM32 BOOTLOADER
SN : 375934763335
FW version : 0x011a
Device ID : 0x0423
Device name : STM32F401xB/C
Flash size : 256 KBytes (default)
Device type : MCU
Device CPU : Cortex-M4
Memory Programming ...
Opening and parsing file: sketch_feb04a.ino.bin
File : sketch_feb04a.ino.bin
Size : 22608 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:
File download complete
Time elapsed during download operation: 00:00:01.411
RUNNING Program ...
Address: : 0x8000000
Start operation achieved successfully
Re: Issues Flashing with CubeProgrammer
Posted: Fri Feb 05, 2021 7:10 pm
by stevestrong
Which upload method have you selected in Arduino IDE?
Re: Issues Flashing with CubeProgrammer
Posted: Fri Feb 05, 2021 7:11 pm
by twoface
STM32CubeProgrammer (DFU)
Re: Issues Flashing with CubeProgrammer
Posted: Fri Feb 05, 2021 7:14 pm
by ag123
for those
F4 pill boards, a finger dance applies.
- press both reset and boot0.
- release reset while holding boot0 for 1 more secs
- flash away (you can release both buttons)
Re: Issues Flashing with CubeProgrammer
Posted: Fri Feb 05, 2021 7:16 pm
by stevestrong
So you use the STM core.
Pay attention how you use the pins, PC_13 is not equal to PC13.
Re: Issues Flashing with CubeProgrammer
Posted: Fri Feb 05, 2021 7:17 pm
by twoface
With the STM32 Core, what are the pin mappings?
PC13 gives same result.
I'm also doing the finger dance with Boot 0 and Reset.
Re: Issues Flashing with CubeProgrammer
Posted: Fri Feb 05, 2021 7:31 pm
by ag123
i think that board is in 'generic stm32f4 series' -> 'blackpill f401cc'
you may like to review the variant files, that's perhaps a best place to find the mappings
when you choose a 'wrong' board, at best the cpu clock frequency is completely out, but the led still blinks. and normally usb fails to work with a 'wrong' frequency setup. the somewhat nice thing about stm32 especially f4xx is, the cpu clock frequencies are 'quite easy' to change, you could have accidentally 'overclocked' simply using an incorrect setup
Re: Issues Flashing with CubeProgrammer
Posted: Fri Feb 05, 2021 7:38 pm
by twoface
ag123 wrote: Fri Feb 05, 2021 7:31 pm
i think that board is in 'generic stm32f4 series' -> 'blackpill f401cc'
you may like to review the variant files, that's perhaps a best place to find the mappings
when you choose a 'wrong' board, at best the cpu clock frequency is completely out, but the led still blinks. and normally usb fails to work with a 'wrong' frequency setup.
I was actually suspecting it'd be something to do with CPU freq. When I selected the blackpill f401cc it worked.
I guess maybe now I'll move to platformio to have a little more control of these settings.
Thank you!!