Freertos with smp for R5,portCHECK_IF_IN_ISR question

freertos with smp for R5(GIC), How to implement portCHECK_IF_IN_ISR,I want use GIC_RPR,but portYIELD is use SWI interrupt, is not a gic.

If not GIC, what are you using? Is it VIC? If so, would you be able to use VICRAWINTR?

SWI interrupt is armv7 internal interrupt,Do not pass through GIC.
like this:
#define portYIELD() __asm volatile ( “SWI 0” ::: “memory” );

But why do you need to check for SWI in portCHECK_IF_IN_ISR? SWI handler is provided by FreeRTOS and is not replaceable.

I’m not sure if I need check for SWI in portCHECK_IF_IN_ISR, I just thought SWI is a interrupts too, so I needed to judge in portCHECK_IS_IN_ISR.

The SWI handler might not be replaceable, but is augmentable with “trace” macros.

Admittedly, trace macros shouldn’t be doing something that needs to know if you are in an ISR as that implies getting to code that is doing very general things in a context with a lot of restrictions about what can be done.

Thank you for correcting. As you rightly said, for all practical purposes, portCHECK_IF_IN_ISR should be able to ignore SWI. @liu What is your use case?

SWI will be ignore when i use ‘GICC_RPR’ register to judge in interrupts or not. So this is correct, right?

Yes, that should be correct as long as you are not calling this macro in SWI Handler which can be the case if you were trying to call it from the implementation of traceTASK_SWITCHED_IN/OUT macros. That is why I asked your use case.

OK,thanks. when I running in smp mode, the master core while enter this assert, I have no idea for this problem.

configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) );

when the SMP function of R5 be ported?

SMP on R5 is not planned yet. We appreciate your input as these help us prioritize our work. Would you please let us know your use case for SMP.

Our chip has an R5 core, and we need to implement an SMP rtos demo ,I have modified these files, currently the spin lock is still a problem, often deadlock ,and will enter the assertion“configASSERT( !( ( xTaskGetSchedulerState() == taskSCHEDULER_SUSPENDED ) && ( xTicksToWait != 0 ) ) )” in the call “xQueueReceive”。

I solved the problem because of an error in judgment for “portCHECK_IF_IN_ISR”

Will be helpful for everyone if you can describe your solution. Thank you.

use “GICC_RPR” to judgment in isr or not.
uint32_t Check_IfInIsr(void)
{
uint32_t GccRPRState = 0;
GccRPRState = ((volatile uint32_t)(CPU_GIC_GICC_RPR)) & 0xFF;
return((GccRPRState == 0xFF) ? 0 : 1);
}

Thank you for taking time to report back.