This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AWR2944: freertos mpu support plan?

Part Number: AWR2944

Hi,

When do you plan to support Memory Protection Unit (MPU) function in FreeRTOS.

You can browser the mpu features of freertos introduction:  freertos.org/FreeRTOS-MPU-memory-protection-unit.html

FreeRTOS-MPU port can have two type of tasks:

    Privileged Tasks: A privileged task has access to the entire memory map. Privileged tasks can be created using either the xTaskCreate() or xTaskCreateRestricted() API function.

    Unprivileged Tasks: An unprivileged task only has access to its stack. In addition, it can be granted access up to three user definable memory regions (three per task). Unprivilged tasks can only be created using the xTaskCreateRestricted() API. Note that xTaskCreate() API must not be used to create an unprivileged task.

If a task wants to use the MPU then the following additional information has to be provided:

    The address of the task stack.
    The start, size and access parameters for up to three user definable memory regions.

Thanks.

Jeff

  • FreeRTOS-MPU port can have two type of tasks:

        Privileged Tasks: A privileged task has access to the entire memory map. Privileged tasks can be created using either the xTaskCreate() or xTaskCreateRestricted() API function.

        Unprivileged Tasks: An unprivileged task only has access to its stack. In addition, it can be granted access up to three user definable memory regions (three per task). Unprivilged tasks can only be created using the xTaskCreateRestricted() API. Note that xTaskCreate() API must not be used to create an unprivileged task.

    If a task wants to use the MPU then the following additional information has to be provided:

        The address of the task stack.
        The start, size and access parameters for up to three user definable memory regions.

  • Hi Jeff,

    I would request you to refer mmWave MCU Plus SDK 4.2 for AWR294x, where using syscfg MPU can be set.

    C:\ti\mmwave_mcuplus_sdk_04_02_00_03\mmwave_mcuplus_sdk_04_02_00_03\ti\demo\awr294x\mmw\mss\mss.syscfg

    C:\ti\mmwave_mcuplus_sdk_04_02_00_03\mmwave_mcuplus_sdk_04_02_00_03\ti\demo\awr294x\mmw\dss\dss.syscfg

    And here is FreeRTOS

    C:\ti\mmwave_mcuplus_sdk_04_02_00_03\mcu_plus_sdk_awr294x_08_02_00_25\source\kernel\freertos

    Install SDK from here

    https://www.ti.com/tool/MMWAVE-MCUPLUS-SDK

    https://www.ti.com/tool/download/MMWAVE-MCUPLUS-SDK/04.02.00.03

    Regards,

    Jitendra

  • Hi Jitendra,

    Thank you for your reply.

    The portASM.S codes as bellow don't do any MPU context save and switch, now it just config MPU basic function in mss.syscfg in initialization phase.

    I want to use FreeRTOS task MPU function( support xTaskCreateRestricted to create task) to do data protect between different tasks, access kernel data protect between user application and FreeRTOS kernel function.

    .macro portSAVE_CONTEXT
            /* Save the LR and SPSR onto the system mode stack before switching to
            system mode to save the remaining system mode registers. */
            SRSDB   sp!, #SYS_MODE
            CPS     #SYS_MODE
            PUSH    {R0-R12, R14}
    
            /* Push the critical nesting count. */
            LDR     R2, ulCriticalNestingConst
            LDR     R1, [R2]
            PUSH    {R1}
    
            /* Does the task have a floating point context that needs saving?  If
            ulPortTaskHasFPUContext is 0 then no. */
            LDR     R2, ulPortTaskHasFPUContextConst
            LDR     R3, [R2]
            CMP     R3, #0
    
            /* Save the floating point context, if any. */
            FMRXNE  R1,  FPSCR
            VPUSHNE {D0-D15}
            /* VPUSHNE      {D16-D31} */
            PUSHNE  {R1}
    
            /* Save ulPortTaskHasFPUContext itself. */
            PUSH    {R3}
    
            /* Save the stack pointer in the TCB. */
            LDR     R0, pxCurrentTCBConst
            LDR     R1, [R0]
            STR     SP, [R1]
    
            .endm
    
    .macro portRESTORE_CONTEXT
            /* Set the SP to point to the stack of the task being restored. */
            LDR     R0, pxCurrentTCBConst
            LDR     R1, [R0]
            LDR     SP, [R1]
    
            /* Is there a floating point context to restore?  If the restored
            ulPortTaskHasFPUContext is zero then no. */
            LDR     R0, ulPortTaskHasFPUContextConst
            POP     {R1}
            STR     R1, [R0]
            CMP     R1, #0
    
            /* Restore the floating point context, if any. */
            POPNE   {R0}
            /* VPOPNE       {D16-D31} */
            VPOPNE  {D0-D15}
            VMSRNE  FPSCR, R0
    
            /* Restore the critical section nesting depth. */
            LDR     R0, ulCriticalNestingConst
            POP     {R1}
            STR     R1, [R0]
    
            /* reset local monitor, this is needed for atomics which use LDREX, STREX to work properly */
            CLREX
    
            /* Restore all system mode registers other than the SP (which is already
            being used). */
            POP     {R0-R12, R14}
    
            /* Return to the task code, loading CPSR on the way. */
            RFEIA   sp!
    
            .endm

    Thanks.

    Jeff

  • Hi TI experts,

    Sorry to disturb you again.

    Any updates for this issue?

    Thanks

    Jeff

  • Hi Jeff,

    I don't see this feature is enabled for AWR294x device in FreeRTOS implementation provided in MCU Plus SDK.

    Regards,

    Jitendra

  • Hi Jitendra,

    Will it be support in the feature? Has any plan to do it?

    Best Regards

    Jeff

  • Hi Jeff,

    There is no plan for this feature to include in AWR294x SDK.

    Regards,

    Jitendra