Issues Flashing with CubeProgrammer

Post here first, or if you can't find a relevant section!
Post Reply
twoface
Posts: 5
Joined: Fri Feb 05, 2021 4:08 pm

Issues Flashing with CubeProgrammer

Post 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.
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Issues Flashing with CubeProgrammer

Post by stevestrong »

Which core do you use and which board have selected in Arduino IDE?
twoface
Posts: 5
Joined: Fri Feb 05, 2021 4:08 pm

Re: Issues Flashing with CubeProgrammer

Post 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
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Issues Flashing with CubeProgrammer

Post by stevestrong »

Which upload method have you selected in Arduino IDE?
twoface
Posts: 5
Joined: Fri Feb 05, 2021 4:08 pm

Re: Issues Flashing with CubeProgrammer

Post by twoface »

STM32CubeProgrammer (DFU)
ag123
Posts: 1657
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

Re: Issues Flashing with CubeProgrammer

Post 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)
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Issues Flashing with CubeProgrammer

Post by stevestrong »

So you use the STM core.
Pay attention how you use the pins, PC_13 is not equal to PC13.
twoface
Posts: 5
Joined: Fri Feb 05, 2021 4:08 pm

Re: Issues Flashing with CubeProgrammer

Post 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.
ag123
Posts: 1657
Joined: Thu Dec 19, 2019 5:30 am
Answers: 25

Re: Issues Flashing with CubeProgrammer

Post 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
Last edited by ag123 on Sat Feb 06, 2021 5:41 am, edited 1 time in total.
twoface
Posts: 5
Joined: Fri Feb 05, 2021 4:08 pm

Re: Issues Flashing with CubeProgrammer

Post 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!!
Post Reply

Return to “General discussion”