Skip to main content
Graduate II
June 25, 2024
Question

STM32 F405 Feather Won't Connect to Arduino IDE

  • June 25, 2024
  • 5 replies
  • 9210 views

I'm trying to use Arduino 2.3.2 with an STM32F405 board and I configured it to use these recommended settings, but I can't open the Serial monitor for the board. It can connect to my laptop and even upload code successfully, but I can't access the ports menu and receive Serial output from the board.

I'm able to get the Ports menu to open back up if I go into the Device Manager and add additional ports, but usually my boards use COM3 or COM5, which I cannot access through the ports menu. All of the legacy hardware I install (tried the Arduino USB Serial adapter and the STMicroelectronics Virtual COM port) will only install in ports after 5. I was only able to get it working once, and that was when I was able to connect to COM5, but I don't know what happened to allow access to COM5, and it stopped working as soon as I attempted to upload a different sketch to the board.

    This topic has been closed for replies.

    5 replies

    Super User
    June 25, 2024

    @vs13 wrote:

    it stopped working as soon as I attempted to upload a different sketch to the board.


    So what, exactly, was the sketch that you uploaded?

    Have you tried erasing it, and starting again from scratch?

     


    @vs13 wrote:

     I configured it to use these recommended settings, .


    That page says you have to manually put the board into bootloader mode every time you want to upload - are you doing that?

     

    Not sure if this is really an ST problem - or something for Arduino and/or Adafruit?

    https://forums.adafruit.com/

    https://forum.arduino.cc/c/software/ide-2-x/93 

     

     

     

    vs13Author
    Graduate II
    June 25, 2024


    So what, exactly, was the sketch that you uploaded?

    Have you tried erasing it, and starting again from scratch?


    Here's the sketch. I've just been going through trying to figure out how to use all of the board's features, and Serial has had the biggest hang up. 

    void setup() {
     Serial.begin(9600);
    }
    
    void loop() {
     Serial.println("Can read Serial!");
     delay(500);
    }

    I haven't tried erasing the sketch, but I've tried to upload separate programs and new versions of this one and none have fixed the issue.

    That page says you have to manually put the board into bootloader mode every time you want to upload - are you doing that?


    Yes, I am putting the board into bootloader mode every time I upload. The upload seems to be happening successfully, but I can't connect to and read the Serial output after I disconnect the wire and press the Reset button.

    Graduate II
    June 25, 2024

    You'd need a loader on the board to manifest a serial port, or the code you upload would need to a USB Device.

    The ROM based loader can present as a DFU Device, "STM32 BOOT LOADER" type instance, and STM32 Cube Programmer can push code in that way.

    This is not an Arduino centric forum, there are others which are.

    vs13Author
    Graduate II
    June 25, 2024

    @Tesla DeLorean wrote:

    You'd need a loader on the board to manifest a serial port, or the code you upload would need to a USB Device.

    The ROM based loader can present as a DFU Device, "STM32 BOOT LOADER" type instance, and STM32 Cube Programmer can push code in that way.


    My feather board shows up as "STM32 BOOTLOADER" in my Device Manager when I connect it to my laptop, and Cube Programmmer is able to push code to the board, but I can't open Serial using the SWV


    @Tesla DeLorean wrote:

    This is not an Arduino centric forum, there are others which are.


    I've also made this post on Arduino's forum, but I thought I would also reach out here in case my problem was actually specific to the board I am using. 

     

     

    Super User
    June 25, 2024

    @vs13 wrote:


    My feather board shows up as "STM32 BOOTLOADER" in my Device Manager . 


    So it's just in the bootloader - not running your app?

    Graduate II
    June 26, 2024

    After the code is uploaded, press reset,  check device manager, serial ports. In arduino change the serial port as per device manager and then open serial monitor 

    vs13Author
    Graduate II
    June 26, 2024

    @Techn wrote:

    After the code is uploaded, press reset,  check device manager, serial ports. In arduino change the serial port as per device manager and then open serial monitor 


    When the board is connected in bootloader mode, all of the serial ports show as disconnected (greyed out and hidden) in the Device Manager. When I disconnect bootloader mode, the board disappears from my device list and the Serial ports are still hidden and grayed out.

    Graduate II
    June 26, 2024

    Is B0 connected to gnd via resistor else ground b0 and press reset. Can you send me the schematic of your board? 

    vs13Author
    Graduate II
    June 26, 2024

    @Techn wrote:

    Is B0 connected to gnd via resistor else ground b0 and press reset. Can you send me the schematic of your board? 


    In bootloader mode, B0 is connected to 3.3V. After the program is uploaded, I connect B0 to GND and press Reset to start the program. Adafruit has a pinout of the board here, but if you need any other documentation I can give that to you too.

    Graduate II
    June 26, 2024

    Techn_0-1719417965528.png

    Techn_0-1719418136059.jpeg

     

    Graduate II
    June 26, 2024

    Please remove  and the corresponding include

    SWOStream s(2000000, SWO_Async
    void setup() {
     //Initialize serial and wait for port to open:
     Serial.begin(9600);
     while (!Serial) {
     ; // wait for serial port to connect. Needed for native USB
     }
    }
    Graduate II
    June 26, 2024

    Correct, if the Arduino loader/code is manifesting a USB CDC Device it will present as "Serial" when non-zero it has a connection to the PC.

    Other code using print() / println() / write() should also be wary of this