Templates_Board Example Description

This project provides a reference template for the NUCLEO-C071RB board based on the STM32Cube HAL API and the BSP drivers that can be used to build any firmware application.

It was created from STM32CubeMX using the ‘Start My project from ST board’ feature.

This template shows how to use the BSP drivers for the leds, user push-button and VCP COM port of the NUCLEO-C071RB board thanks to BSP resources initialization and demonstration codes:

At the beginning of the main program, the HAL_Init() function is called to initialize the systick used as 1ms HAL timebase.

The SystemClock_Config() function is used to configure the system clock (SYSCLK) to run at 48 Mhz.

Notes

  1. Care must be taken when using HAL_Delay(), this function provides accurate delay (in milliseconds) based on variable incremented in SysTick ISR. This implies that if HAL_Delay() is called from a peripheral ISR process, then the SysTick interrupt must have higher priority (numerically lower) than the peripheral interrupt. Otherwise the caller ISR process will be blocked. To change the SysTick interrupt priority you have to use HAL_NVIC_SetPriority() function.

  2. The application needs to ensure that the SysTick time base is always set to 1 millisecond to have correct HAL operation.

Keywords

Reference, Template, Start, Board, BSP

Directory contents

File Description
Templates_Board/Inc/main.h Header for main.c module
Templates_Board/Inc/stm32c0xx_hal_conf.h HAL Configuration file
Templates_Board/Inc/stm32c0xx_it.h Interrupt handlers header file
Templates_Board/Inc/stm32c0xx_nucleo_conf.h BSP Configuration file
Templates_Board/Src/main.c Main program
Templates_Board/Src/stm32c0xx_hal_msp.c HAL MSP module
Templates_Board/Src/stm32c0xx_it.c Interrupt handlers
Templates_Board/Src/system_stm32c0xx.c STM32C0xx system source file

Hardware and Software environment

How to use it ?

In order to make the program work, you must do the following :