cancel
Showing results for 
Search instead for 
Did you mean: 

BUG: STM32G474RE Assert issue when TIM17 is configurated as Timebase source

OGhis
Senior

With CubeMx 5.3.0 and library version 1.1.0 for the stm32G474RE was the Timebase Source in system (SYS) configured for TIM17

On running the application is the "assert_failed()" executed.

This assert was called from the 'HAL_NVIC_SetPriority() function.

assert_param(IS_NVIC_PREEMPTION_PRIORITY(PreemptPriority));

The PreemptPriority has a value of 0x10 => initialized by __NVIC_PRIO_BITS.

But the "IS_NVIC_PREEMPTION_PRIORITY" macro tell us that the value should be lower than 0x10.

#define IS_NVIC_PREEMPTION_PRIORITY(PRIORITY)  ((PRIORITY) < 0x10U)

What is wrong here the the "IS_NVIC_PREEMPTION_PRIORITY" or the "__NVIC_PRIO_BITS" value

13 REPLIES 13
Amel NASRI
ST Employee

Hello @OGhis​ ,

Please share your .ioc file in order to reproduce the issue you are facing.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

OPoch
Associate

Hello!

I have the same problem for Timebase Source TIM7.

.ioc file below.

Amel NASRI
ST Employee

Hello @OGhis​ and @OPoch​ ,

I reported this bug internally. There is the same problem with STM32Cube examples where HAL_InitTick is redefined to configure a timer as a time base source.

Thanks for highlighting it for us.

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

MMitc
Associate II

@Amel NASRI​  I am seeing this using TIM1 with FreeRTOS, STMCube Version: 1.1.0 Build: 4551_20191014-1140 (UTC)

Has the correction been released yet?

If not, meanwhile, should I change the priority or remove the assert?

Panometric
Associate III

@Amel can we get an update on this? Is it still an unresolved bug after 4 months?

Mathieu Massicotte
Associate II

Same problem here ...

OGhis
Senior

See follow link where the issue is produced in the source code:

https://community.st.com/s/question/0D50X0000C6duToSQI/halnvicsetpriority-assert-issue-and-incorrect-preempt-priority-value-for-the-stm32f4-stm32g4-

Please don't remove the assert, otherwise is the priority incorrect configured

Hello @Panometric​ ,

The fix is already deployed internally, but web release of the package may take some time.

You can anticipate changes reporting issues in Github also (https://github.com/STMicroelectronics/STM32CubeG4).

-Amel

To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.

OGhis
Senior

Not yet resolved in hal lib 1.2.0