Skip to content

Commit

Permalink
Merge branch 'main' into pr-process
Browse files Browse the repository at this point in the history
  • Loading branch information
aggarg authored Aug 2, 2023
2 parents 6db1c8b + b51a373 commit bda7303
Show file tree
Hide file tree
Showing 70 changed files with 1,111 additions and 1,029 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/kernel-demos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,9 +123,22 @@ jobs:
with:
ref: main
repository: FreeRTOS/FreeRTOS
submodules: 'recursive'
fetch-depth: 1

- name: Fetch Community-Supported-Demos Submodule
shell: bash
run: |
# Fetch Community-Supported-Demos Submodule
echo "::group::Fetch Community-Supported-Demos Submodule"
git submodule update --checkout --init --depth 1 FreeRTOS/Demo/ThirdParty/Community-Supported-Demos
echo "::engdroup::"
if [ "$?" = "0" ]; then
echo -e "\033[32;3mCloned the Community-Supported-Demos\033[0m"
else
echo -e "\033[32;31mCommunity-Supported-Demos Clone Failed...\033[0m"
exit 1
fi
# Checkout user pull request changes
- name: Checkout Pull Request
uses: actions/checkout@v2
Expand Down Expand Up @@ -169,7 +182,7 @@ jobs:

- name: Build CORTEX_M0+_RP2040 Demos
shell: bash
working-directory: FreeRTOS/Demo/ThirdParty/Community-Supported/CORTEX_M0+_RP2040
working-directory: FreeRTOS/Demo/ThirdParty/Community-Supported-Demos/CORTEX_M0+_RP2040
run: |
git clone https://github.com/raspberrypi/pico-sdk.git
cmake -B build -DPICO_SDK_PATH=pico-sdk -GNinja
Expand Down
4 changes: 2 additions & 2 deletions History.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@ Changes between FreeRTOS V10.5.1 and FreeRTOS 10.6.0 released July 13, 2023
China.
- Xinwen Fu of Department of Computer Science, University of
Massachusetts Lowell, USA.
- Yueqi Chen, Zicheng Wang, Minghao Lin of University of Colorado
Boulder, USA.
- Yueqi Chen, Zicheng Wang, Minghao Lin, Jiahe Wang of University of
Colorado Boulder, USA.
+ Add Cortex-M35P port. Contributed by @urutva.
+ Add embedded extension (RV32E) support to the IAR RISC-V port.
+ Add ulTaskGetRunTimeCounter and ulTaskGetRunTimePercent APIs. Contributed by
Expand Down
20 changes: 20 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ FetchContent_Declare( freertos_kernel
)
```

In case you prefer to add it as a git submodule, do:

```bash
$ git submodule add https://github.com/FreeRTOS/FreeRTOS-Kernel.git <path of the submodule>
$ git submodule update --init
```

- Add a freertos_config library (typically an INTERFACE library) The following assumes the directory structure:
- `include/FreeRTOSConfig.h`
```cmake
Expand All @@ -41,6 +48,12 @@ target_compile_definitions(freertos_config
)
```

In case you installed FreeRTOS-Kernel as a submodule, you will have to add it as a subdirectory:

```cmake
add_subdirectory(${FREERTOS_PATH})
```

- Configure the FreeRTOS-Kernel and make it available
- this particular example supports a native and cross-compiled build option.

Expand All @@ -56,6 +69,13 @@ endif()
FetchContent_MakeAvailable(freertos_kernel)
```

- In case of cross compilation, you should also add the following to `freertos_config`:

```cmake
target_compile_definitions(freertos_config INTERFACE ${definitions})
target_compile_options(freertos_config INTERFACE ${options})
```

### Consuming stand-alone - Cloning this repository

To clone using HTTPS:
Expand Down
15 changes: 10 additions & 5 deletions include/mpu_prototypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,11 +223,11 @@ void MPU_vTimerSetTimerID( TimerHandle_t xTimer,
void * pvNewID ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTimerIsTimerActive( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
BaseType_t MPU_xTimerGenericCommandFromTask( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) FREERTOS_SYSTEM_CALL;
const char * MPU_pcTimerGetName( TimerHandle_t xTimer ) FREERTOS_SYSTEM_CALL;
void MPU_vTimerSetReloadMode( TimerHandle_t xTimer,
const UBaseType_t uxAutoReload ) FREERTOS_SYSTEM_CALL;
Expand All @@ -252,6 +252,11 @@ TimerHandle_t MPU_xTimerCreateStatic( const char * const pcTimerName,
StaticTimer_t * pxTimerBuffer ) PRIVILEGED_FUNCTION;
BaseType_t MPU_xTimerGetStaticBuffer( TimerHandle_t xTimer,
StaticTimer_t ** ppxTimerBuffer ) PRIVILEGED_FUNCTION;
BaseType_t MPU_xTimerGenericCommandFromISR( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) PRIVILEGED_FUNCTION;

/* MPU versions of event_group.h API functions. */
EventBits_t MPU_xEventGroupWaitBits( EventGroupHandle_t xEventGroup,
Expand Down
11 changes: 6 additions & 5 deletions include/mpu_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@
#define vTimerSetTimerID MPU_vTimerSetTimerID
#define xTimerIsTimerActive MPU_xTimerIsTimerActive
#define xTimerGetTimerDaemonTaskHandle MPU_xTimerGetTimerDaemonTaskHandle
#define xTimerGenericCommand MPU_xTimerGenericCommand
#define xTimerGenericCommandFromTask MPU_xTimerGenericCommandFromTask
#define pcTimerGetName MPU_pcTimerGetName
#define vTimerSetReloadMode MPU_vTimerSetReloadMode
#define uxTimerGetReloadMode MPU_uxTimerGetReloadMode
Expand All @@ -167,10 +167,11 @@
* the application can use opaque handles maintained in mpu_wrappers.c
* with all the APIs. */
#if ( configUSE_MPU_WRAPPERS_V1 == 0 )
#define xTimerGetReloadMode MPU_xTimerGetReloadMode
#define xTimerCreate MPU_xTimerCreate
#define xTimerCreateStatic MPU_xTimerCreateStatic
#define xTimerGetStaticBuffer MPU_xTimerGetStaticBuffer
#define xTimerGetReloadMode MPU_xTimerGetReloadMode
#define xTimerCreate MPU_xTimerCreate
#define xTimerCreateStatic MPU_xTimerCreateStatic
#define xTimerGetStaticBuffer MPU_xTimerGetStaticBuffer
#define xTimerGenericCommandFromISR MPU_xTimerGenericCommandFromISR
#endif /* #if ( configUSE_MPU_WRAPPERS_V1 == 0 ) */

/* Map standard event_group.h API functions to the MPU equivalents. */
Expand Down
2 changes: 1 addition & 1 deletion include/task.h
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ typedef struct xTASK_STATUS
UBaseType_t uxBasePriority; /* The priority to which the task will return if the task's current priority has been inherited to avoid unbounded priority inversion when obtaining a mutex. Only valid if configUSE_MUTEXES is defined as 1 in FreeRTOSConfig.h. */
configRUN_TIME_COUNTER_TYPE ulRunTimeCounter; /* The total run time allocated to the task so far, as defined by the run time stats clock. See https://www.FreeRTOS.org/rtos-run-time-stats.html. Only valid when configGENERATE_RUN_TIME_STATS is defined as 1 in FreeRTOSConfig.h. */
StackType_t * pxStackBase; /* Points to the lowest address of the task's stack area. */
#if ( ( portSTACK_GROWTH > 0 ) && ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
#if ( ( portSTACK_GROWTH > 0 ) || ( configRECORD_STACK_HIGH_ADDRESS == 1 ) )
StackType_t * pxTopOfStack; /* Points to the top address of the task's stack area. */
StackType_t * pxEndOfStack; /* Points to the end address of the task's stack area. */
#endif
Expand Down
11 changes: 9 additions & 2 deletions portable/ARMv8M/non_secure/port.c
Original file line number Diff line number Diff line change
Expand Up @@ -754,8 +754,15 @@ __attribute__( ( weak ) ) void vPortSetupTimerInterrupt( void ) /* PRIVILEGED_FU
}
#endif /* configUSE_TICKLESS_IDLE */

/* Stop and reset the SysTick. */
portNVIC_SYSTICK_CTRL_REG = 0UL;
/* Stop and reset SysTick.
*
* QEMU versions older than 7.0.0 contain a bug which causes an error if we
* enable SysTick without first selecting a valid clock source. We trigger
* the bug if we change clock sources from a clock with a zero clock period
* to one with a nonzero clock period and enable Systick at the same time.
* So we configure the CLKSOURCE bit here, prior to setting the ENABLE bit.
* This workaround avoids the bug in QEMU versions older than 7.0.0. */
portNVIC_SYSTICK_CTRL_REG = portNVIC_SYSTICK_CLK_BIT_CONFIG;
portNVIC_SYSTICK_CURRENT_VALUE_REG = 0UL;

/* Configure SysTick to interrupt at the requested rate. */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1726,41 +1726,38 @@ TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) /* __attribute__ (( nake

#if ( configUSE_TIMERS == 1 )

BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) __attribute__ (( naked )) FREERTOS_SYSTEM_CALL;

BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
{
__asm volatile
(
" .syntax unified \n"
" .extern MPU_xTimerGenericCommandImpl \n"
" \n"
" push {r0, r1} \n"
" mrs r0, ipsr \n"
" cmp r0, #0 \n"
" bne MPU_xTimerGenericCommand_Priv \n"
" mrs r0, control \n"
" movs r1, #1 \n"
" tst r0, r1 \n"
" beq MPU_xTimerGenericCommand_Priv \n"
" MPU_xTimerGenericCommand_Unpriv: \n"
" pop {r0, r1} \n"
" svc %0 \n"
" bl MPU_xTimerGenericCommandImpl \n"
" svc %1 \n"
" bx lr \n"
" MPU_xTimerGenericCommand_Priv: \n"
" pop {r0, r1} \n"
" b MPU_xTimerGenericCommandImpl \n"
" \n"
BaseType_t MPU_xTimerGenericCommandFromTask( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) __attribute__ (( naked )) FREERTOS_SYSTEM_CALL;

BaseType_t MPU_xTimerGenericCommandFromTask( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
{
__asm volatile
(
" .syntax unified \n"
" .extern MPU_xTimerGenericCommandFromTaskImpl \n"
" \n"
" push {r0, r1} \n"
" mrs r0, control \n"
" movs r1, #1 \n"
" tst r0, r1 \n"
" bne MPU_xTimerGenericCommandFromTask_Unpriv \n"
" MPU_xTimerGenericCommandFromTask_Priv: \n"
" pop {r0, r1} \n"
" b MPU_xTimerGenericCommandFromTaskImpl \n"
" MPU_xTimerGenericCommandFromTask_Unpriv: \n"
" pop {r0, r1} \n"
" svc %0 \n"
" bl MPU_xTimerGenericCommandFromTaskImpl \n"
" svc %1 \n"
" bx lr \n"
" \n"
: : "i" ( portSVC_SYSTEM_CALL_ENTER_1 ), "i" ( portSVC_SYSTEM_CALL_EXIT ) : "memory"
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1726,41 +1726,38 @@ TaskHandle_t MPU_xTimerGetTimerDaemonTaskHandle( void ) /* __attribute__ (( nake

#if ( configUSE_TIMERS == 1 )

BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) __attribute__ (( naked )) FREERTOS_SYSTEM_CALL;

BaseType_t MPU_xTimerGenericCommand( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
{
__asm volatile
(
" .syntax unified \n"
" .extern MPU_xTimerGenericCommandImpl \n"
" \n"
" push {r0, r1} \n"
" mrs r0, ipsr \n"
" cmp r0, #0 \n"
" bne MPU_xTimerGenericCommand_Priv \n"
" mrs r0, control \n"
" movs r1, #1 \n"
" tst r0, r1 \n"
" beq MPU_xTimerGenericCommand_Priv \n"
" MPU_xTimerGenericCommand_Unpriv: \n"
" pop {r0, r1} \n"
" svc %0 \n"
" bl MPU_xTimerGenericCommandImpl \n"
" svc %1 \n"
" bx lr \n"
" MPU_xTimerGenericCommand_Priv: \n"
" pop {r0, r1} \n"
" b MPU_xTimerGenericCommandImpl \n"
" \n"
BaseType_t MPU_xTimerGenericCommandFromTask( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) __attribute__ (( naked )) FREERTOS_SYSTEM_CALL;

BaseType_t MPU_xTimerGenericCommandFromTask( TimerHandle_t xTimer,
const BaseType_t xCommandID,
const TickType_t xOptionalValue,
BaseType_t * const pxHigherPriorityTaskWoken,
const TickType_t xTicksToWait ) /* __attribute__ (( naked )) FREERTOS_SYSTEM_CALL */
{
__asm volatile
(
" .syntax unified \n"
" .extern MPU_xTimerGenericCommandFromTaskImpl \n"
" \n"
" push {r0, r1} \n"
" mrs r0, control \n"
" movs r1, #1 \n"
" tst r0, r1 \n"
" bne MPU_xTimerGenericCommandFromTask_Unpriv \n"
" MPU_xTimerGenericCommandFromTask_Priv: \n"
" pop {r0, r1} \n"
" b MPU_xTimerGenericCommandFromTaskImpl \n"
" MPU_xTimerGenericCommandFromTask_Unpriv: \n"
" pop {r0, r1} \n"
" svc %0 \n"
" bl MPU_xTimerGenericCommandFromTaskImpl \n"
" svc %1 \n"
" bx lr \n"
" \n"
: : "i" ( portSVC_SYSTEM_CALL_ENTER_1 ), "i" ( portSVC_SYSTEM_CALL_EXIT ) : "memory"
);
}
Expand Down
Loading

0 comments on commit bda7303

Please sign in to comment.