S32K144 FreeRTOS from ISR API issue

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

S32K144 FreeRTOS from ISR API issue

1,204 Views
SABARINATH_kh
Contributor I

 

I was trying to set an event from UART recieve ISR call back function using FreeRTOS API "xEventGroupSetBitsFromISR()",
but the code execution got halted in "configASSERT( ucCurrentPriority >= ucMaxSysCallPriority )" of function - void vPortValidateInterruptPriority( void ) [port.c].

During debugging, it was observed that the priority of the calling interrupt was set to '0', as determined by executing the line:
"ucCurrentPriority = pcInterruptPriorityRegisters[ ulCurrentInterrupt ]"

so eventully the execution is stuck in this assert statement ("configASSERT( ucCurrentPriority >= ucMaxSysCallPriority )").

Also tried in existing FreeRTOS example code from s32 SDK, still execution halted in same assert statement

Is there any way to fix this

SABARINATH_kh_1-1753359208124.png

 

 

0 Kudos
Reply
7 Replies

1,130 Views
SABARINATH_kh
Contributor I

Hi  PetrS,

Sorry for the delay in responding
I have modified the code by changing the interrupt Priority using above mentioned API "INT_SYS_SetPriority"

Still its getting Priority value as "Zero"

SABARINATH_kh_2-1753686742839.png

 



 

 

0 Kudos
Reply

1,110 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

can you share simplified project showing an issue?

BR, Petr

0 Kudos
Reply

1,077 Views
SABARINATH_kh
Contributor I
Hi,
 
I am facing this issue in all the freeRTOS codes which uses "FromISR" API, even i tried with the samples provided by S32Design studio.
 
Currently i am trying the sample "freertos_s32k144" in this particular example, from a button ISR handler there is  freeRTOS function call "xTimerResetFromISR( xButtonLEDTimer, &xHigherPriorityTaskWoken ); , Even this function call end up in the same configASSERT.
 
I have attached the call stack and the sample code for your reference.
 
SABARINATH_kh_0-1753769977989.png

 

 
 
0 Kudos
Reply

1,000 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

I tested your project and it works normally.

BR, Petr

0 Kudos
Reply

992 Views
SABARINATH_kh
Contributor I

HI,
Did you tried pressing the button (then it will call fromISR API) if so, can you please help me what causing issue in my development board

0 Kudos
Reply

973 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

yes, on my S32k144EVB-Q100 (revC1) it toggles Green LED repeatedly.
Once pressing SW3, Red LED will be ON and is going OFF after 5sec unless SW3 is press again. So exactly as example is written.
To be honest, don't know why same SW is not working on your board, assume same one.

BR, Petr

0 Kudos
Reply

1,177 Views
PetrS
NXP TechSupport
NXP TechSupport

Hi,

as description outlined, for LPUART assign lower ISR priority (numerically higher number) then configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY is.

In SDK interrupt priority can be changed just by calling INT_SYS_SetPriority in your source code, otherwise the SDK will use default priorities of the hardware.

BR, Petr

0 Kudos
Reply
%3CLINGO-SUB%20id%3D%22lingo-sub-2140167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3ES32K144%20FreeRTOS%20from%20ISR%20API%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2140167%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CBR%20%2F%3E%3CP%3EI%20was%20trying%20to%20set%20an%20event%20from%20UART%20recieve%20ISR%20call%20back%20function%20using%20FreeRTOS%20API%20%22xEventGroupSetBitsFromISR()%22%2C%3CBR%20%2F%3Ebut%20the%20code%20execution%20got%20halted%20in%20%22configASSERT(%20ucCurrentPriority%20%26gt%3B%3D%20ucMaxSysCallPriority%20)%22%20of%20function%20-%20void%20vPortValidateInterruptPriority(%20void%20)%20%5Bport.c%5D.%3C%2FP%3E%3CP%3EDuring%20debugging%2C%20it%20was%20observed%20that%20the%20priority%20of%20the%20calling%20interrupt%20was%20set%20to%20'0'%2C%20as%20determined%20by%20executing%20the%20line%3A%3CBR%20%2F%3E%22ucCurrentPriority%20%3D%20pcInterruptPriorityRegisters%5B%20ulCurrentInterrupt%20%5D%22%3C%2FP%3E%3CP%3Eso%20eventully%20the%20execution%20is%20stuck%20in%20this%20assert%20statement%20(%22configASSERT(%20ucCurrentPriority%20%26gt%3B%3D%20ucMaxSysCallPriority%20)%22).%3C%2FP%3E%3CP%3EAlso%20tried%20in%20existing%20FreeRTOS%20example%20code%20from%20s32%20SDK%2C%20still%20execution%20halted%20in%20same%20assert%20statement%3C%2FP%3E%3CP%3EIs%20there%20any%20way%20to%20fix%20this%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SABARINATH_kh_1-1753359208124.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22SABARINATH_kh_1-1753359208124.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F349325iE94D758074AFF65C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22SABARINATH_kh_1-1753359208124.png%22%20alt%3D%22SABARINATH_kh_1-1753359208124.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2145186%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K144%20FreeRTOS%20from%20ISR%20API%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2145186%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Eyes%2C%20on%20my%20S32k144EVB-Q100%20(revC1)%20it%20toggles%20Green%20LED%20repeatedly.%20%3CBR%20%2F%3EOnce%20pressing%20SW3%2C%20Red%20LED%20will%20be%20ON%20and%20is%20going%20OFF%20after%205sec%20unless%20SW3%20is%20press%20again.%20So%20exactly%20as%20example%20is%20written.%3CBR%20%2F%3ETo%20be%20honest%2C%20don't%20know%20why%20same%20SW%20is%20not%20working%20on%20your%20board%2C%20assume%20same%20one.%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2144545%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K144%20FreeRTOS%20from%20ISR%20API%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2144545%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHI%2C%3CBR%20%2F%3EDid%20you%20tried%20pressing%20the%20button%20(then%20it%20will%20call%20fromISR%20API)%20if%20so%2C%20can%20you%20please%20help%20me%20what%20causing%20issue%20in%20my%20development%20board%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2144267%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K144%20FreeRTOS%20from%20ISR%20API%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2144267%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3EI%20tested%20your%20project%20and%20it%20works%20normally.%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2142302%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K144%20FreeRTOS%20from%20ISR%20API%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2142302%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CDIV%3E%3CSPAN%3EHi%2C%3C%2FSPAN%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EI%20am%20facing%20this%20issue%20in%20all%20the%20freeRTOS%20codes%20which%20uses%20%22FromISR%22%20API%2C%20even%20i%20tried%20with%20the%20samples%20provided%20by%20S32Design%20studio.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3ECurrently%20i%20am%20trying%20the%20sample%20%22freertos_s32k144%22%20in%20this%20particular%20example%2C%20from%20a%20button%20ISR%20handler%20there%20is%26nbsp%3B%20freeRTOS%20function%20call%20%22%3CSTRONG%3ExTimerResetFromISR(%20xButtonLEDTimer%2C%20%26amp%3BxHigherPriorityTaskWoken%20)%3B%3C%2FSTRONG%3E%20%2C%20Even%20this%20function%20call%20end%20up%20in%20the%20same%20configASSERT.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3EI%20have%20attached%20the%20call%20stack%20and%20the%20sample%20code%20for%20your%20reference.%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SABARINATH_kh_0-1753769977989.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22SABARINATH_kh_0-1753769977989.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F349888iD84F793D807A56F0%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22SABARINATH_kh_0-1753769977989.png%22%20alt%3D%22SABARINATH_kh_0-1753769977989.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3CBR%20%2F%3E%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3CDIV%3E%26nbsp%3B%3C%2FDIV%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2141788%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K144%20FreeRTOS%20from%20ISR%20API%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2141788%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Ecan%20you%20share%20simplified%20project%20showing%20an%20issue%3F%3C%2FP%3E%0A%3CP%3EBR%2C%20Petr%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2141500%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K144%20FreeRTOS%20from%20ISR%20API%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2141500%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%26nbsp%3B%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3CA%20href%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F52961%22%20target%3D%22_self%22%3E%3CSPAN%20class%3D%22%22%3EPetrS%3C%2FSPAN%3E%3C%2FA%3E%2C%3C%2FP%3E%3CP%3ESorry%20for%20the%20delay%20in%20responding%3CBR%20%2F%3EI%20have%20modified%20the%20code%20by%20changing%20the%20interrupt%20Priority%20using%20above%20mentioned%20API%20%22%3CSPAN%3EINT_SYS_SetPriority%3C%2FSPAN%3E%22%3CBR%20%2F%3E%3CBR%20%2F%3EStill%20its%20getting%20Priority%20value%20as%20%22Zero%22%3C%2FP%3E%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20image-alt%3D%22SABARINATH_kh_2-1753686742839.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cspan%20class%3D%22lia-inline-image-display-wrapper%22%20image-alt%3D%22SABARINATH_kh_2-1753686742839.png%22%20style%3D%22width%3A%20400px%3B%22%3E%3Cimg%20src%3D%22https%3A%2F%2Fcommunity.nxp.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F349687iB60CAE9866537E4C%2Fimage-size%2Fmedium%3Fv%3Dv2%26amp%3Bpx%3D400%22%20role%3D%22button%22%20title%3D%22SABARINATH_kh_2-1753686742839.png%22%20alt%3D%22SABARINATH_kh_2-1753686742839.png%22%20%2F%3E%3C%2Fspan%3E%3C%2FSPAN%3E%3C%2FP%3E%3CBR%20%2F%3E%3CP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FP%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2140559%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%20translate%3D%22no%22%3ERe%3A%20S32K144%20FreeRTOS%20from%20ISR%20API%20issue%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2140559%22%20slang%3D%22en-US%22%20mode%3D%22CREATE%22%3E%3CP%3EHi%2C%3C%2FP%3E%0A%3CP%3Eas%20description%20outlined%2C%20for%20LPUART%20assign%20lower%20ISR%20priority%20(numerically%20higher%20number)%20then%26nbsp%3B%3CSPAN%3EconfigLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY%3C%2FSPAN%3E%20is.%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIn%20SDK%20interrupt%20priority%20can%20be%20changed%20just%20by%20calling%26nbsp%3BINT_SYS_SetPriority%20in%20your%20source%20code%2C%20otherwise%20the%20SDK%20will%20use%20default%20priorities%20of%20the%20hardware.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EBR%2C%20Petr%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E