cancel
Showing results for 
Search instead for 
Did you mean: 

Cannot change USART1 interrupt priority in CubeMX

Alex Farber
Associate III
Posted on March 13, 2017 at 07:27

In CubeMX 4.19.0 I have USART1 Asynchronous and FREERTOS enabled. USART1 global interrupt is enabled. In NVIC configuration dialog I have:

USART1 global interrupt: On, Preemption priority 5, Sub priority 0, Uses FREERTOS functions On.

Actually, in my program USART1 interrupt handler doesn't use FREERTOS  functions. I want to change the interrupt priority. So, I change it by the following way:

USART1 global interrupt: On, Preemption priority 3, Sub priority 0, Uses FREERTOS functions Off.

Save the project, exit and open it again. USART1 and NVIC are signed with red. When I open NVIC, the following message is shown:

Preemption priority of interrupts should be >=5 if their handlers call system functions. See FREERTOS_LIBRARY_MAX_SYSCALL_INTERRUPT parameter.

When NVIC is opened, I see the following parameters:

USART1 global interrupt: On, Preemption priority 3, Sub priority 0, Uses FREERTOS functions On.

So, CubeMX keeps incorrect value of 'Uses FREERTOS functions', and in this case priority 3 is not allowed. Is this bug in CubeMX? Is there any way to save this priority value without CubeMX warning?

#usart1 #freertos #cube-mx #interrups
5 REPLIES 5
Imen.D
ST Employee
Posted on March 14, 2017 at 11:57

Hello,

Please update your CubeMx version to 4.20 then check if you have same behavior with the new version.

Could you please attach your .ioc file to check your case.

Thanks

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Alex Farber
Associate III
Posted on March 15, 2017 at 13:12

The original post was too long to process during our migration. Please click on the provided URL to read the original post. https://st--c.eu10.content.force.com/sfc/dist/version/download/?oid=00Db0000000YtG6&ids=0680X000006I6pR&d=%2Fa%2F0X0000000bwL%2FYqIYTgFW5rdPKIBzCDiMz4uSo8mqq7XfWYD_ClO8ly8&asPdf=false
Posted on March 15, 2017 at 13:11

Hello Imen.

Reproduced with CubeMX 4.20.0. Steps to reproduce:

1. Create CubeMX project for STM32468I-EVAL.

2. Pinout.

USART1 - Asynchronous.

SYS - Timebase source TIM1.

FREERTOS - Enabled.

3. Configuration.

USART1, NVIC settings. Global interrupt enabled.

NVIC. USART1 Global interrupt. By default it is filled:

   Enabled  Priority 5  Sub priority 0  Uses FREERTOS functions On

Uncheck Uses FREERTOS functions. Priority is automatically changed to 0.

Press OK, save project, exit.

Open project again.

Configuration, NVIC. USART1 Global interrupt is still:

   Enabled  Priority 5  Sub priority 0  Uses FREERTOS functions On

I don't see Attach function here, CubeMX project content will be sent as plain text.

Posted on March 16, 2017 at 10:49

Hi Alex Farber,

Your issue is reported internally for further investigation.

Regards

Imen

When your question is answered, please close this topic by clicking "Accept as Solution".
Thanks
Imen
Jeanne Joly
Senior III
Posted on January 16, 2018 at 09:57

Hi

Farber.Alex

,

I was trying to reproduce the issue you highlighted on top of CubeMX4.23 (the lastest one) and the reload of the project is correct (with the parameters previously saved : NVIC/USART1 global interrupt with preemption priority set to 0 as unticked box 'uses FreeRTOS functions' ).

Please, update your CubeMX release and tell me if you still have the issue.

BR. Jeanne