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


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 one

Vassilis
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

Touseef
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 …

Touseef
Wed Jun 08, 2016 3:08 pm
OK I’ve uploaded your code and it shows the same error “No Target Connected” after uploading the complete code.

mrburnette
Wed Jun 08, 2016 3:13 pm
Touseef wrote:<…>
shows the same error “No Target Connected” after uploading the complete code.

martinayotte
Wed Jun 08, 2016 4:32 pm
You should not bother about the “No target connected”, I think it is simply that it doesn’t seems to be able to execute “reset”.
Simply power-cycle your board to see it blinking.

mrburnette
Wed Jun 08, 2016 4:49 pm
Thanks, Martin!
I do not have an F4 Discovery Board … but with as many questions as we get about these darn things, I should probably buy one just to punish myself :lol:

Ray


martinayotte
Wed Jun 08, 2016 6:27 pm
Hi Ray, the “reset” issue is not only F4 related …
For your punishment, you should purchase board like viewtopic.php?f=39&p=14454#p14450
With such punishments, it becomes a pleasure to be punished … :lol:

Touseef
Wed Jun 08, 2016 7:48 pm
mrburnette wrote:Touseef wrote:<…>
shows the same error “No Target Connected” after uploading the complete code.

RogerClark
Wed Jun 08, 2016 9:19 pm
For a start, dont use pin numbers, use the official STM names for the pins, which you already quoted in your post.

mrburnette
Wed Jun 08, 2016 10:40 pm
martinayotte wrote:Hi Ray, the “reset” issue is not only F4 related …
For your punishment, you should purchase board like viewtopic.php?f=39&p=14454#p14450
With such punishments, it becomes a pleasure to be punished … :lol:

martinayotte
Wed Jun 08, 2016 10:59 pm
mrburnette wrote:
the board is probably shipped in a black leather carry-pouch and a miniature whip. :roll:
’tis would give a new meaning to chip torture.

mrburnette
Thu Jun 09, 2016 12:26 am
martinayotte wrote:
And the chip can answer “meoww !” :lol:

martinayotte
Thu Jun 09, 2016 2:23 am
Hi Ray !
Don’t get me wrong here … It is not me that going to shout “meow !” … :lol:
Here, in Quebec, there is currently a commercial on TV, from charity Org, that wish people to donate unused wearing.
We can see this big fat man wearing a leather clothe, we don’t see his women around using the “miniature whip”, but the man is screaming “meow !” … :lol:
He concluded that he doesn’t need this wearing anymore …
In fact, the comedian doing this is a well known artist, he support the campaign for donation ! :ugeek:
I’m always laft when I see that commercial … :lol:

mrburnette
Thu Jun 09, 2016 12:07 pm
martinayotte wrote:
<…>
I’m always laft when I see that commercial … :lol:

ahull
Fri Jun 10, 2016 11:12 am
Never mind all that French nonsense… http://www.glengoyne.com/

mrburnette
Fri Jun 10, 2016 12:07 pm
ahull wrote:Never mind all that French nonsense… http://www.glengoyne.com/

Sandrine
Wed Jun 29, 2016 2:56 pm
It looks to me like that STK link thingy isn’t even coming up as a serial port, rather a proprietary USB connection that only links to the ST IDE. Perhaps an interface soft like Serial Emulator would be able to deal with it. I myself can’t try that as I haven’t a discovery board (yet)

Also, a question I’ll pose here:
I have chosen the STM32F407 chip because (mostly) it has SDIO implemented. It’s too bad the ‘duino development isn’t up to snuff yet, so does anyone know of a lesser, more supported STM32F chip that still has SDIO?
I know the 103 fall short on that bus, unless I’m missing part of the datasheet :lol:

Cheers!!


RogerClark
Wed Jun 29, 2016 9:55 pm
Some F103 versions have SDIO, but it is only available on the F103RC or better e.g F103RE, F103Vxx and F103Zxx

unfortunately we do not have any code for libmaple that supports it.

But…

There are 2 possibilities to remedy this shortcomming.

Arduino.cc are working on SDIO code for the STAR OTTO and it will be published to github, we can then take this code and port it into the HAL MX core.
(@vassilis has already, kindly, ported the STAR OTTO I2C (Wire) library to the HAL MX core)

Alternatively, I made an experimental HAL library for the libmaple F103 code, so it may be possible to use STMs example SDIO code ( which uses the HAL) by making use of the HAL library.

But, the bottom line is at the moment, we do not have support for SDIO :-(


Sandrine
Thu Jun 30, 2016 4:09 am
Thanks so much for taking the time to reply Roger!
You have saved me a lot of research time for sure. I won’t be developing until end of summer so fingers crossed.

I need a solution to transfer parallel 16 bit data (16MB) to an SD Card in a timely (not minutes) fashion under FATfs and looks like SPI is just too variable for it.

Cheers!

_BTW excellent work Roger!!


RogerClark
Thu Jun 30, 2016 4:28 am
No worries

In that timeframe, I suspect the HAL MX core may be your best bet, as hopefully by then Arduino.org will have written the code for the OTTO which we can port.

Francesco @ Arduino.org is in fairly regular contact, via email, so I should know as soon as they have SD working.

BTW.
I think we have DMA transfer to SD card via SPI, but I can’t recall whether its working or not at the moment. i.e I thought at one point it was working, but we sometimes have setbacks and things stop working due changes in dependencies (other libs).


martinayotte
Thu Jun 30, 2016 12:58 pm
Could I ask what kind of data which takes such huge space ?

Sandrine
Thu Jun 30, 2016 3:33 pm
Oh I hope so!

It’s audio data 16bit, 48Ks/s in stereo. Effectively to dump the RAM directly from the bus


martinayotte
Thu Jun 30, 2016 8:44 pm
That is making 192KBytes/sec, if I’m not wrong, normal SDCard on Hardware SPI should then be able to handle that.

Sandrine
Fri Jul 01, 2016 3:50 am
Yes it can, but it’s a RAM dump not record/play in real time as that’s already been done. The audio is modified then place on the SD Card when done. I’d like a few seconds at most as I have an Akai MPX-8 that takes as long as the sample plays to load so there’s this huge wait time (really poor planning on their part) for 8 samples. Even drum samples take forever :?

Sandrine
Sun Jul 03, 2016 12:49 am
On compiling I get this stream of errors:
Arduino: 1.6.9 (Windows XP), Board: "STM32 Discovery F407"

WARNING: Category '' in library RTClock is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library SPI is not valid. Setting to 'Uncategorized'
WARNING: Category '' in library UIPEthernet is not valid. Setting to 'Uncategorized'
Warning: platform.txt from core 'STM32F4 boards' contains deprecated recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{build.path}/{archive_file}" "{object_file}", automatically converted to recipe.ar.pattern="{compiler.path}{compiler.ar.cmd}" {compiler.ar.flags} {compiler.ar.extra_flags} "{archive_file_path}" "{object_file}". Consider upgrading this core.
arm-none-eabi-g++: error: and: No such file or directory
arm-none-eabi-g++: error: Settings\FreshNelly\My: No such file or directory
arm-none-eabi-g++: error: Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\cores\maple/libmaple/usbF4: No such file or directory
arm-none-eabi-g++: error: and: No such file or directory
arm-none-eabi-g++: error: Settings\FreshNelly\My: No such file or directory
arm-none-eabi-g++: error: Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\cores\maple/libmaple/usbF4/STM32_USB_Device_Library/Core/inc: No such file or directory
arm-none-eabi-g++: error: and: No such file or directory
arm-none-eabi-g++: error: Settings\FreshNelly\My: No such file or directory
arm-none-eabi-g++: error: Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\cores\maple/libmaple/usbF4/STM32_USB_Device_Library/Class/cdc/inc: No such file or directory
arm-none-eabi-g++: error: and: No such file or directory
arm-none-eabi-g++: error: Settings\FreshNelly\My: No such file or directory
arm-none-eabi-g++: error: Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\cores\maple/libmaple/usbF4/STM32_USB_OTG_Driver/inc: No such file or directory
arm-none-eabi-g++: error: and: No such file or directory
arm-none-eabi-g++: error: Settings\FreshNelly\My: No such file or directory
arm-none-eabi-g++: error: Documents\Arduino\hardware\Arduino_STM32-master\STM32F4\cores\maple/libmaple/usbF4/VCP: No such file or directory


RogerClark
Sun Jul 03, 2016 1:01 am
Check and empty sketch or Blink etc compiles OK, as it looks like the issue you are seeing are nothing to do with the STM32 stuff but are a limitation of the Arduino IDE, in that it doesn’t seem to accept spaces in file names

I’d intially rename all your files and folders to replace the spaces with underscores.

I’d go so far as to say, I never use spaces in file names when programming, as there are many programs and scripts etc which don’t allow spaces in file names.

I’d get into the habit of using underscores instead of spaces.


martinayotte
Sun Jul 03, 2016 1:23 am
Poor MS-Sh$t ! Poor Arduino.cc for those Windows spaces in path bugs that last since several releases ! We have also another thread about that in the same day ! I thought that 1.6.9 had resolved all those bug !
Viva Linux !!!
(@Ray, you don’t have all those bugs since you’ve been Linuxified, right ? :lol: )

Sandrine
Sun Jul 03, 2016 2:11 am
RogerClark wrote:Check and empty sketch or Blink etc compiles OK, as it looks like the issue you are seeing are nothing to do with the STM32 stuff but are a limitation of the Arduino IDE, in that it doesn’t seem to accept spaces in file names

I’d intially rename all your files and folders to replace the spaces with underscores.

I’d go so far as to say, I never use spaces in file names when programming, as there are many programs and scripts etc which don’t allow spaces in file names.

I’d get into the habit of using underscores instead of spaces.


Sandrine
Sun Jul 03, 2016 2:22 am
I have moved the sketch book directory to C:\ and it’s working!! No more spaces. Just the standard warnings.

mrburnette
Sun Jul 03, 2016 2:32 am
martinayotte wrote:
<…>
(@Ray, you don’t have all those bugs since you’ve been Linuxified, right ? :lol: )

martinayotte
Sun Jul 03, 2016 1:08 pm
Sandrine wrote:I have moved the sketch book directory to C:\ and it’s working!! No more spaces. Just the standard warnings.

RogerClark
Sun Jul 03, 2016 10:39 pm
Most users do not have a problem with using the default location for the Arduino folder, so I suspect there is something else going on.

It would be interesting to know if AVR code compiles in the location where the STM32 code doesnt


Sandrine
Wed Jul 06, 2016 2:44 pm
Sure everything has always compiled, even though Arduino IDE itself is allergic to any non-alpha characters other than underscore or hyphen. Leading numbers are also a no no. But it appears the STM code isn’t using relative paths so …

One thing that is possibly different is I have 2 other versions of Arduino IDE in program files/Atmel folder, but V.1.69 is in default folder


Sandrine
Tue Aug 23, 2016 2:03 pm
RogerClark wrote:Some F103 versions have SDIO, but it is only available on the F103RC or better e.g F103RE, F103Vxx and F103Zxx

unfortunately we do not have any code for libmaple that supports it.

But…

There are 2 possibilities to remedy this shortcomming.

Arduino.cc are working on SDIO code for the STAR OTTO and it will be published to github, we can then take this code and port it into the HAL MX core.
(@vassilis has already, kindly, ported the STAR OTTO I2C (Wire) library to the HAL MX core)

Alternatively, I made an experimental HAL library for the libmaple F103 code, so it may be possible to use STMs example SDIO code ( which uses the HAL) by making use of the HAL library.

But, the bottom line is at the moment, we do not have support for SDIO :-(


RogerClark
Tue Aug 23, 2016 9:30 pm
Arduino.cc were working on an SDIO library, but they have not emailed me to say it has been released

You could check the Arduino.cc github repo to see if there have been any updates.


Leave a Reply

Your email address will not be published. Required fields are marked *