Source Code, Compilers, and System Generator
The STM32F4 Discovery board is a powerful and cost efficient prototyping platform for the STM32F407VGT6 ARM Cortex M4 microcontroller. It features 192K SRAM, 1024K Flash, and 168MHz frequency. The board also has support for USB OTG, CAN bus controllers, audio DAC, and microphone, etc. However, unlike the Nucleo boards, the STM32F4 Discovery board does not have support of Arduino header. You should consider the extension shield from MikroElektronika if you want to have some easy access to the UART interface or the CAN bus controller.
Pinout images from http://www.mobilerobots.pl
Like the Nucleo boards, to upload images to the STM32F4 Discovery 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.
Now that you have the ST-LINK/V2 driver installed, you can start configuring, building, and uploading SDVOS for the STM32F4 Discovery board.
When you configure an SDVOS instance for the STM32F4 Discovery board, you need to specify the BOARD attribute in the OS object to STM32F4DISCOVERY. 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 = STM32F4DISCOVERY;
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 STM32F4 Discovery board, the upload command is defined in src/board/STM32F4DISCOVERY/config.mk:
UPLOAD_COMMAND = st-flash write $(BIN) 0x8000000
$(BIN) will be replaced by sdvos.bin after you build the kernel.