From d2fe847d2673f4c5a6570eeb6b23154470cb95a6 Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Wed, 8 Oct 2025 17:20:36 +0200 Subject: [PATCH 01/11] Add option to customize FLASH range Certain microcontrollers (e.g. RP2040) utilize BootROM which contains useful utility functions to accelerate certain common but expensive tasks such as division, etc. In such case the linker file doesn't capture this inside the FLASH region so memory protection will exclude BootROM from read and execute. If such thing happens then developer can use new options to override definition of FLASH region and specify region that will include both FLASH and BootROM. As of now there is only one region available for this purpose, so BootROM and FLASH have to create area that is not interrupted by any other region which shall have different access flags, such as peripherals or RAM. --- cmake/options.cmake | 5 +++++ conf/kernel.h | 7 +++++++ src/os/arch/arm/cmsis/arch/memory.h | 9 +++++++++ 3 files changed, 21 insertions(+) diff --git a/cmake/options.cmake b/cmake/options.cmake index 9e4326e3..b0f4262c 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -10,6 +10,11 @@ option(CMRX_KERNEL_TRACING "Enable tracing of kernel events" OFF) option(CMRX_CLANG_TIDY "Enable linting using Clang-tidy" ON) option(CMRX_KERNEL_TRANSACTION_VERIFICATION "Enable checking for nested transaction commits" OFF) option(CMRX_IDLE_THREAD_SHUTDOWN_CPU "Idle thread stops CPU" OFF) + +option(CMRX_CUSTOM_FLASH_RANGE "If set to ON then developer SHALL provide custom range that covers all readable and executable area. If set to OFF then kernel will determine this automatically based on linker file, if possible" OFF) +option(CMRX_CUSTOM_FLASH_START "Custom start address of FLASH region. FLASH region includes this address" 0) +option(CMRX_CUSTOM_FLASH_SIZE "Custom size of FLASH region" 0) + option(CMRX_RPC_CANARY "Enable RPC canaries" OFF) option(CMRX_MAP_FILE_WITH_EXTENSION "MAP file contains full name of binary with ELF extension (.elf.map)" OFF) option(CMRX_CLANG_TIDY_LIBC_PATH "Path to standard C library used while linting" /usr/include) diff --git a/conf/kernel.h b/conf/kernel.h index 9b00303e..9237511b 100644 --- a/conf/kernel.h +++ b/conf/kernel.h @@ -73,4 +73,11 @@ */ #cmakedefine CMRX_RPC_CANARY +#cmakedefine CMRX_CUSTOM_FLASH_RANGE + +#ifdef CMRX_CUSTOM_FLASH_RANGE +# define CMRX_CUSTOM_FLASH_START @CMRX_CUSTOM_FLASH_START@ +# define CMRX_CUSTOM_FLASH_SIZE @CMRX_CUSTOM_FLASH_SIZE@ +#endif + /** @} */ diff --git a/src/os/arch/arm/cmsis/arch/memory.h b/src/os/arch/arm/cmsis/arch/memory.h index 5e974635..bacdef86 100644 --- a/src/os/arch/arm/cmsis/arch/memory.h +++ b/src/os/arch/arm/cmsis/arch/memory.h @@ -1,5 +1,8 @@ #pragma once +#include + +#ifdef CMRX_CUSTOM_FLASH_RANGE /** This symbol is placed exactly at the address where FLASH starts by the linker script */ extern void * __cmrx_flash_origin; @@ -12,4 +15,10 @@ extern void * __cmrx_flash_length; /** Obtain size of all the .text in the flash image */ #define code_size() ((int)(&__cmrx_flash_length)) +#else + +#define code_base() (CMRX_CUSTOM_FLASH_START) +#define code_size() (CMRX_CUSTOM_FLASH_SIZE) + +#endif From 151bab4647ca30e4fef7433e5e7d1404e304c5c5 Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Wed, 8 Oct 2025 17:26:46 +0200 Subject: [PATCH 02/11] fix: Wrong logic of use of custom flash ranges Fix the code so that custom ranges are used only if CMRX_CUSTOM_FLASH_RANGE macro is set. --- src/os/arch/arm/cmsis/arch/memory.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/os/arch/arm/cmsis/arch/memory.h b/src/os/arch/arm/cmsis/arch/memory.h index bacdef86..77608a7f 100644 --- a/src/os/arch/arm/cmsis/arch/memory.h +++ b/src/os/arch/arm/cmsis/arch/memory.h @@ -2,7 +2,7 @@ #include -#ifdef CMRX_CUSTOM_FLASH_RANGE +#ifndef CMRX_CUSTOM_FLASH_RANGE /** This symbol is placed exactly at the address where FLASH starts by the linker script */ extern void * __cmrx_flash_origin; From cc652e5d252b1628beed5f8b83a879a0f0b58c84 Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Wed, 15 Oct 2025 08:23:54 +0200 Subject: [PATCH 03/11] refactor: Remove unused MPU region from thread state Unused region was previously saved in the MPU state with other regions. It was a preparation for the future use by the thread. Remove it to conserve memory and prepare for different use. Unused and stack regions swapped index so now unused region is #6. --- conf/kernel.h | 2 +- src/os/arch/arm/cmsis/arch/mpu_priv.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/conf/kernel.h b/conf/kernel.h index 9237511b..05954eb2 100644 --- a/conf/kernel.h +++ b/conf/kernel.h @@ -14,7 +14,7 @@ #define KERNEL_HAS_MEMORY_PROTECTION /** How many MPU regions are saved per thread */ -#define MPU_STATE_SIZE 7 +#define MPU_STATE_SIZE 6 /** How many MPU regions are always used based on in which process thread is hosted */ #define MPU_HOSTED_STATE_SIZE 4 diff --git a/src/os/arch/arm/cmsis/arch/mpu_priv.h b/src/os/arch/arm/cmsis/arch/mpu_priv.h index abde126b..375459cf 100644 --- a/src/os/arch/arm/cmsis/arch/mpu_priv.h +++ b/src/os/arch/arm/cmsis/arch/mpu_priv.h @@ -88,10 +88,10 @@ #define OS_MPU_REGION_MMIO2 3 /// Currently unused region (reserved) #define OS_MPU_REGION_SHARED 4 -/// Currently unused region (reserved) -#define OS_MPU_REGION_UNUSED2 5 /// Region covering thread's stack -#define OS_MPU_REGION_STACK 6 +#define OS_MPU_REGION_STACK 5 +/// Currently unused region (reserved) +#define OS_MPU_REGION_UNUSED2 6 /// Region covering executable RAM (?) #define OS_MPU_REGION_EXECUTABLE 7 From 194472e486f0403a26ed1c31ade2851cdea6b54d Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Wed, 15 Oct 2025 08:26:18 +0200 Subject: [PATCH 04/11] refactor: Clean-up MPU access enums Enums are given cleaner names and enum counter is introduced, so arrays which are indexed by this enum can be statically checked to match the size with enum count. Statically check that ARM port array that provides flag translation to ARM MPU has correct count of entries. --- src/os/arch/arm/mpu.c | 2 ++ src/os/kernel/mpu.h | 8 +++++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/os/arch/arm/mpu.c b/src/os/arch/arm/mpu.c index feb4db91..effca369 100644 --- a/src/os/arch/arm/mpu.c +++ b/src/os/arch/arm/mpu.c @@ -29,6 +29,8 @@ static const uint32_t __MPU_flags[] = { MPU_RASR_ATTR_XN | MPU_RASR_ATTR_AP_PRW_URW, }; +_Static_assert(sizeof(__MPU_flags)/sizeof(__MPU_flags[0]) == MPU_FLAGS_COUNT, "Missing or extra entries in MPU flag mapping table"); + /** Handler for hard fault. */ void hard_fault_handler(void) diff --git a/src/os/kernel/mpu.h b/src/os/kernel/mpu.h index c8326b61..b8edcc4b 100644 --- a/src/os/kernel/mpu.h +++ b/src/os/kernel/mpu.h @@ -19,15 +19,17 @@ */ enum MPU_Flags { /// Region cannot be accesses. Any attempt to access addresses from this region will result in hard fault - MPU_NONE, + MPU_NONE = 0, /// Region can be read and executed. Attempt to write will result in hard fault MPU_RX, /// Region can be read, written and executed. No attempt to access region can result in hard fault MPU_RWX, /// Region can be read. Attempt to write into region, or execute out of it will result in hard fault - MPU_R, + MPU_RO, /// Region can be read and written but cannot be executed. Attempt to execute code will result in hard fault - MPU_RW + MPU_RW, + /// Region can be read. Attempt to either write into region or execute it will result in hard fault + MPU_FLAGS_COUNT }; /** @} */ From 6b7b8002bca36a766db3a026b9bdd18811f8e6ac Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Wed, 15 Oct 2025 08:34:18 +0200 Subject: [PATCH 05/11] feat: Add support for platform-specific code Not all chips are made equal and some need special code to handle their uniqueness. This is a beginning of effort to allow chip-specific code in platform support code and chip-specific CMake modules. Primary purpose of this code is to allow platform specific code for system, core and thread initialization in a similar way how architecture can do custom initialization at these points. Secondary purpose might be to help processing HAL integration. While HAL integration is not tremendously hard, it is a repetitive work and could be modularized and automated. --- src/os/arch/arm/CMakeLists.txt | 8 ++++++++ src/os/arch/testing/CMakeLists.txt | 1 + src/os/arch/testing/platform.h | 4 ++++ src/os/kernel/sched.c | 3 +++ 4 files changed, 16 insertions(+) create mode 100644 src/os/arch/testing/platform.h diff --git a/src/os/arch/arm/CMakeLists.txt b/src/os/arch/arm/CMakeLists.txt index 9f470bc4..c068bc80 100644 --- a/src/os/arch/arm/CMakeLists.txt +++ b/src/os/arch/arm/CMakeLists.txt @@ -14,3 +14,11 @@ target_sources(os PRIVATE ${cmrx_arm_SRCS}) if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") target_compile_options(os PRIVATE -mgeneral-regs-only) endif() + +if (CMRX_PLATFORM) + if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${CMRX_PLATFORM}) + add_subdirectory(${CMRX_PLATFORM}) + else() + message(FATAL_ERROR "Unable to include platform ${CMRX_PLATFORM} as it doesn't exist!") + endif() +endif() diff --git a/src/os/arch/testing/CMakeLists.txt b/src/os/arch/testing/CMakeLists.txt index 15b5daeb..0771ce79 100644 --- a/src/os/arch/testing/CMakeLists.txt +++ b/src/os/arch/testing/CMakeLists.txt @@ -8,3 +8,4 @@ set(cmrx_testing_SRCS ) target_sources(os PRIVATE ${cmrx_testing_SRCS}) target_link_libraries(os PRIVATE ctest) +target_include_directories(os PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/os/arch/testing/platform.h b/src/os/arch/testing/platform.h new file mode 100644 index 00000000..041a0e8c --- /dev/null +++ b/src/os/arch/testing/platform.h @@ -0,0 +1,4 @@ +#pragma once + +#define os_thread_initialize_platform(x) +#define os_init_platform() diff --git a/src/os/kernel/sched.c b/src/os/kernel/sched.c index 8023389d..db92eb26 100644 --- a/src/os/kernel/sched.c +++ b/src/os/kernel/sched.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #define STACK_ALIGN @@ -460,6 +461,7 @@ int __os_thread_create(Process_t process, entrypoint_t * entrypoint, void * data if (thread_id < OS_THREADS) { os_thread_initialize_arch(&os_threads[thread_id]); + os_thread_initialize_platform(&os_threads[thread_id]); os_thread_construct(thread_id, entrypoint, data, core); } ASSERT(thread_id < OS_THREADS); @@ -565,6 +567,7 @@ void _os_start(uint8_t start_core) kernel_structs_initialized = KERNEL_STRUCTS_INITIALIZED_SIGNATURE; memset(&os_threads, 0, sizeof(os_threads)); // NOLINT - count is a compile-time constant os_init_arch(); + os_init_platform(); os_timer_init(); os_notify_init(); } From 27408295d784213cfb899f5303b29000142a6435 Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Wed, 15 Oct 2025 08:36:40 +0200 Subject: [PATCH 06/11] feat: RP2xxx platform support STUB This is a stub of platform support code for RP2xxx chips. Its purpose is to create additional MPU region with read-only + execute privileges which provides access to jump tables used by C runtime and some runtime functions which are put into RAM rather than FLASH by the linker script to speed-up certain operations. This platform code is not fully done yet, it depends on the fact that linker script contains two additional symbols __rp2xxx_platform_custom_start and __rp2xxx_platform_custom_end. These symbols wrap deployments of .text*, .rodata* and .data* inside data section. Symbols must be aligned to base at least of the length of region in between them. Linker script manipulator which would do this is not written yet. --- src/os/arch/arm/rp2xxx/CMakeLists.txt | 6 ++++++ src/os/arch/arm/rp2xxx/platform.h | 6 ++++++ src/os/arch/arm/rp2xxx/rp2xxx.c | 13 +++++++++++++ 3 files changed, 25 insertions(+) create mode 100644 src/os/arch/arm/rp2xxx/CMakeLists.txt create mode 100644 src/os/arch/arm/rp2xxx/platform.h create mode 100644 src/os/arch/arm/rp2xxx/rp2xxx.c diff --git a/src/os/arch/arm/rp2xxx/CMakeLists.txt b/src/os/arch/arm/rp2xxx/CMakeLists.txt new file mode 100644 index 00000000..ba6538b0 --- /dev/null +++ b/src/os/arch/arm/rp2xxx/CMakeLists.txt @@ -0,0 +1,6 @@ +set(rp2xxx_SRCS + rp2xxx.c +) + +target_sources(os PRIVATE ${rp2xxx_SRCS}) +target_include_directories(os PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/os/arch/arm/rp2xxx/platform.h b/src/os/arch/arm/rp2xxx/platform.h new file mode 100644 index 00000000..bafa198f --- /dev/null +++ b/src/os/arch/arm/rp2xxx/platform.h @@ -0,0 +1,6 @@ +#pragma once + +struct OS_thread_t; + +#define os_thread_initialize_platform(x) +void os_init_platform(void); diff --git a/src/os/arch/arm/rp2xxx/rp2xxx.c b/src/os/arch/arm/rp2xxx/rp2xxx.c new file mode 100644 index 00000000..8357276d --- /dev/null +++ b/src/os/arch/arm/rp2xxx/rp2xxx.c @@ -0,0 +1,13 @@ +#include "platform.h" + +#include +#include + +extern char __rp2xxx_platform_custom_start; +extern char __rp2xxx_platform_custom_end; + +void os_init_platform(void) +{ + // We can do this now because MPU region setup remains unchanged + mpu_set_region(OS_MPU_REGION_UNUSED2, (const void *) &__rp2xxx_platform_custom_start, &__rp2xxx_platform_custom_end - &__rp2xxx_platform_custom_start, MPU_RX); +} From c2a9e12635a5cd45bbe6ef6e7de90a68ea8f5179 Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Fri, 17 Oct 2025 15:01:47 +0200 Subject: [PATCH 07/11] fix: Add generic ARM platform Added support for platforms creates the need of having a generic platform. In case of ARM, the generic platform does nothing. So this platform just configures path to a header which defines all platform-specific calls as empty macros. --- cmake/options.cmake | 2 ++ src/os/arch/arm/generic/CMakeLists.txt | 1 + src/os/arch/arm/generic/platform.h | 10 ++++++++++ 3 files changed, 13 insertions(+) create mode 100644 src/os/arch/arm/generic/CMakeLists.txt create mode 100644 src/os/arch/arm/generic/platform.h diff --git a/cmake/options.cmake b/cmake/options.cmake index b0f4262c..8045f523 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -5,6 +5,8 @@ if (CMAKE_HOST_WIN32) else() set(UNIT_TESTS_DEFAULT ON) endif() +option(CMRX_PLATFOM "Specific platform within architecture to build for" "generic") + option(CMRX_UNIT_TESTS "Enable build of kernel unit tests" ${UNIT_TESTS_DEFAULT}) option(CMRX_KERNEL_TRACING "Enable tracing of kernel events" OFF) option(CMRX_CLANG_TIDY "Enable linting using Clang-tidy" ON) diff --git a/src/os/arch/arm/generic/CMakeLists.txt b/src/os/arch/arm/generic/CMakeLists.txt new file mode 100644 index 00000000..aa0c0cfa --- /dev/null +++ b/src/os/arch/arm/generic/CMakeLists.txt @@ -0,0 +1 @@ +target_include_directories(os PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}) diff --git a/src/os/arch/arm/generic/platform.h b/src/os/arch/arm/generic/platform.h new file mode 100644 index 00000000..d7563c58 --- /dev/null +++ b/src/os/arch/arm/generic/platform.h @@ -0,0 +1,10 @@ +#pragma once + +/* The default ARM platform does not use any of these + * thus they are defined as empty macros. This is + * intentional + */ + +#define os_thread_initialize_platform(x) +#define os_init_platform(x) + From 11fe56654e6874843d2f85406b0f97572c0b3023 Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Mon, 20 Oct 2025 09:54:56 +0200 Subject: [PATCH 08/11] fix: Use CACHE entries for non-bool options Convert some newer non-bool option from option() to set(... CACHE). --- cmake/options.cmake | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/cmake/options.cmake b/cmake/options.cmake index 8045f523..d8779bdc 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -1,11 +1,11 @@ option(CMRX_ARCH_SMP_SUPPORTED "Architecture supports SMP and project is using it" OFF) -option(CMRX_OS_NUM_CORES "Amount of cores present in CPU package" INT:1) +set(CMRX_OS_NUM_CORES 1 CACHE STRING "Amount of cores present in CPU package") if (CMAKE_HOST_WIN32) set(UNIT_TESTS_DEFAULT OFF) else() set(UNIT_TESTS_DEFAULT ON) endif() -option(CMRX_PLATFOM "Specific platform within architecture to build for" "generic") +set(CMRX_PLATFORM "generic" CACHE STRING "Specific platform within architecture to build for") option(CMRX_UNIT_TESTS "Enable build of kernel unit tests" ${UNIT_TESTS_DEFAULT}) option(CMRX_KERNEL_TRACING "Enable tracing of kernel events" OFF) @@ -14,12 +14,12 @@ option(CMRX_KERNEL_TRANSACTION_VERIFICATION "Enable checking for nested transact option(CMRX_IDLE_THREAD_SHUTDOWN_CPU "Idle thread stops CPU" OFF) option(CMRX_CUSTOM_FLASH_RANGE "If set to ON then developer SHALL provide custom range that covers all readable and executable area. If set to OFF then kernel will determine this automatically based on linker file, if possible" OFF) -option(CMRX_CUSTOM_FLASH_START "Custom start address of FLASH region. FLASH region includes this address" 0) -option(CMRX_CUSTOM_FLASH_SIZE "Custom size of FLASH region" 0) +set(CMRX_CUSTOM_FLASH_START 0 CACHE STRING "Custom start address of FLASH region. FLASH region includes this address") +set(CMRX_CUSTOM_FLASH_SIZE 0 CACHE STRING "Custom size of FLASH region") option(CMRX_RPC_CANARY "Enable RPC canaries" OFF) option(CMRX_MAP_FILE_WITH_EXTENSION "MAP file contains full name of binary with ELF extension (.elf.map)" OFF) -option(CMRX_CLANG_TIDY_LIBC_PATH "Path to standard C library used while linting" /usr/include) +set(CMRX_CLANG_TIDY_LIBC_PATH /usr/include CACHE STRING "Path to standard C library used while linting") set(OS_STACK_SIZE 1024 CACHE STRING "Stack allocated per thread in bytes") set(OS_THREADS 8 CACHE STRING "Amount of entries in the thread table") set(OS_PROCESSES 8 CACHE STRING "Amount of entries in the process table") @@ -30,6 +30,9 @@ set(CMRX_ALL_OPTIONS CMRX_ARCH_SMP_SUPPORTED CMRX_OS_NUM_CORES CMRX_KERNEL_TRACING + CMRX_CUSTOM_FLASH_RANGE + CMRX_CUSTOM_FLASH_START + CMRX_CUSTOM_FLASH_SIZE OS_STACK_SIZE OS_THREADS OS_PROCESSES From a16a7effa485912679440bc86e27d54570d0066b Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Mon, 20 Oct 2025 09:55:45 +0200 Subject: [PATCH 09/11] refactor: Report chosen platform Give developer a notion on which platform has been chosen. --- src/os/arch/arm/CMakeLists.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/os/arch/arm/CMakeLists.txt b/src/os/arch/arm/CMakeLists.txt index c068bc80..94526f7b 100644 --- a/src/os/arch/arm/CMakeLists.txt +++ b/src/os/arch/arm/CMakeLists.txt @@ -15,8 +15,9 @@ if (NOT ${CMAKE_C_COMPILER_ID} STREQUAL "Clang") target_compile_options(os PRIVATE -mgeneral-regs-only) endif() +message(STATUS "Target platform: ${CMRX_PLATFORM}") if (CMRX_PLATFORM) - if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/${CMRX_PLATFORM}) + if (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/${CMRX_PLATFORM}") add_subdirectory(${CMRX_PLATFORM}) else() message(FATAL_ERROR "Unable to include platform ${CMRX_PLATFORM} as it doesn't exist!") From 24dcbaf48a5aa30d89247f0c8cf77c700c26885b Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Mon, 20 Oct 2025 10:49:13 +0200 Subject: [PATCH 10/11] fix: Activate user's platform choice on first Cmake run Cache entries tend to overwrite user settings. Avoid setting cache entry if user already configured platform. This makes sure that platform is picked-up on first CMake run. --- cmake/options.cmake | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmake/options.cmake b/cmake/options.cmake index d8779bdc..50f0c253 100644 --- a/cmake/options.cmake +++ b/cmake/options.cmake @@ -5,7 +5,10 @@ if (CMAKE_HOST_WIN32) else() set(UNIT_TESTS_DEFAULT ON) endif() -set(CMRX_PLATFORM "generic" CACHE STRING "Specific platform within architecture to build for") + +if (NOT CMRX_PLATFORM) + set(CMRX_PLATFORM "generic" CACHE STRING "Specific platform within architecture to build for") +endif() option(CMRX_UNIT_TESTS "Enable build of kernel unit tests" ${UNIT_TESTS_DEFAULT}) option(CMRX_KERNEL_TRACING "Enable tracing of kernel events" OFF) From 9011421ff978df9db078e0a8738d1863742b5423 Mon Sep 17 00:00:00 2001 From: Eduard Drusa Date: Mon, 20 Oct 2025 10:50:44 +0200 Subject: [PATCH 11/11] feat: Auto-configure RP2xxx build RP2xxx needs custom memory map. Do this change automatically so user doesn't have to deal with it. For now the only user action needed is to set CMRX_PLATFORM to rp2xxx and to provide linker script patch. --- cmake/CMRX.cmake | 3 +++ cmake/arch/arm/platform/rp2xxx/CMRX.cmake | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 cmake/arch/arm/platform/rp2xxx/CMRX.cmake diff --git a/cmake/CMRX.cmake b/cmake/CMRX.cmake index a8f6715b..60bef9f8 100644 --- a/cmake/CMRX.cmake +++ b/cmake/CMRX.cmake @@ -25,6 +25,9 @@ else() if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/arch/${CMRX_ARCH}/${CMRX_HAL}/CMRX.cmake) include(${CMAKE_CURRENT_LIST_DIR}/arch/${CMRX_ARCH}/${CMRX_HAL}/CMRX.cmake) endif() + if (EXISTS ${CMAKE_CURRENT_LIST_DIR}/arch/${CMRX_ARCH}/platform/${CMRX_PLATFORM}/CMRX.cmake) + include(${CMAKE_CURRENT_LIST_DIR}/arch/${CMRX_ARCH}/platform/${CMRX_PLATFORM}/CMRX.cmake) + endif() endif() ## Add firmware application definition diff --git a/cmake/arch/arm/platform/rp2xxx/CMRX.cmake b/cmake/arch/arm/platform/rp2xxx/CMRX.cmake new file mode 100644 index 00000000..0cfdb947 --- /dev/null +++ b/cmake/arch/arm/platform/rp2xxx/CMRX.cmake @@ -0,0 +1,3 @@ +set(CMRX_CUSTOM_FLASH_RANGE TRUE) +set(CMRX_CUSTOM_FLASH_START 0x0) +set(CMRX_CUSTOM_FLASH_SIZE 0x20000000)