Development Environment

Source Code, Compilers, and System Generator

NUCLEO-F401RE Board Support

Nucleo-F4

The NUCLEO-F401RE board is an affordable and flexible platform for prototyping using a STM32F401RET6 microcontroller with 96K SRAM, 512K Flash, and 84MHz frequency. It has support for the Arduino header and the ST Morpho headers. You can take a look at the extension shields supported by the NUCLEO-F401RE here. (This is not a complete list. For instance, I will show you how the Seeed CAN bus shield can be supported in the example projects.)


NUCLEO-F401RE Arduino Header

Arduino-Pin

NUCLEO-F401RE Morpho Header

Morpho-Pin

Header images from https://developer.mbed.org


To upload images to the NUCLEO board from your host machine, you will have to install the ST-LINK/V2 driver. On Linux or other UNIX-like machines, you have to do this by building ST-LINK from source. Go to https://github.com/texane/stlink and follow the instruction in the REAME file.

Once the ST-LINK/V2 driver is installed, you have to update the board firmware. You can do this on any platform you wish, as long as you have the ST-LINK/V2 driver installed. Download the firmware here and follow the instruction in the readme.txt file. For all platforms, firmware update can be done using the Java tools provided in the package. If you want to do this on Windows, follow the instruction here.


Now that you have the ST-LINK/V2 driver installed and the firmware updated, you can start configuring, building, and uploading SDVOS for the NUCLEO-F401RE board.

When you configure an SDVOS instance for the NUCLEO-F401RE board, you need to specify the BOARD attribute in the OS object to NUCLEOF401RE. You should also set the CPU name to ARMCortexM4. An example might look like:

CPU ARMCortexM4 {
  OS HELLO_OS {
    STATUS = EXTENDED;
    STARTUPHOOK = TRUE;
    ERRORHOOK = TRUE;
    SHUTDOWNHOOK = FALSE;
    PRETASKHOOK = FALSE;
    POSTTASKHOOK = FALSE;
    USEGETSERVICEID = TRUE;
    USEPARAMETERACCESS = TRUE;
    USERESSCHEDULER = TRUE;
    DEBUGLEVEL = 2;
    BOARD = NUCLEOF401RE;
    DRIVER = "uart/stm32f4xx_uart";
  };
  ...
};

After you configure the kernel with the system generator, the necessary headers and source files will be generated along with the kernel makefile. You can build the kernel by typing make and upload the kernel image to the board with make burn. When you type make burn, you are invoking the st-flash command that comes with the ST-LINK/V2 driver. For the NUCLEO-F401RE board, the upload command is defined in src/board/NUCLEOF401RE/config.mk:

UPLOAD_COMMAND = st-flash write $(BIN) 0x8000000

$(BIN) will be replaced by sdvos.bin after you build the kernel.