STM32F407 Discovery Compiling Issues

Limited support for STM32F4 Discovery, Nucleo and custom F4 boards
Touseef
Posts: 16
Joined: Sat Jun 04, 2016 9:25 am

STM32F407 Discovery Compiling Issues

Postby 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
Attachments
IMG_20160604_161612-Optimized.jpg
Here is the image of my board STM32F407 Discovery that works perfectly fine while uploading a program using Keil Software using a simple USB cable.
IMG_20160604_161612-Optimized.jpg (122.72 KiB) Viewed 978 times

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

Re: STM32F407 Discovery Compiling Issues

Postby 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
Posts: 16
Joined: Sat Jun 04, 2016 9:25 am

Re: STM32F407 Discovery Compiling Issues

Postby 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.


OK I've done that and now the only issue is the that it's not showing me any port on Arduino IDE 1.6.9 and for the same reason when I try to run the serial monitor it shows "Board at COM1 is not available" while the board works perfectly fine whenever I upload a code using Keil software. Any solution for this problem?

Have a look on the screenshots please.
Attachments
stm32f4.png
Device Manager Screenshot
stm32f4.png (23.75 KiB) Viewed 941 times
arduino IDE.png
Arduino IDE 1.6.9 Tools menu
arduino IDE.png (12.16 KiB) Viewed 941 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 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
Posts: 16
Joined: Sat Jun 04, 2016 9:25 am

Re: STM32F407 Discovery Compiling Issues

Postby 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

I prefer any answers to my quires on this thread. I'm a newbie to this and that's why I'm facing too much issue. My current problem is that COM Port issue.

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


@Vassilis

I prefer any answers to my quires on this thread. I'm a newbie to this and that's why I'm facing too much issue. My current problem is that COM Port issue.

I asked you that (always friendly) because if your question is published in two threads there is not a normal conversation flow and that confuses the members of this forum that try to answer you something that has been answered on the second thread.

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

Re: STM32F407 Discovery Compiling Issues

Postby 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?

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

Re: STM32F407 Discovery Compiling Issues

Postby 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
Posts: 16
Joined: Sat Jun 04, 2016 9:25 am

Re: STM32F407 Discovery Compiling Issues

Postby 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)



I've uploaded the code using a simple USB cable connected with my STM32F4 board. The code I uploaded is the same that Roger gave in his youtube video: https://www.youtube.com/watch?v=-zwGnytGT8M

May be this code don't work with F4 Boards because it only compiles when I make a command in comments (see attachment).

I just want to know that how can I blink a simple LED at pin 12 and 13 on my STM32 Discovery F4 board. Once I'll get the idea then I can start making codes for other projects.
Attachments
serial.png
serial.png (4.81 KiB) Viewed 904 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 5:30 pm

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

HardwareSerial.h

Code: Select all

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


usb_serial.h

Code: Select all

class USBSerial : public Stream {
public:
    USBSerial(void);

    void begin(void);
    void begin(int);
    void end(void);
    // Roger Clark. This is needed because in cardinfo.ino it does if (!Serial) . It seems to be a work around for the Leonardo that we needed to implement just to be compliant with the API
    operator bool() { return true; }  //<-------------- This line -----------------
   
    virtual int available(void);
    virtual int peek(void);
    virtual void flush(void);

    virtual int read(void *buf, uint32 len);
    virtual int read(void);

    size_t write(uint8);
    size_t write(const char *str);
    size_t write(const void*, uint32);

    uint8 getRTS();
    uint8 getDTR();
    uint8 isConnected();
    uint8 pending();

    void enableBlockingTx(void);
    void disableBlockingTx(void);
};


Return to “STM32F4 Boards”

Who is online

Users browsing this forum: No registered users and 1 guest