Showing results for 
Search instead for 
Did you mean: 

RTOS demo for STM32F4-Discovery

Posted on November 27, 2011 at 11:32


Starting from version 2.3.4 ChibiOS/RT includes full support for the STM32F4 and a full demo for the STM32F4-Discovery board.

The demo guide is available here:

The application demonstrates the use of the following components:
  • Cortex-M4 startup support.
  • Linker scripts for STM32F4.

  • STM32F4-Discovery specific board files.

  • RTOS kernel for multi-threading and synchronization.

  • HAL driver for the STM32F4 platform initialization (clock tree).

  • PAL driver (I/O ports abstraction).

  • DMA driver (shared DMA abstractor helper driver).

  • ADC driver in DMA mode.

  • SPI driver in DMA mode.

  • PWM driver.

  • Interrupt driven serial driver.

  • Test Suite for self test and reporting.

  • Build files for GCC, IAR and Keil compilers.
Similar demos are also available for the STM8S-Discovery, STM8L-Discovery, STM32VL-Discovery and STM32L-Discovery.

The STM32F4 is pretty impressive, for example the context switch benchmark resulted in a 390nS context switch time. More benchmark results are available here:



Posted on November 30, 2011 at 18:19

Almost ''full support''. The F4 has 24 external ADC channels. The ChibiOS/RT file adclld.h covers only up to Channel_IN15. Other code and documentation may have also not been updated. See my post in the STM32 Forum dated Oct 18 for STM's response regarding updating their documentation.

Cheers, Hal

Posted on November 30, 2011 at 19:57

Hi Hal,

I'll add the definitions after the documentation update but I think that it does not really support 24 channels because the ADC block only has 2 SMPR registers which allow for 20 channels max (and there are no ''holes'' in the registers map). This is why it is not implemented in the F4 ADC driver.

The STM32L, which supports 24 channels, has 3 SMPR registers and its ADC driver supports them.

Or the information about the 24 channels is wrong or somebody forgot to include a register in the design 🙂