STMicroelectronics / STM32CubeWB

Full Firmware Package for the STM32WB series: HAL+LL drivers, CMSIS, BSP, MW, plus a set of Projects (examples and demos) running on all boards provided by ST (Nucleo, Evaluation and Discovery Kits).
https://www.st.com/en/embedded-software/stm32cubewb.html
Other
217 stars 134 forks source link

Hardfault when using the sequencer with a number of priorities higher than 2 #94

Open TheAlbertDev opened 2 months ago

TheAlbertDev commented 2 months ago

Describe the set-up

Describe the bug When additional priorities are configured in the sequencer, the sequencer throws a hardfault.

/**
 * This is the list of priority required by the application
 * Each Id shall be in the range 0..31
 */
typedef enum
{
  CFG_SCH_PRIO_0,
  /* USER CODE BEGIN CFG_SCH_Prio_Id_t */
  CFG_SCH_PRIO_1,
  CFG_SCH_PRIO_2,
  CFG_SCH_PRIO_3,
  CFG_SCH_PRIO_4,
  /* USER CODE END CFG_SCH_Prio_Id_t */
} CFG_SCH_Prio_Id_t;

You can edit manually UTIL_SEQ_CONF_PRIO_NBR to the new number of priorities, but as soon as the project code is regenerated, UTIL_SEQ_CONF_PRIO_NBR is set to 2 again.

As stated in issues in another packages (https://github.com/STMicroelectronics/STM32CubeWL/issues/18), a solution could be to define UTIL_SEQ_CONF_PRIO_NBR as CFG_SEQ_Prio_NBR, and in the priorities section define:

{
  CFG_SCH_PRIO_0,
  /* USER CODE BEGIN CFG_SCH_Prio_Id_t */
  CFG_SCH_PRIO_1,
  CFG_SCH_PRIO_2,
  CFG_SCH_PRIO_3,
  CFG_SCH_PRIO_4,
  /* USER CODE END CFG_SCH_Prio_Id_t */
+ CFG_SEQ_Prio_NBR
} CFG_SCH_Prio_Id_t;
RJMSTM commented 2 months ago

ST Internal Reference: 184654