Skip to main content
OGhis
Senior
Sep 1, 2019 6:16 PM UTC
Question

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

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

This topic has been closed for replies.

13 replies

Amel NASRI
ST Technical Moderator
Oct 9, 2019 9:28 AM UTC

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 "Best Answer" on the reply which solved your issue or answered your question.
OPoch
Associate
Oct 11, 2019 6:52 AM UTC

Hello!

I have the same problem for Timebase Source TIM7.

.ioc file below.

Amel NASRI
ST Technical Moderator
Oct 18, 2019 4:15 PM UTC

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 "Best Answer" on the reply which solved your issue or answered your question.
MMitc
Associate III
Dec 6, 2019 1:20 AM UTC

@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
Feb 2, 2020 7:58 PM UTC

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

Amel NASRI
ST Technical Moderator
Feb 11, 2020 9:36 AM UTC

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 "Best Answer" on the reply which solved your issue or answered your question.
Mathieu Massicotte
Visitor II
Feb 4, 2020 6:56 PM UTC

Same problem here ...

OGhis
OGhisAuthor
Senior
Feb 10, 2020 8:30 PM UTC

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

OGhis
OGhisAuthor
Senior
Mar 2, 2020 7:37 PM UTC

Not yet resolved in hal lib 1.2.0

Ede S
Associate II
Mar 26, 2020 10:37 AM UTC

Hello, same problem here with FW_F4_V1.25.0 (latest release for STM32F4).