"STM32 Mini F401" STM32F401CCU6

Post Reply
blakeAlbion
Posts: 7
Joined: Tue Jun 08, 2021 7:22 pm

"STM32 Mini F401" STM32F401CCU6

Post by blakeAlbion »

Hello,

I am new to STM32, and this is my first posting here.
I purchased a "green" STM32F401 board on Amazon. This particular board looks just like the green boards with "HW-848" printed on them, but no "HW-848" is present.

This board is identified correctly here: https://stm32-base.org/boards/STM32F401 ... -Mini-F401

I can power up the board and was able upload a "blink" program using USB C. Cool!

My question is, how do I learn more about this board? I see pinouts for the blue/black pill boards like this:
https://docs.zephyrproject.org/2.5.0/bo ... index.html

As a Teeny/Arduino user, this pinout tells me a lot about which pins are optimized for different purposes: GPIO, SPI, I2C, PWM, ADC, etc.
I am looking for an equivalent map for this STM32F401CCU6-based board.
I read the pin and variant C files for the STM32F104 boards in stmduino. They seem very generic. The only thing I see defined is PA0-PA9 for analog inputs.

I tried various pinModes on my board, and so far they all just work like magic. I understand these may be quite generic, but I also know things like SPI and PWM require dedicated timers and I'm assuming somewhere maybe there are constants for setting these up.

In summary,
Are there pin mappings I need to know about for this board?
Are there predefined constants for dedicated pins, and does it matter if I use a black pill board definition vs a generic STM32F401xxxx definition?

Thanks!
Ben
blakeAlbion
Posts: 7
Joined: Tue Jun 08, 2021 7:22 pm

Re: "STM32 Mini F401" STM32F401CCU6

Post by blakeAlbion »

Oh yes, one more general question.
Can I use the USB C port for serial debugging? Or do I need a dedicated connection for that?
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: "STM32 Mini F401" STM32F401CCU6

Post by fredbox »

I have a few of those boards.

For development, I keep switch #3 on and the others off.

Pressing reset enables DFU mode and enables uploading a program.

SerialUSB works without any issues. Enable Serial in the CDC options.

To upload again, press reset to enable DFU mode.

To see the pins available, see https://github.com/stm32duino/Arduino_C ... eralPins.c
blakeAlbion
Posts: 7
Joined: Tue Jun 08, 2021 7:22 pm

Re: "STM32 Mini F401" STM32F401CCU6

Post by blakeAlbion »

Thanks so much, that helps!
I assume I cannot use the Arduino serial monitor because no port can be selected. Is there another way to get serial to a terminal?
fredbox
Posts: 125
Joined: Thu Dec 19, 2019 3:05 am
Answers: 2

Re: "STM32 Mini F401" STM32F401CCU6

Post by fredbox »

I just ran a test,

To use USB serial, turn switch #3 off and press reset.

Under Linux:

Code: Select all

[389728.082943] usb 5-1: Product: BLACKPILL_F401CC CDC in FS Mode
[389728.082946] usb 5-1: Manufacturer: STMicroelectronics
[389728.082949] usb 5-1: SerialNumber: 356436553433
[389728.116170] cdc_acm 5-1:1.0: ttyACM0: USB ACM device
[389728.116214] usbcore: registered new interface driver cdc_acm
[389728.116217] cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
Windows 10 automatically installed a com port and I verified it was communicating with Putty.

If you need SerialUSB without the switching, use the ST-Link and choose SWD as the upload method. There will be two USB cables connected, but you won't have to deal with the switch. I don't think that switch is rugged enough to last very long.

The other way to get serial to a terminal is to use a USB to logic level adapter connected to PA9 and PA10.
AndrewBCN
Posts: 105
Joined: Sun Apr 25, 2021 3:50 pm
Answers: 1
Location: Strasbourg, France

Re: "STM32 Mini F401" STM32F401CCU6

Post by AndrewBCN »

A schematic diagram and some more information are available here in a ZIP file:
https://drive.google.com/file/d/1I3E_-Z ... qD978/view
ag123
Posts: 1655
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: "STM32 Mini F401" STM32F401CCU6

Post by ag123 »

assuming that you are using this core
https://github.com/stm32duino/Arduino_Core_STM32
i think you can select 'stm32f401 (generic) black pill' board.for the variant, and select 'usb serial' (or serial usb CDC) when you build you sketch.
that 'black pill' matters as one thing is that is bult for a 25mhz crystal, some variants are built for a 8mhz crystal and to a new user, it would look like it 'doesn't work' if the clock setup is incorrect
all you need is a usb cable (no dongles) to connect via usb serial (com: port)
for ordinary 'debug' you can use

Code: Select all

Serial.println("hello world");
style statements to check responses and variables from your serial terminal

others have covered flashing the firmware above.
generally to flash a firmware, set boot0, press reset and check for usb-dfu connecting from the internal on-chip bootloader.
then you can use open sourced dfu-util or stm32cube programmer to flash it

for real debugging you need st-link v2
https://www.adafruit.com/product/2548
https://www.st.com/en/development-tools/st-link-v2.html
https://octopart.com/search?q=st-link+v2

don't forget to review the faqs
viewtopic.php?f=2&t=3
viewtopic.php?f=2&t=301
Post Reply

Return to “STM32F4 based boards”