-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP CMakeLists for utils, platform, rtos
Main work by @nicka101. Also, by @shymega: - Add another `target_link_libraries` to util_sha256 This links to CMSIS and HAL libs. - Fixup Dockerfile for GCC ARM download, and tidy - Had to run `dos2unix` on some files. - Remove `*.cmake` from .gitignore This allows us to keep future CMake modules, for example, Corrosion. - Update devcontainer.json name - Move `.devcontainer/devcontainer.json` to root of repo Signed-off-by: Dom Rodriguez <[email protected]>
- Loading branch information
Showing
39 changed files
with
355 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,20 @@ | ||
{ | ||
"name": "Open PineBuds Pro - VS Code Development Environment", | ||
"name": "OpenPineBuds - Dev Environment", | ||
"build": { | ||
"dockerfile": "../Dockerfile", | ||
"context": ".." | ||
}, | ||
"extensions": [ | ||
"ms-vscode.cmake-tools", | ||
"ms-vscode.cpptools" | ||
], | ||
"customizations": { | ||
"vscode": { | ||
"extensions": [ | ||
"ms-vscode.cmake-tools", | ||
"ms-vscode.cpptools" | ||
] | ||
} | ||
}, | ||
"runArgs": [ | ||
"--privileged" | ||
], | ||
"userEnvProbe": "loginInteractiveShell", | ||
"remoteUser": "root" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,52 @@ | ||
FROM debian:bullseye-slim AS base | ||
|
||
FROM base AS rust_build | ||
|
||
LABEL org.opencontainers.image.authors = "Ben V. Brown <[email protected]>, Dom Rodriguez <[email protected]>" | ||
|
||
WORKDIR /usr/src | ||
ENV PATH="/root/.cargo/bin:$PATH" | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
bc \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
libudev-dev \ | ||
pkg-config \ | ||
&& curl https://sh.rustup.rs -sSf | bash -s -- -y \ | ||
&& git clone https://github.com/Ralim/bestool.git \ | ||
&& cd /usr/src/bestool/bestool/ \ | ||
&& cargo build --release | ||
|
||
FROM base as dev_env | ||
|
||
WORKDIR /usr/src | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
bash \ | ||
bc \ | ||
bzip2 \ | ||
curl \ | ||
ffmpeg \ | ||
clang-format \ | ||
git \ | ||
make \ | ||
tar \ | ||
xxd \ | ||
&& git config --global --add safe.directory /src \ | ||
&& mkdir -pv /src \ | ||
&& curl \ | ||
https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-$(arch)-linux.tar.bz2 | tar -xj -C /src/ | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
minicom \ | ||
sudo | ||
|
||
ENV PATH="${PATH}:/src/gcc-arm-none-eabi-9-2019-q4-major/bin" | ||
COPY --from=rust_build /usr/src/bestool/bestool/target/release/bestool /usr/local/bin/bestool | ||
COPY . /usr/src | ||
|
||
ENTRYPOINT ["/bin/bash"] | ||
FROM debian:bullseye-slim AS base | ||
|
||
FROM base AS rust_build | ||
|
||
LABEL org.opencontainers.image.authors = "Ben V. Brown <[email protected]>, Dom Rodriguez <[email protected]>" | ||
|
||
WORKDIR /usr/src | ||
ENV PATH="/root/.cargo/bin:$PATH" | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
bc \ | ||
build-essential \ | ||
curl \ | ||
git \ | ||
libudev-dev \ | ||
pkg-config \ | ||
&& curl https://sh.rustup.rs -sSf | bash -s -- -y \ | ||
&& git clone https://github.com/Ralim/bestool.git \ | ||
&& cd /usr/src/bestool/bestool/ \ | ||
&& cargo build --release | ||
|
||
FROM base as dev_env | ||
|
||
WORKDIR /usr/src | ||
|
||
RUN apt-get update \ | ||
&& apt-get install -y \ | ||
bash \ | ||
bc \ | ||
bzip2 \ | ||
clang-format \ | ||
cmake \ | ||
curl \ | ||
ffmpeg \ | ||
git \ | ||
make \ | ||
minicom \ | ||
sudo \ | ||
tar \ | ||
xxd \ | ||
&& git config --global --add safe.directory /usr/src \ | ||
&& mkdir -pv /usr/local/toolchains \ | ||
&& curl \ | ||
https://armkeil.blob.core.windows.net/developer/Files/downloads/gnu-rm/9-2019q4/gcc-arm-none-eabi-9-2019-q4-major-$(arch)-linux.tar.bz2 \ | ||
| tar -xj -C /usr/local/toolchains | ||
|
||
ENV PATH="${PATH}:/usr/local/toolchains/gcc-arm-none-eabi-9-2019-q4-major/bin" | ||
COPY --from=rust_build /usr/src/bestool/bestool/target/release/bestool /usr/local/bin/bestool | ||
COPY . /usr/src | ||
|
||
ENTRYPOINT ["/bin/bash"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,12 @@ | ||
add_subdirectory (apps) | ||
set(CHIP best2300p) | ||
set(CHIP_BEST2300P 1) | ||
set(CHIP_ID_LITERAL best2300p) | ||
|
||
add_compile_definitions(CHIP=${CHIP} CHIP_BEST2300P=${CHIP_BEST2300P} CHIP_ID_LITERAL=${CHIP_ID_LITERAL}) | ||
|
||
add_subdirectory(apps) | ||
add_subdirectory(utils) | ||
add_subdirectory(platform) | ||
add_subdirectory(rtos) | ||
|
||
include_directories (include) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
file (GLOB headers "*.h") | ||
file (GLOB sources "*.c*") | ||
|
||
add_library (apps_audiplayers_a2dpdecoder STATIC ${sources} ${headers}) | ||
add_library (apps_audioplayers_a2dpdecoder STATIC ${sources} ${headers}) | ||
target_link_libraries(apps_audioplayers_a2dpdecoder util_list) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
add_subdirectory(cmsis) | ||
add_subdirectory(drivers) | ||
add_subdirectory(hal) | ||
#add_subdirectory(main) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
file (GLOB headers "inc/*.h" "inc/ca/*.h" "*.h") | ||
file (GLOB sources "ca/*.c" "ca/*.S" "*.c*") | ||
|
||
add_compile_definitions(USAGE_FAULT=1 BUS_FAULT=1 MEM_FAULT=1) | ||
|
||
if(DSP_LIB) | ||
add_subdirectory(DSP_Lib) | ||
endif(DSP_LIB) | ||
|
||
add_library (platform_cmsis STATIC ${sources} ${headers}) | ||
set_property(TARGET platform_cmsis APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp") | ||
target_link_libraries(platform_cmsis platform_drivers_ana platform_drivers_codec platform_drivers_norflash) | ||
target_include_directories(platform_cmsis PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/inc/ca/ | ||
${CMAKE_CURRENT_SOURCE_DIR}/inc/ | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
add_subdirectory(ana) | ||
add_subdirectory(bt) | ||
add_subdirectory(btpcm) | ||
add_subdirectory(codec) | ||
add_subdirectory(norflash) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
file (GLOB headers "*.h" "${CHIP}/*.h") | ||
file (GLOB sources "*.c*" "${CHIP}/*.c") | ||
|
||
add_library (platform_drivers_ana STATIC ${sources} ${headers}) | ||
target_link_libraries(platform_drivers_ana platform_hal) | ||
target_include_directories(platform_drivers_ana PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CHIP}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
file (GLOB headers "*.h" "${CHIP}/*.h") | ||
file (GLOB sources "*.c*" "${CHIP}/*.c") | ||
|
||
add_library (platform_drivers_bt STATIC ${sources} ${headers}) | ||
target_link_libraries(platform_drivers_bt apps_common platform_drivers_ana utils_cqueue util_heap) | ||
target_include_directories(platform_drivers_bt PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CHIP}) | ||
target_include_directories(platform_drivers_bt PRIVATE | ||
${CMAKE_SOURCE_DIR}/services/nvrecord | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
file (GLOB headers "*.h") | ||
file (GLOB sources "*.c*") | ||
|
||
add_library (platform_drivers_btpcm STATIC ${sources} ${headers}) | ||
target_include_directories(platform_drivers_btpcm PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_link_libraries(platform_drivers_btpcm rtos) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
file (GLOB headers "*.h" "${CHIP}/*.h") | ||
file (GLOB sources "*.c*" "${CHIP}/*.c") | ||
|
||
add_library (platform_drivers_codec STATIC ${sources} ${headers}) | ||
target_link_libraries(platform_drivers_codec platform_drivers_ana) | ||
target_include_directories(platform_drivers_codec PUBLIC ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${CHIP}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
file (GLOB headers "*.h") | ||
file (GLOB sources "*.c*") | ||
|
||
add_library (platform_drivers_norflash STATIC ${sources} ${headers}) | ||
target_link_libraries(platform_drivers_norflash util_boot_struct) | ||
target_include_directories(platform_drivers_norflash PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_include_directories(platform_drivers_norflash PRIVATE | ||
${CMAKE_SOURCE_DIR}/services/nvrecord | ||
${CMAKE_SOURCE_DIR}/tests/programmer/inc | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
file (GLOB headers "*.h") | ||
file (GLOB sources "*.c*") | ||
|
||
add_library (platform_hal STATIC ${sources} ${headers}) | ||
target_link_libraries(platform_hal platform_drivers_ana platform_cmsis util_crash_catcher platform_drivers_norflash util_boot_struct) | ||
target_include_directories(platform_hal PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) | ||
target_include_directories(platform_hal PRIVATE | ||
${CMAKE_SOURCE_DIR}/platform/drivers/spi_norflash/ | ||
${CMAKE_SOURCE_DIR}/tests/programmer/inc/ | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
|
||
set(KERNEL "rtx") | ||
|
||
if(KERNEL STREQUAL "rtx5") #RTX5 | ||
file (GLOB headers "rtx5/*.h" "rtx_config/*.h") | ||
file (GLOB sources "rtx5/*.c*" "rtx_config/*.c*") | ||
else() #RTX | ||
file (GLOB headers "rtx/TARGET_CORTEX_M/*.h") | ||
file (GLOB sources "rtx/TARGET_CORTEX_M/*.c*" "rtx/TARGET_CORTEX_M/TARGET_M4/TOOLCHAIN_GCC/*.S") | ||
endif() | ||
|
||
add_library (rtos STATIC ${sources} ${headers}) | ||
target_link_libraries(rtos platform_cmsis platform_hal util_hwtimer_list) | ||
|
||
if(KERNEL STREQUAL "rtx5") #RTX5 | ||
target_include_directories(rtos PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/rtx5/ | ||
${CMAKE_CURRENT_SOURCE_DIR}/rtx5/rtx_config/ | ||
) | ||
else() #RTX | ||
set_property(TARGET rtos APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp") | ||
target_include_directories(rtos PUBLIC | ||
${CMAKE_CURRENT_SOURCE_DIR}/rtx/TARGET_CORTEX_M/ | ||
) | ||
endif() | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
add_subdirectory(boot_struct) | ||
#add_subdirectory(build_info) | ||
add_subdirectory(cqueue) | ||
add_subdirectory(crash_catcher) | ||
add_subdirectory(crc16) | ||
add_subdirectory(crc32) | ||
add_subdirectory(encrypt) | ||
add_subdirectory(heap) | ||
add_subdirectory(hexdump) | ||
add_subdirectory(hwtimer_list) | ||
add_subdirectory(intersyshci) | ||
add_subdirectory(kfifo) | ||
#add_subdirectory(libc) | ||
add_subdirectory(list) | ||
add_subdirectory(lockcqueue) | ||
add_subdirectory(retention_ram) | ||
#add_subdirectory(rom_utils) | ||
#add_subdirectory(sha256) | ||
add_subdirectory(xyzmodem) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
file (GLOB headers "*.h") | ||
file (GLOB sources "*.c*") | ||
|
||
add_library (util_boot_struct STATIC ${sources} ${headers}) | ||
target_link_libraries(util_boot_struct platform_hal) | ||
target_include_directories(util_boot_struct PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
file (GLOB headers "*.h") | ||
file (GLOB sources "*.c*") | ||
|
||
add_library (util_cqueue STATIC ${sources} ${headers}) | ||
target_link_libraries(util_cqueue platform_cmsis) | ||
target_include_directories(util_cqueue PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
file (GLOB headers "*.h" "include/*.h") | ||
file (GLOB sources "*.c*") | ||
|
||
set_property(SOURCE CrashCatcher_armv7m.S APPEND PROPERTY COMPILE_OPTIONS "-x" "assembler-with-cpp") | ||
add_library (util_crash_catcher STATIC ${sources} ${headers} CrashCatcher_armv7m.S) | ||
target_link_libraries(util_crash_catcher platform_cmsis utils_xyzmodem) | ||
target_include_directories(util_crash_catcher PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}/include/) | ||
target_include_directories(util_crash_catcher PRIVATE | ||
${CMAKE_SOURCE_DIR}/utils/libc/inc | ||
${CMAKE_SOURCE_DIR}/services/nv_section/log_section/ | ||
${CMAKE_SOURCE_DIR}/rtos/rtx/TARGET_CORTEX_M/ | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
add_library(util_crc16 STATIC "crc16.c" "crc16.h") | ||
target_include_directories(util_crc16 PUBLIC ${CMAKE_CURRENT_SOURCE_DIR}) |
Oops, something went wrong.