You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
..
Core
qpc
.cproject
.mxproject
.project
README.md
STM32C031C6TX_FLASH.ld
project Release.launch
project.ioc
real-time_trace.png
stm32-nucleo-64_conn.png
stm32-nucleo-c031c6.webp

README.md

NOTE You must generate the code from the project.ioc file before building the application. If you forget to do this, the following errors will be reported:

fatal error: stm32c0xx_hal.h: No such file or directory 30 | #include "stm32c0xx_hal.h" . . .

Real-Time Example on NUCLEO-C031C6

This example implements the "Periodic-Sporadic" application on the STM32 NUCLEO-C031C6 board (ARM Cortex-M0+). The example demonstrates various real-time preemption scenarios among active objects in the QV kernel. The example requires a logic analyzer.


STM32 NUCLEO-C031C6


Logic analyzer trace after pressing the button (QV kernel)

Code Organization

stm32c031-cube
|   .project       // STM32CubeMX project
|   project.ioc    // STM32CubeMX config (for code generation)
|
+---Core           // core application generated by STM32CubeMX
|   +---Inc        // include files
|   +---Src        // source files
|   |       . . .
|   |       real-time.qm // QM model file for the application
|   +---Startup
|
+---qpc            // QP/C real-time event framework
|   +---include
|   +---src
|   |   +---qf
|   |   +---qv
|   +---ports
|   |   +---arm-cm
|   |   |   +---qv
|   |   |   |   +---gnu
|   |       . . .

Features Demonstrated

The example QP application consists of 2 periodic tasks (Active Objects) and two sporadic, long-running tasks (Active Objects).

Running the Examples

Setting up a Logic Analyzer

The NUCLEO-C031C6 needs to be conntected to a logic analyzer as shown in the picture below.


Connecting STM32 NUCLEO-C031C6 to a logic analyzer

The logic analyzer needs to be configured as follows:

  • sampling rate: several MHz (e.g., 24MHz)
  • trigger: Sporadic (PC.13 on the NUCLEO-C031C6), falling edge
  • pre-trigger capture ratio: 10%