BlackPill STM32F401 not detected in Arduino IDE

Post Reply
nmzaheer
Posts: 3
Joined: Mon Apr 25, 2022 12:24 pm

BlackPill STM32F401 not detected in Arduino IDE

Post by nmzaheer »

Hi there,

I have been developing for the BlackPill STM32F401 board in Arduino IDE for the past couple of months using STM32duino and it has been a easy transition from ATmega boards. Kudos to the team :) :) :) .

I have started exploring the possibility of bare metal programming using STM32CubeIDE & STM32CubeMX. I ran a simple Blinking LED code by following this article https://daniellethurow.com/blog/2021/6/ ... 32cube-ide.

In the CubeMX, I set the PC13 pin as GPIO output and compiled the code and got a elf file as output. Since, I didn't have the ST-LINK programmer with me, I put the board in DFU mode and used the STM32CubeMXProgrammer to flash the elf file to the board.

Success !! LED blinks with a delay of 1 second. Happy that the basic setup has been completed, I wanted to flash the STM32duino program back to the board to check if things can be brought back to my usual set-up. However, the Arduino IDE fails to recognize the port and hence i'm unable to flash the STM32duino program to the board.

I am able to detect the board in DFU mode in the STM32CubeMXProgrammer utility but the same does not show up in the Arduino IDE. Further, when the program is running on the board, the Arduino IDE lists a port that belongs to the board. However, after my configuration in STM32CubeMX, the USB port is not showing up in the Arduino IDE.

I feel I have made a mistake in configuring the board properly (in STM32CubeMX) and hence I'm unable to connect to the USB port through the Arduino IDE.

Any pointers as to how to solve this would be greatly helpful.

OS : Mac OS 12.0.1
Board: STM32F401 Black Pill
Arduino : 1.8.13
Stm32duino : 2.2.0
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: BlackPill STM32F401 not detected in Arduino IDE

Post by GonzoG »

When you boot STM32F4 in DFU mode, there is no COM port so you won't see it in Arduino IDE but it will be flashed.
nmzaheer
Posts: 3
Joined: Mon Apr 25, 2022 12:24 pm

Re: BlackPill STM32F401 not detected in Arduino IDE

Post by nmzaheer »

Yes. you are right. Usually the STM32F4 board shows a COM port when it is not in DFU mode. Once Arduino IDE is pointed to that COM port, I set the board in DFU mode and flash it.

My problem is the board is not showing up on Arduino IDE when it is not in DFU mode.
nmzaheer
Posts: 3
Joined: Mon Apr 25, 2022 12:24 pm

Re: BlackPill STM32F401 not detected in Arduino IDE

Post by nmzaheer »

I figured it out.

Since, I had configured only the GPIO pins for my blink program, the USB functionality was lost. That was the reason why it was not showing up as one of the COM ports in the Arduino IDE.

I followed this article for configuring the USB https://www.bennettnotes.com/notes/stm3 ... sb-serial/ as a Virtual COM port device.

After flashing the board with this configuration, I am able to set the COM port in the Arduino IDE and then flash my program to the board.
Post Reply

Return to “STM32F4 based boards”