Skip to content

Commit

Permalink
Update the RM57 project
Browse files Browse the repository at this point in the history
  • Loading branch information
kar-rahul-aws committed Jul 15, 2024
1 parent 287924e commit cd9720c
Show file tree
Hide file tree
Showing 10 changed files with 131 additions and 808 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,13 @@
"name": "FreeRTOS-Kernel"
},
{
"path": "../../../Source/portable/GCC/ARM_CRx_MPU",
"path": "../../../Source/portable/GCC/ARM_CRx_No_GIC",
"C_Cpp.default.includePath": [
"../source",
"../include",
"../BoardFiles/include",
"../BoardFiles/source",
"../../Source/portable/GCC/ARM_CRx_MPU",
"../../Source/portable/GCC/ARM_CRx_No_GIC",
"../../Source/include",
"../../Source",
],
Expand All @@ -34,15 +34,15 @@
"**/.github**": true,
"**/.git[a-hj-z-]**": true,
"**/portable/**": true

},

"C_Cpp.default.includePath": [
"../source",
"../include",
"../BoardFiles/include",
"../BoardFiles/source",
"../../Source/portable/GCC/ARM_CRx_MPU",
"../../Source/portable/GCC/ARM_CRx_No_GIC",
"../../Source/include",
"../../Source",
],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@
* FreeRTOS V202212.00
* Copyright (C) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
Expand Down Expand Up @@ -66,11 +67,6 @@ extern void vMainSetupTimerInterrupt( void );
#define NULL 0x0
#endif

#define configENFORCE_SYSTEM_CALLS_FROM_KERNEL_ONLY 1U
#define configALLOW_UNPRIVILEGED_CRITICAL_SECTIONS 0U

#define configENABLE_FPU 1U

#define configNUMBER_OF_CORES 1U
#define configUSE_PREEMPTION 1U
#define configUSE_IDLE_HOOK 1U
Expand All @@ -80,6 +76,7 @@ extern void vMainSetupTimerInterrupt( void );
#define configQUEUE_REGISTRY_SIZE 10U
#define configSUPPORT_STATIC_ALLOCATION 1U
#define configSUPPORT_DYNAMIC_ALLOCATION 0U
#define configUSE_TASK_FPU_SUPPORT 2U

#define configCPU_CLOCK_HZ ( 110000000U )
#define configTICK_RATE_HZ ( 1000U )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@
* FreeRTOS V202212.00
* Copyright (C) 2024 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy of
* this software and associated documentation files (the "Software"), to deal in
* the Software without restriction, including without limitation the rights to
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
* the Software, and to permit persons to whom the Software is furnished to do so,
* subject to the following conditions:
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in all
* copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
* SOFTWARE.
*
* https://www.FreeRTOS.org
* https://github.com/FreeRTOS
Expand All @@ -41,7 +42,7 @@
/** @brief Demo that uses the Task Notification APIs */
#define NOTIFICATION_DEMO 0x8

/** @brief Build Register, Queue, MPU, IRQ, and Notification demos */
/** @brief Build Register, Queue, IRQ, and Notification demos */
#define FULL_DEMO ( REGISTER_DEMO | QUEUE_DEMO | IRQ_DEMO | NOTIFICATION_DEMO )

/** @brief Bitfield used to select the Demo Tasks to build and run
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,26 +39,26 @@
/* Demo include */
#include "demo_tasks.h"

#if ( mainDEMO_TYPE & IRQ_DEMO )
#if ( mainDEMO_TYPE &IRQ_DEMO )

/** @brief TCB used by the IRQ Test Task */
static StaticTask_t xIRQTestTaskTCB;
static StaticTask_t xIRQTestTaskTCB;

/** @brief MPU Region Aligned Stack used by the IRQ Test Task */
/** @brief Stack used by the IRQ Test Task */

static StackType_t uxIRQTestTaskStack[ configMINIMAL_STACK_SIZE ];
static StackType_t uxIRQTestTaskStack[ configMINIMAL_STACK_SIZE ];

/** @brief Parameters that are passed into the IRQ test task solely for
* the purpose of ensuring parameters are passed into tasks correctly. */
#define irqTASK_PARAMETER ( 0xFEEDBEEFUL )

/** @brief Statically allocated task handle for the IRQ Test task. */
static TaskHandle_t xIRQTaskHandle;
static TaskHandle_t xIRQTaskHandle;

volatile static uint32_t ulIntNestTestVal;
volatile static uint32_t ulIntNestTestVal;
/* ----------------------------------------------------------------------------------- */

/** @brief Entry point for the Unprivileged IRQ Test Task.
/** @brief Entry point for the IRQ Test Task.
* @param pvParameters A test value to ensure the task's arguments are correctly set.
* @note This task raises Software Interrupts (SWI) in the form of IRQs using the
* Vectored Interrupt Manager (VIM) built into the RM57 by Texas Instrument (TI).
Expand Down Expand Up @@ -124,7 +124,7 @@

/* ----------------------------------------------------------------------------------- */

void vIRQDemoHandler( void ) /* PRIVILEGED_FUNCTION */
void vIRQDemoHandler( void )
{
sci_print( "\tSWI Based IRQ was raised!\r\n" );
volatile uint32_t ulSSIRegisterValue;
Expand Down Expand Up @@ -221,7 +221,7 @@
{
BaseType_t xReturn = pdFAIL;

/* Create the register check tasks, as described at the top of this file. */
/* Create the IRQ check tasks, as described at the top of this file. */
xIRQTaskHandle = xTaskCreateStatic( prvIRQTestTask,
"IRQTestTask",
configMINIMAL_STACK_SIZE,
Expand Down
62 changes: 30 additions & 32 deletions FreeRTOS/Demo/CORTEX_No_GIC_R5F_TI_RM57_HERCULES_GCC/source/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,21 +72,21 @@ void vApplicationIRQHandler( void );
/* --------------------- Static Task Memory Allocation --------------------- */

/** @brief Statically declared TCB Used by the Idle Task */
static StaticTask_t xTimerTaskTCB;
static StaticTask_t xTimerTaskTCB;

/** @brief Statically declared MPU aligned stack used by the timer task */
static StackType_t uxTimerTaskStack[ configMINIMAL_STACK_SIZE ];
/** @brief Statically declared stack used by the timer task */
static StackType_t uxTimerTaskStack[ configMINIMAL_STACK_SIZE ];

/** @brief Statically declared TCB Used by the Idle Task */
static StaticTask_t xIdleTaskTCB;
static StaticTask_t xIdleTaskTCB;

/** @brief Statically declared MPU aligned stack used by the idle task */
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];
/** @brief Statically declared stack used by the idle task */
static StackType_t uxIdleTaskStack[ configMINIMAL_STACK_SIZE ];

/** @brief Simple variable to show how the idle tick hook can be used */
static volatile TickType_t ulIdleTickHookCount = 0x0;
static volatile TickType_t ulIdleTickHookCount = 0x0;

extern volatile uint32_t ulPortYieldRequired;
extern volatile uint32_t ulPortYieldRequired;

/* ------------------------------------------------------------------------- */

Expand All @@ -101,48 +101,48 @@ int main( void )
"----------------------------\r\n\r\n" );

#if ( mainDEMO_TYPE & REGISTER_DEMO )
{
if( pdPASS == xReturn )
{
sci_print( "Creating the Register test tasks\r\n" );
xReturn = xCreateRegisterTestTasks();
if( pdPASS == xReturn )
{
sci_print( "Creating the Register test tasks\r\n" );
xReturn = xCreateRegisterTestTasks();
}
}
}
#endif /* ( mainDEMO_TYPE & REGISTER_DEMO ) */

#if ( mainDEMO_TYPE & QUEUE_DEMO )
{
if( pdPASS == xReturn )
{
sci_print( "Creating the Queue Demo Tasks\r\n" );
xReturn = xCreateQueueTasks();
if( pdPASS == xReturn )
{
sci_print( "Creating the Queue Demo Tasks\r\n" );
xReturn = xCreateQueueTasks();
}
}
}
#endif /* ( mainDEMO_TYPE & QUEUE_DEMO ) */

#if ( mainDEMO_TYPE & IRQ_DEMO )
{
if( pdPASS == xReturn )
{
sci_print( "Creating the IRQ Demo Tasks\r\n" );
xReturn = xCreateIRQTestTask();
if( pdPASS == xReturn )
{
sci_print( "Creating the IRQ Demo Tasks\r\n" );
xReturn = xCreateIRQTestTask();
}
}
}
#endif /* ( mainDEMO_TYPE & IRQ_DEMO ) */

#if ( mainDEMO_TYPE & NOTIFICATION_DEMO )
{
if( pdPASS == xReturn )
{
sci_print( "Creating the Notification Demo Tasks\r\n" );
xReturn = xCreateNotificationTestTask();
if( pdPASS == xReturn )
{
sci_print( "Creating the Notification Demo Tasks\r\n" );
xReturn = xCreateNotificationTestTask();
}
}
}
#endif /* ( mainDEMO_TYPE & NOTIFICATION_DEMO ) */

if( pdPASS == xReturn )
{
sci_print( "\r\n--------------------------- Start of FreeRTOS Demos"
sci_print( "\r\n--------------------------- Start of FreeRTOS Demo Tasks"
"---------------------------\r\n\r\n" );
vTaskStartScheduler();
}
Expand Down Expand Up @@ -295,8 +295,6 @@ void vAssertCalled( const char * pcFuncName,
__asm volatile ( "NOP" );
}

/* NOTE: Unprivileged tasks cannot enter critical sections on the ARM_CRx_MPU port.
* Meaning unprivileged tasks will cause a pre-fetch abort if they fail an assert. */
taskENTER_CRITICAL();
{
/* You can step out of this function to debug the assertion by using
Expand Down Expand Up @@ -406,7 +404,7 @@ void vApplicationIRQHandler( void )
/* An IRQ Raised by Channel 21 of the VIM is a Software Interrupt (SSI). */
else if( 21UL == ulIRQChannelIndex )
{
#if ( mainDEMO_TYPE & IRQ_DEMO )
#if ( mainDEMO_TYPE &IRQ_DEMO )
/* This is an interrupt raised by Software */
vIRQDemoHandler();
#else
Expand Down
Loading

0 comments on commit cd9720c

Please sign in to comment.