Spark Logic

STM32F407 Discovery Compiling Issues

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 STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog .” by that what does he mean? Does he mean that he is using a simple USB cable to connect his STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog board with a PC or he is using some hardware device to connect STM32STM32Microcontrollers and processors…Map magic glue code, ethernet compiles, just WARNING: library LwIP claims to run on [ stm32 ] architecture(s) and may be incompatible with your current board which runs on [STM32]…View in hardware catalog with PC. I’m connecting my STM32F407STM32F407Microcontrollers and processors… Sun Mar 11, 2018 8:03 pm Hello Can I found anywhere CAN BUS library and example for STM32F407 ? vegfokic Thu Mar 15, 2018 11:16 am Hi I found a COIDE code for stm32discovery and…View in hardware catalog board with a simple USB cable and it works perfectly fine while uploading a program using Keil software.

As I’m using STM32F407 DiscoverySTM32F407 DiscoveryDevelopment and computing boards…ous to see how the 1Bitsy compares against the Teensy 3.2. Also have the Teensy 3.6, STM32F407 Discovery and STM32F469 Discovery and a Netduino 2 Plus. Smile As you can see, I’m g…View in hardware catalog 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 DiscoverySTM32 DiscoveryDevelopment and computing boards…rom an authorized distrubutor. The other alternative is to use the low cost Nucelo / Discovery boards . They would still be low cost (assuming you are in the US) but they will be…View in hardware catalog 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

Replies20

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.

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.

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

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 one

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 one

Mon Jun 06, 2016 4:30 pm

OK no problem, thanks for letting me know. can you help me regarding this COM Port issue?

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)

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)

Mon Jun 06, 2016 5:30 pm

Roger had added two lines of code in HardwareSerial.h and usb_serial.h files.

HardwareSerial.h

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

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.

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 MegaArduino MegaDevelopment and computing boards…:57 pm Roger, In order to use the Maple mini in my project (porting it directly from Arduino Mega ), I would need the I2C library to support both master and slave mode. This solut…View in hardware catalog 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.

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.

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.

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.

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 STM32F4STM32F4Microcontrollers and processors…uild.board' preference. Auto-set to: STM32F3_DISCOVERY_F3 Board Arduino_STM32-master: STM32F4 :discovery_f407 doesn't define a 'build.board' preference. Auto-set to: STM32F4_DISCO…View in hardware catalog has on board LEDs on these pins. May be I can upload a simple code to turn on these two LEDs.

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 STM32F4STM32F4Microcontrollers and processors…uild.board' preference. Auto-set to: STM32F3_DISCOVERY_F3 Board Arduino_STM32-master: STM32F4 :discovery_f407 doesn't define a 'build.board' preference. Auto-set to: STM32F4_DISCO…View in hardware catalog has on board LEDs on these pins. May be I can upload a simple code to turn on these two LEDs.

Mon Jun 06, 2016 10:53 pm

What do you wish to accomplish with this “while(!Serial);” ?
I don’t see the goal here …

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 …

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 …

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 …

Post a reply

Optional · up to 10 MiB