STM32F407 Discovery Compiling Issues
Touseef Sat Jun 04, 2016 10:50 am
Hi! I have watched Roger’s video on yourtube “
https://www.youtube.com/watch?v=-zwGnytGT8M” in which he said said that “The board is connected via a USB to serial adapter, which is connected to Serial1 on the STM32.” by that what does he mean? Does he mean that he is using a simple USB cable to connect his STM32 board with a PC or he is using some hardware device to connect STM32 with PC. I’m connecting my STM32F407 board with a simple USB cable and it works perfectly fine while uploading a program using
Keil software.
As I’m using STM32F407 Discovery with Arduino 1.5.8 with windows 8 and while uploading the same I2C program it is showing me an error:
“Cannot run program “{runtime.tools.arm-none-eabi-gcc.path}/bin/arm-none-eabi-g++”: CreateProcess error=2, The system cannot find the file specified”.
I have also used Arduino 1.6.9 but that didn’t even worked and shows some other error while compiling:
“#include <Wire.h>
^
compilation terminated.
exit status 1
Error compiling for board STM32 Discovery F407.”
Could you please let me know the reason behind this issue as I really need it urgently.
Waiting for your kind response.
Regards,
Touseef
Replies
martinayotte Sat Jun 04, 2016 3:26 pm
For the missing Wire library, as I said in the other thread, it is partially my fault : I’ve manually copied the Wire library from F1 into F4 more than a year ago, but I’ve never committed it.
Touseef Mon Jun 06, 2016 2:08 pm
martinayotte wrote:For the missing Wire library, as I said in the other thread, it is partially my fault : I’ve manually copied the Wire library from F1 into F4 more than a year ago, but I’ve never committed it.
Vassilis Mon Jun 06, 2016 2:41 pm
@Touseef
It would be more convenient to us if you choose in which thread you want us to get your answers.
To the current one or to
that one Touseef Mon Jun 06, 2016 2:58 pm
Vassilis wrote:
@Touseef
It would be more convenient to us if you choose in which thread you want us to get your answers.
To the current one or to
that oneVassilis Mon Jun 06, 2016 3:45 pm
Touseef wrote:Vassilis wrote:
@Touseef
It would be more convenient to us if you choose in which thread you want us to get your answers.
To the current one or to
that oneTouseef Mon Jun 06, 2016 4:30 pm
OK no problem, thanks for letting me know. can you help me regarding this COM Port issue?
martinayotte Mon Jun 06, 2016 4:35 pm
We need to know up to how you progressed in your project.
Port menu for F4 is only used for Serial Monitor, it is not used for uploading sketch.
Did you upload a sketch while your F4 board were placed in DFU mode or uploaded using STLink ?
If Yes and upload succeeded, do you have any SerialUSB been initialized in the setup() of your sketch ?
(because it is only at this moment that SerialUSB will appear)
Touseef Mon Jun 06, 2016 4:55 pm
martinayotte wrote:We need to know up to how you progressed in your project.
Port menu for F4 is only used for Serial Monitor, it is not used for uploading sketch.
Did you upload a sketch while your F4 board were placed in DFU mode or uploaded using STLink ?
If Yes and upload succeeded, do you have any SerialUSB been initialized in the setup() of your sketch ?
(because it is only at this moment that SerialUSB will appear)
Vassilis Mon Jun 06, 2016 5:30 pm
Roger had added two lines of code in
HardwareSerial.h and
usb_serial.h files.
HardwareSerial.hclass HardwareSerial : public Stream {
public:
HardwareSerial(usart_dev *usart_device,
uint8 tx_pin,
uint8 rx_pin);
/* Set up/tear down */
void begin(uint32 baud);
void end(void);
/* I/O */
virtual int available(void);
virtual int peek(void);
virtual void flush(void);
uint32 pending(void);
virtual int read(void);
virtual size_t write(unsigned char);
using Print::write;
/* Pin accessors */
int txPin(void) { return this->tx_pin; }
int rxPin(void) { return this->rx_pin; }
operator bool() { return true; } //<-------------- This line -----------------
private:
usart_dev *usart_device;
uint8 tx_pin;
uint8 rx_pin;
};
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.
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.
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 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.
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 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.
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.
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 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 …
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 …
mrburnette Wed Jun 08, 2016 1:53 pm
Touseef wrote:martinayotte wrote:What do you wish to accomplish with this “while(!Serial);” ?
I don’t see the goal here …
Sign in to reply