Skip to content

Commit

Permalink
Add RPI pico2 2350 to CMake builds in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
ckormanyos committed Sep 17, 2024
1 parent ce51005 commit 49a1fe9
Show file tree
Hide file tree
Showing 8 changed files with 92 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/real-time-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
strategy:
fail-fast: false
matrix:
suite: [ am335x, bcm2835_raspi_b, lpc11c24, nxp_imxrt1062, rpi_pico_rp2040, stm32f100, stm32f407, stm32f429, stm32f446, stm32h7a3, stm32l100c, stm32l152, stm32l432 ]
suite: [ am335x, bcm2835_raspi_b, lpc11c24, nxp_imxrt1062, rpi_pico_rp2040, rpi_pico2_rp2350, stm32f100, stm32f407, stm32f429, stm32f446, stm32h7a3, stm32l100c, stm32l152, stm32l432 ]
steps:
- uses: actions/checkout@v4
with:
Expand Down
78 changes: 78 additions & 0 deletions ref_app/cmake/rpi_pico2_rp2350.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
##############################################################################
# Copyright Christopher Kormanyos 2021 - 2024.
# Distributed under the Boost Software License,
# Version 1.0. (See accompanying file LICENSE_1_0.txt
# or copy at http://www.boost.org/LICENSE_1_0.txt)

#
# MIT License
#
# Copyright (c) 2019 Joel Winarske
#
# 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.
#

set(APP ref_app)

set(CMAKE_EXECUTABLE_SUFFIX .elf)

set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_CXX_STANDARD 14)

set(TARGET_INCLUDES
${PATH_APP}/util/STL
)

set(_TARGET_CFLAGS
-mcpu=cortex-m33
-mthumb
-march=armv8-m.main+fp+dsp
-mabi=aapcs
-mfloat-abi=hard
-finline-functions
-finline-limit=128
-mno-unaligned-access
-mno-long-calls
)

set(TARGET_AFLAGS "")

set(_TARGET_LDFLAGS
-nostdlib
-nostartfiles
--specs=nano.specs
--specs=nosys.specs
-T ${LINKER_DEFINITION_FILE}
)

string(REPLACE ";" " " TARGET_CFLAGS "${_TARGET_CFLAGS}")
string(REPLACE ";" " " TARGET_LDFLAGS "${_TARGET_LDFLAGS}")


set(FILES_TARGET
${PATH_APP}/mcal/mcal_gcc_cxx_completion
${PATH_APP}/mcal/${TARGET}/mcal_cpu_rp2350
${PATH_TGT}/startup/core_1_run
${PATH_TGT}/startup/crt0
${PATH_TGT}/startup/crt0_init_ram
${PATH_TGT}/startup/crt1
${PATH_TGT}/startup/image_definition_block
${PATH_TGT}/startup/int_vect
${PATH_TGT}/startup/util
)
2 changes: 2 additions & 0 deletions ref_app/cmake/rpi_pico_rp2040.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ set(TARGET_AFLAGS "")
set(_TARGET_LDFLAGS
-nostdlib
-nostartfiles
--specs=nano.specs
--specs=nosys.specs
-T ${LINKER_DEFINITION_FILE}
)

Expand Down
5 changes: 5 additions & 0 deletions ref_app/ref_app.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -3000,6 +3000,10 @@
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="cmake\rpi_pico2_rp2350.cmake">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="cmake\rpi_pico_rp2040.cmake">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
Expand Down Expand Up @@ -3038,6 +3042,7 @@
</None>
<None Include="cmake\stm32l432.cmake">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">true</ExcludedFromBuild>
</None>
<None Include="cmake\xtensa32.cmake">
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
Expand Down
3 changes: 3 additions & 0 deletions ref_app/ref_app.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -2861,6 +2861,9 @@
<None Include="cmake\stm32l432.cmake">
<Filter>src\cmake</Filter>
</None>
<None Include="cmake\rpi_pico2_rp2350.cmake">
<Filter>src\cmake</Filter>
</None>
</ItemGroup>
<ItemGroup>
<Text Include="CMakeLists.txt" />
Expand Down
2 changes: 1 addition & 1 deletion ref_app/target.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1014,7 +1014,7 @@
<ClCompile Include="target\micros\rpi_pico2_rp2350\Startup\crt0.cpp" />
<ClCompile Include="target\micros\rpi_pico2_rp2350\startup\crt0_init_ram.cpp" />
<ClCompile Include="target\micros\rpi_pico2_rp2350\startup\crt1.cpp" />
<ClCompile Include="target\micros\rpi_pico2_rp2350\startup\image_definition_block.c" />
<ClCompile Include="target\micros\rpi_pico2_rp2350\startup\image_definition_block.cpp" />
<ClCompile Include="target\micros\rpi_pico2_rp2350\startup\int_vect.cpp" />
<ClCompile Include="target\micros\rpi_pico_rp2040\startup\crt0.cpp" />
<ClCompile Include="target\micros\rpi_pico_rp2040\startup\crt0_init_ram.cpp" />
Expand Down
2 changes: 1 addition & 1 deletion ref_app/target.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -896,7 +896,7 @@
<ClCompile Include="target\micros\rpi_pico2_rp2350\startup\crt1.cpp">
<Filter>micros\rpi_pico2_rp2350\startup</Filter>
</ClCompile>
<ClCompile Include="target\micros\rpi_pico2_rp2350\startup\image_definition_block.c">
<ClCompile Include="target\micros\rpi_pico2_rp2350\startup\image_definition_block.cpp">
<Filter>micros\rpi_pico2_rp2350\startup</Filter>
</ClCompile>
<ClCompile Include="target\micros\rpi_pico2_rp2350\startup\int_vect.cpp">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#include <stdint.h>

extern "C"
const uint32_t __attribute__((section(".image_start_block"), used, aligned(4))) image_definition_block[] =
{
UINT32_C(0xFFFFDED3),
Expand Down

0 comments on commit 49a1fe9

Please sign in to comment.