NOTE: i actually forgotten about this #9 blog so only post it today, few weeks after i initially work on it

my blog 12 is the coding sequel to this

 

Introduction

There are multiple IDEs that can be used with the Nucleo-64 STM32F411

 

Today, i try with the MBED. It is cloud based and free. After logging in to your developer console, one need to select the supported board. I add the STM32F411 and choose to create a new hello world example....in this case the LED blinking.

Screenshots below show the steps involved.

The STM32411 board is connected to PC with mini USB connector cable. On my windows 8.1 machine it will auto install the driver but fail. The STM32 STLink is a on board in-circuit debugger

 

 

To install the driver successfully, go to https://www.st.com/en/evaluation-tools/nucleo-f411re.html , download and install the STSW-LINK009

With successful installation, you will see the STLink virtual com port as well as the ST-Link Debug

Going back to the mbed, we press the compile button. for the LED blinking example a file Nucleo_blink_led.NUCLEO_F411RE.bin is created and downloaded. In windows explorer, we drag and drop this to STM32F411 drive

the board will then has its LED labelled with LD2 blinking with every 1s interval. To make sure that we are really successful with programming the board, change the interval to 5s by modifying the code to below.

drag the created bin file again and voila the LED should now blink with 5s interval

#include "mbed.h"


DigitalOut myled(LED1);


int main() {
    while(1) {
        myled = 1; // LED is ON
        wait(0.2); // 200 ms
        myled = 0; // LED is OFF
        wait(5.0); // 1 sec
    }
}

Testing the 13A motor driver board

The 13A motor driver board has grove interface

to use it import motor driver library into mbed by right clicking the project folder, import library\from import wizard. some modifications are needed as the library is originally built for arduino

 

for example, the pinMode in arduino need to be updated

pinMode(_pin1, OUTPUT)  ---> reconfigured as DigitalOut

 

References

[1] https://www.st.com/en/evaluation-tools/nucleo-f411re.html

[2] https://www.st.com/content/st_com/en/campaigns/sensortile-edu.html

[3] https://www.st.com/content/st_com/en/products/embedded-software/wireless-connectivity-software/stblesensor.html