Hellow Everyone
I have been trying reach out to you. I have used FreeRTOS (plus trace ) component from MCUonEclipse components as per the Instruction, i have followed step wise step :
> Imported Components
> added freeRTOS (followed instruction https://mcuoneclipse.com/2018/07/18/using-custom-freertos-with-s32k-and-osif-for-arm/comment-page-1/...
> Added preprocessor USING_OS_FREERTOS
> Compiled Successfully
after that when i was trying to debug my application. It got stuck in port.c as below :
#if( configASSERT_DEFINED == 1 )
void vPortValidateInterruptPriority( void )
{
uint32_t ulCurrentInterrupt;
uint8_t ucCurrentPriority;
/* Obtain the number of the currently executing interrupt. */
#if configCOMPILER==configCOMPILER_ARM_KEIL
ulCurrentInterrupt = vPortGetIPSR();
#else
__asm volatile( "mrs %0, ipsr" : "=r"( ulCurrentInterrupt ) );
#endif
/* Is the interrupt number a user defined interrupt? */
if( ulCurrentInterrupt >= portFIRST_USER_INTERRUPT_NUMBER )
{
/* Look up the interrupt's priority. */
ucCurrentPriority = pcInterruptPriorityRegisters[ ulCurrentInterrupt ];
/* The following assertion will fail if a service routine (ISR) for
an interrupt that has been assigned a priority above
configMAX_SYSCALL_INTERRUPT_PRIORITY calls an ISR safe FreeRTOS API
function. ISR safe FreeRTOS API functions must *only* be called
from interrupts that have been assigned a priority at or below
configMAX_SYSCALL_INTERRUPT_PRIORITY.
Numerically low interrupt priority numbers represent logically high
interrupt priorities, therefore the priority of the interrupt must
be set to a value equal to or numerically *higher* than
configMAX_SYSCALL_INTERRUPT_PRIORITY.
Interrupts that use the FreeRTOS API must not be left at their
default priority of zero as that is the highest possible priority,
which is guaranteed to be above configMAX_SYSCALL_INTERRUPT_PRIORITY,
and therefore also guaranteed to be invalid.
FreeRTOS maintains separate thread and ISR API functions to ensure
interrupt entry is as fast and simple as possible.
The following links provide detailed information:
http://www.freertos.org/RTOS-Cortex-M3-M4.html
http://www.freertos.org/FAQHelp.html */
configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );
}
/* Priority grouping: The interrupt controller (NVIC) allows the bits
that define each interrupt's priority to be split between bits that
define the interrupt's pre-emption priority bits and bits that define
the interrupt's sub-priority. For simplicity all bits must be defined
to be pre-emption priority bits. The following assertion will fail if
this is not the case (if some bits represent a sub-priority).
If the application only uses CMSIS libraries for interrupt
configuration then the correct setting can be achieved on all Cortex-M
devices by calling NVIC_SetPriorityGrouping( 0 ); before starting the
scheduler. Note however that some vendor specific peripheral libraries
assume a non-zero priority group setting, in which cases using a value
of zero will result in unpredicable behaviour. */
configASSERT( ( portAIRCR_REG & portPRIORITY_GROUP_MASK ) <= ulMaxPRIGROUPValue );
}
#endif /* configASSERT_DEFINED */
> It reaches here [port.c] where my SPI pal component try to execute complete transfer API in which it uses os interface OSIF_freertos.c for function like :
status_t OSIF_SemaPost(semaphore_t * const pSem)
{
DEV_ASSERT(pSem);
BaseType_t operation_status = pdFAIL;
status_t osif_ret_code;
SemaphoreHandle_t sem_handle = SEM_HANDLE(*pSem);
/* Check if the post operation is executed from ISR context */
bool is_isr = osif_IsIsrContext();
if (is_isr)
{
/* Execution from exception handler (ISR) */
BaseType_t taskWoken = pdFALSE;
operation_status = xSemaphoreGiveFromISR(sem_handle, &taskWoken);
if (operation_status == pdPASS)
{
/* Perform a context switch if necessary */
portYIELD_FROM_ISR(taskWoken);
}
}
else
{
/* Execution from task */
operation_status = xSemaphoreGive(sem_handle);
}
/* pdFAIL in case that the semaphore is full */
osif_ret_code = (operation_status == pdPASS) ? STATUS_SUCCESS : STATUS_ERROR;
return osif_ret_code;
}
>> this function calls out xSemaphoreGiveFromISR(sem_handle, &taskWoken);
>> it leads to vPortValidateInterruptPriority() >> then stuck in Assert configASSERT( ucCurrentPriority >= ucMaxSysCallPriority );
Am i missing something ? or i need to cofigure something that i missed considering that my few processor expert components are using osif_freeRTOS.c source file. I hope u understand my problem.
Thanks And Regards