Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Emcraft provides a FreeRTOS BSP specifically ported, optimized and otherwise enhanced for the STM32H750 system-on-module. The FreeRTOS BSP is based on FreeRTOS V10.3.1. This version of FreeRTOS is available for download from the following location: https://github.com/FreeRTOS/FreeRTOS/tree/V10.3.1 . FreeRTOS source files are located in the following sub-tree: Middlewares/Third_Party/FreeRTOS.

1.2. STM32Cube HAL

The integral part of the FreeRTOS BSP is the ST's STM32CubeH7 software, which is integrated (linked together) with the FreeRTOS BSP build. STM32CubeH7 provides a HAL (Hardware Abstraction Layer) as well as device drivers and software APIs for various I/O interfaces of the STM32H7.

In the FreeRTOS source tree, the STM32CubeH7 HAL component resides in the following sub-tree: Drivers/STM32H7xx_HAL_Driver.

2. FreeRTOS Demo Application

...

In the FreeRTOS source tree, the FreeRTOS demo application resides in the following sub-tree: Projects/STM32H7_SOM/Applications/FreeRTOS/freertos_stm32h750.

2.2. FreeRTOS Demo App Tasks

...

Thread

Location in Source Tree

Comments

Main Thread

freertos_stm32h750/Src/main.c, vCommandConsoleTask()

Main FreeRTOS thread, which starts the other threads, and then runs the FreeRTOS CLI (Command Line Interface) on the serial console

WDT Thread

freertos_stm32h750/Src/wdt_test.c, wdt_task()

Strobes the WDT

LED Thread

freertos_stm32h750/Src/gpio_test.c, gpio_test_led()

Blinks the on-module and on-carrier LEDs

Push-Buttons Thread

freertos_stm32h750/Src/gpio_test.c, gpio_test_buttons()

Monitors the on-carrier user buttons; when a button has been pressed or released, reports the push-button state change

Timer Thread

freertos_stm32h750/Src/tim_test.c, tim_task()

Counting number of Timer interrupts

GUI Thread

freertos_stm32h750/Src/gui.c, gui_ts_main()

Implements a GUI interface on the LCD display, with touch screen, using the UI stack

WiFi Thread

freertos_stm32h750/Src/wifiesp_click_test.c, wifiesp_task()

Implements a sample TCP server utilizing the WiFi ESP Click board, using the WiFi ESP Click driver

...

The U-Boot loader makes use of the bootcmd environment variable to automatically execute commands during startup. The default value of bootcmd is implemented in such a way that the FreeRTOS application image is loaded from QSPIFlash and started by calling the FreeRTOS app entry point.

...

The default configuration of the FreeRTOS BSP is to run from external SDRAM of the STM32H7 module. To achieve that, the FreeRTOS BSP must be be linked using the freertos_stm32h750_sdram.ld script.

In this configuration, the FreeRTOS BSP makes use of external SDRAM, as follows:

...

Section

Description

Location and Size

.text

FreeRTOS code

SDRAM, size is defined by a specific FreeRTOS application

.rodata

FreeRTOS read-only data

SDRAM, size is defined by a specific FreeRTOS application

.data

FreeRTOS initialized read-write data

SDRAM, size is defined by a specific FreeRTOS application

.bss

FreeRTOS non-initialized read-write data

SDRAM, size is defined by a specific FreeRTOS application

Stack

FreeRTOS stack

DTCMRAM, size is 0x400, grows upwards

Task Stack

FreeRTOS task stack

SDRAM, size is defined by a specific FreeRTOS application

Heap

FreeRTOS heap

SDRAM, size is defined at build time as configTOTAL_HEAP_SIZE

UBIFS ABI table

Table of UBI/UBIFS ABI entry points provided by U-Boot for RTOS

ICTM, 0x00000000, 1KB

4.2. Running FreeRTOS BSP from Internal SRAM

Another supported option is to run the FreeRTOS BSP out of internal SRAM. In this option, the FreeRTOS BSP and demo application make use of the internal SRAM of the STM32H7 to perform critical OS code and store OS data. The internal SRAM has L1-cache level performance, it is the fastest memory that is available on the STM32H750 System-on-Module. To achieve this option, the FreeRTOS BSP must be be linked using the freertos_stm32h750_sram.ld script.

The FreeRTOS BSP makes use of the following SRAM regions:

Code Block
DTCMRAM (xrw) : ORIGIN = 0x20000000, LENGTH = 128K

...


RAM_D1 (xrw) : ORIGIN = 0x24000000, LENGTH = 512K

Allocation of the logical FreeRTOS software sections in SRAM is as follows:

Section

Description

Location and Size

.text

FreeRTOS code

RAM_D1, size is defined by a specific FreeRTOS application

.rodata

FreeRTOS read-only data

RAM_D1, size is defined by a specific FreeRTOS application

.data

FreeRTOS initialized read-write data

DTCMRAM, size is defined by a specific FreeRTOS application

.bss

FreeRTOS non-initialized read-write data

RAM_D1, size is defined by a specific FreeRTOS application

Stack

FreeRTOS stack

DTCMRAM, size is 0x400, grows upwards

Task Stack

FreeRTOS task stack

RAM_D1, size is defined by a specific FreeRTOS application

Heap

FreeRTOS heap

RAM_D1, size is defined at build time as configTOTAL_HEAP_SIZE

UBIFS ABI table

Table of UBI/UBIFS ABI entry points provided by U-Boot for RTOS

ICTM, 0x00000000, 1KB

Additionally, the FreeRTOS BSP makes use of external SDRAM, as follows:

...

Command

Description

Comments

sdram_test <ptrn> <ptrn> <size>

Write a certain ptrn to a size region in SDRAM, starting at 4MB offset, validate that the read-back data matches the pattern written. Command completes silently, unless an error is detected.

...