Page 1 of 1

STM32F401CC - upload works, but no usb serial

Posted: Fri Oct 27, 2023 7:31 pm
by Aiyseri
Hi Everyone,
I got myself a little board with an STM32 (my first). Its an STM32F401CCU6.

The board is not really for development, so it lacks proper breakout of the BOOT pins. So I have to put a wire between USB VCC and BOOT0 to get it into DFU mode everytime I want to flash it which is a pain, so I decided I wanted to get the HID bootloader up and running on the board so I can program it Arduino style (Press Play).

I checked over on GitHub and arrived at Serasidis repo, which I cloned and modified the F4 bootloader code since it does not have readily defined support for the F401CC (his code is for F407). If anybody's interested I can post it back to GitHub with my mods.

Following instructions here and there, fetching .S and .ld files for the MCU + the instructions to get the clocks up and running proper at 48MHz which was discussed for Blackpill F401CC I got the board to boot up and get recognized on my machine with the HID\VID_1209&PID_BEBA&REV_0300, yay!

I can program it from the Arduino environment and I've checked the flash contents with STM32Cube so the code is there at 0x08004000 where its supposed to be, but my problem is that I don't get the USB serial up and running.

Is the thing just stuck in the bootloader mode all the time? Am I missing something with the BOOT pins ?

I'm noob for STM32 stuff so I thought I'd reach out for some help.

Best regards,
Aiy

Re: STM32F401CC - upload works, but no usb serial

Posted: Fri Oct 27, 2023 7:53 pm
by Aiyseri
Oh, I found the mistake myself.
It was the BOOT1 pin being low that held the device in bootloader mode all the time.
For now I've disabled the BOOT1 pin check in the bootloader code.
As a consequence it needs some arduino code present at the userspace code at 0x8004000 or we dont get into userland.. I guess thats an the extra step not exactly spelled out in the GitHub repo for the bootloader...

Best regards,
Aiy

Re: STM32F401CC - upload works, but no usb serial

Posted: Sat Oct 28, 2023 3:28 am
by ag123
you need to specify which core / repository that you are using