2
\$\begingroup\$

I am transitioning from Arduino to STM32 development. I just purchased an STM32F401CCU6 board and I cannot get it recognized by my computer. I am running Ubuntu 22.04. I have tried searching everywhere but there is such poor documentation and support for working with ST (compared to Arduino and Espressif). My board has a USB C port on it but after watching countless videos and reading numerous forums, I've come to know that normally we use external programmers for development with these STM boards. I also have an external programmer (FTDI) if that's how it is supposed to be done.

I have showed the output of my 'dmesg' window, clearly showing the device recognized on a hardware level. But it is not recognized anywhere else. I tried finding it as a COM port via Arduino but did not find any available ports. I tried programs like CoolTerm and Putty but I could not see the port appear there either. I tried 'ls /dev/tty*' but did not find the device anywhere.

[282059.230618] usb 3-1: new full-speed USB device number 51 using xhci_hcd
[282059.380114] usb 3-1: New USB device found, idVendor=0483, idProduct=df11, bcdDevice=22.00
[282059.380123] usb 3-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[282059.380126] usb 3-1: Product: STM32  BOOTLOADER
[282059.380129] usb 3-1: Manufacturer: STMicroelectronics
[282059.380131] usb 3-1: SerialNumber: 359B33733237

I used the push buttons on the board to put it in DFU mode (no idea what that is) and I can confirm it worked because the user LED went off. But I still do not see it appear anywhere on my system. I also have a Nucleo F401RE and I never had to do anything extra to get it recognized by the same system (it was plug and play).

When I try to 'run' a program via CubeIDE, it says "No ST-LINK detected!". I have been stuck for days on this issue and I cannot figure out what needs to be done to flash a program onto it. It is just paperweight (a very inefficient one) at this point.

I tried using CubeProgrammer as well but could not establish a connection through either option - USB, UART nor ST-LINK. USB and UART require COM ports so they both failed. ST-LINK also failed to detect anything.

Any insights and guidance shall be greatly appreciated.

\$\endgroup\$
3
  • 2
    \$\begingroup\$ Which board?? Many of the dev boards have ST-Links built in, but without knowing which board, it's tough to develop any insight \$\endgroup\$ Aug 15, 2022 at 14:09
  • \$\begingroup\$ Appreciate your response. I don't know the model number of the board, but the one in this image is the exact one that I have: mischianti.org/wp-content/uploads/2022/02/… \$\endgroup\$
    – Harit
    Aug 15, 2022 at 14:19
  • 3
    \$\begingroup\$ Beginners shouldn't be programming through bootloaders anyway IMO. That way you end up learning about a lot of irrelevant things like how some specific bootloader works. Instead you should flash it over SWD (in case of Cortex M) using an in-circuit debugger. And that way your PC doesn't need to detect the board because why would it. Just power it up and leave it to the in-circuit debugger. \$\endgroup\$
    – Lundin
    Aug 16, 2022 at 6:54

3 Answers 3

3
\$\begingroup\$

Looks like a WeAct BlackPill -- https://docs.zephyrproject.org/2.6.0/boards/arm/blackpill_f401ce/doc/index.html

It has a boot loader, as do all the stm ARM cortexes (I believe), but no on-board programmer. It does allow programming with a programmer, though -- you would need to pick up an ST-Link clone.

I think the page I reference above will give you enough direction to use your device.

"DFU" is Device Firmware Update -- i.e., programming the device using the bootloader.

UPDATE: It looks like there may be issues using the Cube environment to program via DFU (https://community.st.com/s/question/0D53W00000euMKeSAM/stm32cubeprogrammer-doesnt-support-dfu-files) I can't confirm.

https://youtu.be/b1123kz_3MM has instructions for using Cube to program these. It involves finding and installing the STM32 core for Arduino, and doing some stuff in the Arduino Board Manager.

\$\endgroup\$
11
  • \$\begingroup\$ A link is not an answer ... \$\endgroup\$
    – brhans
    Aug 15, 2022 at 14:33
  • 1
    \$\begingroup\$ @Brhans I'm not sure I agree -- I think there is valuable info in there, but I'll consider deleting when a better answer comes along. In the meantime, consider a downvote, because this one won't get better. \$\endgroup\$ Aug 15, 2022 at 15:53
  • 1
    \$\begingroup\$ ... thus answering at least part of the question. "You can install a core in the Arduino environment to allow Cube to program the device" and pointing to specific instructions of how to do that is another part. \$\endgroup\$ Aug 15, 2022 at 16:05
  • 2
    \$\begingroup\$ Yes, perhaps you can use the Nucleo's ST-LINK. See section 6.2.4 "Using ST-LINK/V2-1 to program and debug an external STM32 application" in the Nucleo-64 User Manual. \$\endgroup\$
    – kkrambo
    Aug 16, 2022 at 13:11
  • 1
    \$\begingroup\$ @HaritKrishan Cross reference the tutorial with section 6.9 "Solder Bridges" in the User Manual. That should help you understand and work out what is appropriate for your situation. I have not used a Nucleo-64 board like this myself but at least SB12, SB13, and SB14 seem relevant so you should investigate further. \$\endgroup\$
    – kkrambo
    Aug 17, 2022 at 14:35
4
\$\begingroup\$

There are issues with the 'Black Pill' (25MHz HS crystal) design and DFU. Recommendation from ST:

Note: Due to HSI deviation and since HSI is used to detect HSE value, the user must use low frequency rather than high frequency HSE crystal values (low frequency values are better detected due to larger error margin). For example, it is better to use 8 MHz instead of 25 MHz

Apparently you can physically heat the chip to shift HSI clock frequency and help it properly detect the HSE crystal frequency at power-up (it's looking to detect even MHz values), but why bother?

I suggest using an STlink (V2, V3, or clone, any of which just works). Debugging capability is really important anyway.

\$\endgroup\$
1
  • \$\begingroup\$ FWIW, there is at least one version of STM32CubeProgrammer (Windows)that doesn't seem to work with DFU on Black Pill, even when the device is showing up properly in USBview as an STM32 device in DFU mode. V2.5.0 works and V2.11 works. Also, the bootloader does not seem to like USB hubs. \$\endgroup\$ Aug 18, 2022 at 17:31
0
\$\begingroup\$

I figured out how to start 'using' the board. As Scott Seidman pointed out, it was indeed loaded with a custom bootloader from WeAct/Zephyr. Once I connected it via ST-Link using the SWD pins, I was able to connect it to CubeIDE and program it normally, like a Nucleo Board. I first had to perform an upgrade (which CubeIDE automatically prompts you to do) by putting the board in DFU mode. Depending on which board you have, it is a particular combination of the on-board buttons or switches.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.