Integration issue when adding McuOnEclipse FreeRTOS component

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

Integration issue when adding McuOnEclipse FreeRTOS component

923 Views
ahmedhrabi
Contributor III

Hello everyone, 

I'am triying to create a processor expert project with sdk1.3, MK60DN512VLL10 Micro-proc in a custom board. I need to add the mcuoneclipse freeRTOS component to my project and i was following this tutorial : 

https://mcuoneclipse.com/2015/07/08/tutorial-using-processor-expert-and-freertos-with-kinetis-sdk-v1... 

I added the component in the components library, but when i add the freeRTOS to the project this error occured  :

Capture.PNG 

The compiler have no suggestions even when i changed the Cross ARM C compiler Preprocessor to: “FSL_RTOS_FREE_RTOS”. 

Have anyone any idea about this ? 

Thanks. 

0 Kudos
3 Replies

504 Views
VIsh22101994
Contributor I

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

 

 

 

0 Kudos

667 Views
BlackNight
NXP Employee
NXP Employee

Hi Ahmed,

Not sure what is causing this. But it seems to me that the component is looking for the the enumeration type listing all supported compilers and cannot find it.

I tried to reproduce it on my side and was not able to see your problem.

1. Are you already using the latest version from SourceForge (McuOnEclipse - Browse /PEx Components at SourceForge.net )? If not, load these components as they are the latest and greatest.

2. I recommend to use the 'classic' no-tabs view, see https://mcuoneclipse.com/2014/06/20/switching-between-tabs-and-no-tabs-ui-in-processor-expert/ . Maybe this is causing a problem on your side?

3. Changing the Preprocessor define won't help, as this is affecting the compiler only. I have seen cases where Processor Expert somehow is stuck. Closing the project and re-opening helps to solve that.

4. Make sure you use the component from the correct repository if have multiple repositories installed. See https://mcuoneclipse.com/2015/07/06/processor-expert-component-repositories/ 

I hope this helps. Otherwise it would be helpful if you could post your project.

Erich

667 Views
isaacavila
NXP Employee
NXP Employee

Hello,

I do not know what could be causing this issue but I'd like to share this useful document that explains how to create a new FreeRTOS project in KSDK v2.0. I hope you can find it useful too.

https://community.nxp.com/docs/DOC-330183 

Have a nice day!

Regards,

Isaac

0 Kudos