cancel
Showing results for 
Search instead for 
Did you mean: 

STM32 F405 Feather Won't Connect to Arduino IDE

vs13
Associate III

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.

21 REPLIES 21
Techn
Senior III

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
  }
}
If you feel a post has answered your question, please click "Accept as Solution".
vs13
Associate III

@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.

Techn_0-1719417965528.png

Techn_0-1719418136059.jpeg

 

If you feel a post has answered your question, please click "Accept as Solution".

You need a Debugger Pod like an ST-LINK or J-LINK to connect to the SWD Debugging ports, and SWV Serial channel.

You can't manifest this via the USB DFU connection.

You'd want to attach a 10-pin debug header to the board to facilitate an SWD connection

f405_swd_debug_header.jpg

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

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

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
vs13
Associate III

@Techn wrote:

These are your Tool menu selections to verify!


 I'm using those settings in the Tools menu, but the Ports menu only lets me select COM4, which cannot connect to the board.

vs13_0-1719426194056.png

I added my COM4 back the same as yours with Actions > Add legacy hardware, but the port can't function properly and says that it has the best driver but still has the warning sign on the port icon. How can I get this port online?

vs13_1-1719426247138.png

When I try to connect to the board over COM4, I get this error from the Serial Monitor:

vs13_2-1719426635534.png

 

 

vs13
Associate III

@Techn wrote:

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
  }
}

This is my entire sketch now, but the port still cannot connect.

void setup() {
  Serial.begin(9600);
  while (!Serial) {
    ; //wait for serial port to connect
  }
}

void loop() {
  Serial.println("Serial is alive!");
  delay(500);
}

@Tesla DeLorean wrote:

You need a Debugger Pod like an ST-LINK or J-LINK to connect to the SWD Debugging ports, and SWV Serial channel.

You can't manifest this via the USB DFU connection.

You'd want to attach a 10-pin debug header to the board to facilitate an SWD connection


I'm also using an ST-Link V2 with a 10-pin header to connect to my board through CubeProgrammer.

When you insert the usb cable along with your board does it gets detected while BOOT0 is not pulled high? If not cable issue . May be you need to check other serial ports? Device driver? Please try example->communication->ASCII  sketch. 

If you see yellow :warning: it means , device driver issue.

If you feel a post has answered your question, please click "Accept as Solution".
vs13
Associate III

@Techn wrote:

When you insert the usb cable along with your board does it gets detected while BOOT0 is not pulled high?


The board is not detected while BOOT0 is not pulled high.


@Techn wrote:

May be you need to check other serial ports? Device driver? 

If you see yellow :warning: it means , device driver issue.


The other serial ports stay offline when I connect the board, and this is the name of the driver that the board is using. The driver for the board doesn't have the warning icon, it's the driver for the port itself that is showing the warning sign. 

vs13_0-1719502927594.png


@Techn wrote:

Please try example->communication->ASCII  sketch. 


I can't find this sketch in this repo, could you link the sketch you're referring to?