Generic Led Blink Demo not working on STM32F407VG Discovery

Post here first, or if you can't find a relevant section!
Post Reply
Bulek44
Posts: 16
Joined: Mon Feb 22, 2021 3:42 pm

Generic Led Blink Demo not working on STM32F407VG Discovery

Post by Bulek44 »

Hello,

I've followed the instructions and installed needed libraries and SW to support F4 Discovery board.
I get no errors on compile and upload, but LED diode doesn't blink.
I guess maybe no proper Pin is selected for the LED.

I'm also curious if I can get Serial port working. I haven't found any instructions on how to properly setup
this particular board...

Can anyone help with advice ?

Thanks in advance,
regards,
Bulek44.

Code: Select all

// the setup function runs once when you press reset or power the board
void setup() {
  // initialize digital pin LED_BUILTIN as an output.
  pinMode(LED_BUILTIN, OUTPUT);
  Serial.begin(9600);
  Serial.println("Hello World");
}

// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);                       // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);                       // wait for a second
  Serial.println("2 secs");
  
}
Sketch uses 24372 bytes (4%) of program storage space. Maximum is 524288 bytes.
Global variables use 3684 bytes (2%) of dynamic memory, leaving 127388 bytes for local variables. Maximum is 131072 bytes.
-------------------------------------------------------------------
STM32CubeProgrammer v2.6.0
-------------------------------------------------------------------

ST-LINK SN : 066AFF303430484257142040
ST-LINK FW : V2J37M26
Board : STM32F4DISCOVERY
Voltage : 2.91V
SWD freq : 4000 KHz
Connect mode: Under Reset
Reset mode : Hardware reset
Device ID : 0x413
Revision ID : Rev Y
Device name : STM32F405xx/F407xx/F415xx/F417xx
Flash size : 1 MBytes (default)
Device type : MCU
Device CPU : Cortex-M4



Memory Programming ...
Opening and parsing file: Blink_Demo.ino.bin
File : Blink_Demo.ino.bin
Size : 24800 Bytes
Address : 0x08000000


Erasing memory corresponding to segment 0:
Erasing internal memory sectors [0 1]
Download in Progress:


File download complete
Time elapsed during download operation: 00:00:00.864

RUNNING Program ...
Address: : 0x8000000
Application is running
Start operation achieved successfully
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: Generic Led Blink Demo not working on STM32F407VG Discovery

Post by GonzoG »

To enable Serial USB just enable CDC (generic serial) in menu Tools->USB Support.
If LEDBUILTIN does not work try any of those 4 ports:
PD12, PD13, PD14 or PD15.
Bulek44
Posts: 16
Joined: Mon Feb 22, 2021 3:42 pm

Re: Generic Led Blink Demo not working on STM32F407VG Discovery

Post by Bulek44 »

Hello,

thanks for tips... LEDS now blink using PDx pins labels...

But USB serial is still dead...

I've following settings in Tools:
U(S)ART support: "Enabled (generic Serial)"
USB support : CDC (generic Serial supersede U(S)ART"
USB speed : "Low/Full Speed"
...
Upload method : "STM32CubeProgrammer (SWD)"
...
Programmer : No programmers available for this board
...
Any advice what to change (have tried several combinations, but no go - should I reset unplug/plug after each change ) ?

Any examples anywhere using STM32Duino for stm32 boards (majority are made on other APIs) ?

Thanks in advance,
regards,
Bulek
Bulek44
Posts: 16
Joined: Mon Feb 22, 2021 3:42 pm

Re: Generic Led Blink Demo not working on STM32F407VG Discovery

Post by Bulek44 »

Hello,

it works normally. It was my false expectation to see CDC on ST-Link console. It's on USB host connector...

Thanks,
Bulek.
User avatar
Pito
Posts: 94
Joined: Tue Dec 24, 2019 1:53 pm

Re: Generic Led Blink Demo not working on STM32F407VG Discovery

Post by Pito »

The F407 Discovery's LEDs are called
LED_BLUE
LED_ORANGE
LED_RED
LED_GREEN
:)
Pukao Hats Cleaning Services Ltd.
Post Reply

Return to “General discussion”