STM32F407 Discovery Compiling Issues

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
User avatar
martinayotte
Posts: 1170
Joined: Mon Apr 27, 2015 1:45 pm

Re: STM32F407 Discovery Compiling Issues

Postby martinayotte » Mon Jun 06, 2016 5:36 pm

There is a small but important difference between F1 and F4 :
Under F4 the SerialUSB is not mapped to Serial, since Serial serial is already mapped to an hardware serial port, like other Serial1/Serial2/Serial3/Serial4.
You should change all Serial keywords in your sketch with explicit SerialUSB.

User avatar
ddrown
Posts: 124
Joined: Sat Jan 09, 2016 4:49 am

Re: STM32F407 Discovery Compiling Issues

Postby ddrown » Mon Jun 06, 2016 6:31 pm

From the other thread. Please don't hijack unrelated threads with your question.

Here is the screenshot of my device manager and the tools menu of Arduino IDE 1.6.9 and I'm unable to understand why it's not showing me any port option and on the other hand that port options works perfectly fine when I'm connecting my Arduino Mega 2560 board with my PC.


The stlink built into the f4 discovery does not have uart built in. You need to connect to the uart on the f4 with a separate USB-UART device.

User avatar
martinayotte
Posts: 1170
Joined: Mon Apr 27, 2015 1:45 pm

Re: STM32F407 Discovery Compiling Issues

Postby martinayotte » Mon Jun 06, 2016 7:00 pm

The OTG_FS_USB on PA11/PA12 should work as SerialUSB, I'm using the same on Netduino2Plus and STM32F4Stamp as well as custom designed boards.

Touseef
Posts: 16
Joined: Sat Jun 04, 2016 9:25 am

Re: STM32F407 Discovery Compiling Issues

Postby Touseef » Mon Jun 06, 2016 7:17 pm

OK I've added these two lines in those files but the issues remains the same. Here is the screenshot. Please have a look.
Attachments
sketch.png
sketch.png (38.94 KiB) Viewed 382 times

User avatar
Vassilis
Posts: 294
Joined: Thu May 21, 2015 6:42 am
Location: Thessaloniki, Greece
Contact:

Re: STM32F407 Discovery Compiling Issues

Postby Vassilis » Mon Jun 06, 2016 7:54 pm

After adding those lines, did you restart the Arduino IDE ?

martinayotte wrote:There is a small but important difference between F1 and F4 :
Under F4 the SerialUSB is not mapped to Serial, since Serial serial is already mapped to an hardware serial port, like other Serial1/Serial2/Serial3/Serial4.
You should change all Serial keywords in your sketch with explicit SerialUSB.

@Touseef
See also what wrote Martin about the SerialUSB

Touseef
Posts: 16
Joined: Sat Jun 04, 2016 9:25 am

Re: STM32F407 Discovery Compiling Issues

Postby Touseef » Mon Jun 06, 2016 8:15 pm

Yes I did restart my Arduino IDE after adding those lines in files and also replaced the word "Serial" with "SerialUSB" but the problem remains the same.

Along with this issue can you please let me know how can I write a code to blink an LED on Pin 12 and Pin 13 because STM32F4 has on board LEDs on these pins. May be I can upload a simple code to turn on these two LEDs.

User avatar
Rick Kimball
Posts: 771
Joined: Tue Apr 28, 2015 1:26 am
Location: Eastern NC, US
Contact:

Re: STM32F407 Discovery Compiling Issues

Postby Rick Kimball » Mon Jun 06, 2016 8:28 pm

Touseef wrote:Along with this issue can you please let me know how can I write a code to blink an LED on Pin 12 and Pin 13 because STM32F4 has on board LEDs on these pins. May be I can upload a simple code to turn on these two LEDs.

This site might not be the right place for you at this time. Most people here dig in to the core code to figure things out. Do you real need to use this stm32 board? Maybe you would be better of with a DUE clone from China. Or a Teensy board where there is lots of customer support.
-rick

User avatar
martinayotte
Posts: 1170
Joined: Mon Apr 27, 2015 1:45 pm

Re: STM32F407 Discovery Compiling Issues

Postby martinayotte » Mon Jun 06, 2016 10:53 pm

What do you wish to accomplish with this "while(!Serial);" ?
I don't see the goal here ...

Touseef
Posts: 16
Joined: Sat Jun 04, 2016 9:25 am

Re: STM32F407 Discovery Compiling Issues

Postby Touseef » Wed Jun 08, 2016 8:28 am

martinayotte wrote:What do you wish to accomplish with this "while(!Serial);" ?
I don't see the goal here ...


Martin I just want to write a simple code using which I can blink LEDs on pin 12 and 13. Need guidance on this one.

Then my next goal will be to control a DC servo motor with my board but right now blinking LEDs are my priority.

User avatar
martinayotte
Posts: 1170
Joined: Mon Apr 27, 2015 1:45 pm

Re: STM32F407 Discovery Compiling Issues

Postby martinayotte » Wed Jun 08, 2016 12:52 pm

So, just comment that "while(!Serial);" , it should then compile.
I still don't understand why it is there in your code since it seems useless ...


Return to “STM32F4 Boards”

Who is online

Users browsing this forum: Baidu [Spider] and 1 guest