Skip to content

Commit 63bee94

Browse files
WIP - Add FreeRTOS support for RP2350
Pull in Raspberry Pi's custom RP2350 ARM and RISC-V ports for FreeRTOS. Basic tests run, but stress mutex test is failing in unique and interesting ways.
1 parent 226a318 commit 63bee94

File tree

10 files changed

+29
-6
lines changed

10 files changed

+29
-6
lines changed
Submodule FreeRTOS-Kernel updated 32 files

libraries/FreeRTOS/src/FreeRTOS.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1 @@
1-
#ifdef PICO_RP2350
2-
#error Sorry, FreeRTOS is not yet supported on the RP2350 in this core.
3-
#else
41
#include "../lib/FreeRTOS-Kernel/include/FreeRTOS.h"
5-
#endif

libraries/FreeRTOS/src/FreeRTOSConfig.h

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,10 @@ extern unsigned long ulMainGetRunTimeCounterValue(void);
8282
#define configPRIO_BITS 3 /* 8 priority levels */
8383
#endif
8484

85+
#define configENABLE_MPU 0
86+
#define configENABLE_TRUSTZONE 0
87+
#define configRUN_FREERTOS_SECURE_ONLY 1
88+
#define configENABLE_FPU 1
8589
/* The lowest interrupt priority that can be used in a call to a "set priority"
8690
function. */
8791
#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x7
@@ -95,9 +99,14 @@ extern unsigned long ulMainGetRunTimeCounterValue(void);
9599
/* Interrupt priorities used by the kernel port layer itself. These are generic
96100
to all Cortex-M ports, and do not rely on any particular library functions. */
97101
#define configKERNEL_INTERRUPT_PRIORITY ( configLIBRARY_LOWEST_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
102+
103+
#ifdef PICO_RP2350
104+
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 16
105+
#else
98106
/* !!!! configMAX_SYSCALL_INTERRUPT_PRIORITY must not be set to zero !!!!
99107
See http://www.FreeRTOS.org/RTOS-Cortex-M3-M4.html. */
100108
#define configMAX_SYSCALL_INTERRUPT_PRIORITY ( configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY << (8 - configPRIO_BITS) )
109+
#endif
101110

102111
#ifdef __cplusplus
103112
extern "C" {
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
#include "../lib/FreeRTOS-Kernel/include/mpu_syscall_numbers.h"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#ifdef PICO_RP2350
2+
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2350_ARM_NTZ/non_secure/mpu_wrappers_v2_asm.c"
3+
#endif

libraries/FreeRTOS/src/port.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
#ifdef PICO_RP2040
12
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/port.c"
3+
#else
4+
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2350_ARM_NTZ/non_secure/port.c"
5+
#endif

libraries/FreeRTOS/src/portasm.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#ifdef PICO_RP2350
2+
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2350_ARM_NTZ/non_secure/portasm.c"
3+
#endif

libraries/FreeRTOS/src/portmacro.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
#ifdef PICO_RP2350
2+
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2350_ARM_NTZ/non_secure/portmacro.h"
3+
#else
14
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/portmacro.h"
5+
#endif
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
1+
#ifdef PICO_RP2350
2+
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2350_ARM_NTZ/non_secure//rp2040_config.h"
3+
#else
14
#include "../lib/FreeRTOS-Kernel/portable/ThirdParty/GCC/RP2040/include/rp2040_config.h"
5+
#endif

tests/common.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ function skip_ino()
88
local skiplistrp2350=""
99
if [ "$PICO_BOARD" == "rp2350" ]; then
1010
read -d '' skiplistrp2350 << EOL || true
11-
/FreeRTOS/
1211
/BTstackLib/
1312
/JoystickBT/
1413
/KeyboardBT/

0 commit comments

Comments
 (0)