This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

FreeRTOS port file question

We are running FreeRTOS on the PCA10028 development board. We have bumped into an issue where the code asserts if we turn on the FreeRTOS configASSERT functionality. It is asserting when the scheduler is turned on. The relevant code is:

BaseType_t xPortStartScheduler( void ) {
/* This port can be used on all revisions of the Cortex-M7 core other than
the r0p1 parts.  r0p1 parts should use the port from the
/source/portable/GCC/ARM_CM7/r0p1 directory. */
configASSERT( SCB->CPUID != portCORTEX_M0_r0p0_ID );

Since this is a portCORTEX_M0_r0P0_ID processor we trigger. The comment indicates this code was intended for an M7 rather than an M0. Are we using the wrong port file, or is the assert invalid?

Parents
  • The assert looks wrong to me, it also looks wrong in the nrf52 version where it compares against both r0p0 and r0p1 and asserts either way, eg how the heck could this code work in the nrf52 version (those two ids are definitely different)

    configASSERT( SCB->CPUID != portCORTEX_M7_r0p1_ID );
    configASSERT( SCB->CPUID != portCORTEX_M7_r0p0_ID );
    

    It looks at first sight as though the wrong assert was used for M7 and then copied back to the M0 version. There isn't even a r0p1 for M0.

    I downloaded some bits of FreeRTOS and took a look, there's one port for M0, M7 uses the M4F port unless it's r0p1 in which case there's a specific M7 port. Looking at the files in the SDK 10 directory they all (nrf51 and nrf52) appear to be derived from the M4F port (look in the comments at the top) which is fairly odd as I think the M7 on the nRF52 is an r0p1 so it has its own version and M0 has its own version which doesn't need a check.

    Not entirely sure what to suggest here. The check can't be right, I'd file a case on My Page and see if you can get whoever put this together to help you. I don't know what it was even based on, there's no CMSIS in the FreeRTOS supported source so I can't tell if this version was abstracted from a Keil copy/paste job version or direct from FreeRTOS. The FreeRTOS supported code doesn't even check.

    I need to get into this RTOS stuff, I really think with the more powerful chips, it's a better way to write.

  • Thank you for the feedback, I will try to handle it before the nearest release. Small correction: NRF52 has M4F core. Not M7.


    Note: Code for nrf52 can work because ASSERTION fails when expression result is FALSE. So if fails when the port would be used with any M7 processor.

Reply Children
No Data
Related