diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index c06a1aa..b52a577 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -46,5 +46,5 @@ jobs: cd ${{ matrix.sample.path }} echo 'CONFIG_BLYNK_TEMPLATE_ID="TMPLxxxxxxxxx"' >> prj.conf echo 'CONFIG_BLYNK_TEMPLATE_NAME="Test Device"' >> prj.conf - ./build.sh ${{ matrix.sample.board }} + ./build.sh ${{ matrix.sample.board }} ${{ matrix.zephyr_ver }} diff --git a/docs/samples/basic/Raspberry_Pi_Pico_with_ESP8266_Shield.md b/docs/samples/basic/Raspberry_Pi_Pico_with_ESP8266_Shield.md index a3d3ccb..1550d59 100644 --- a/docs/samples/basic/Raspberry_Pi_Pico_with_ESP8266_Shield.md +++ b/docs/samples/basic/Raspberry_Pi_Pico_with_ESP8266_Shield.md @@ -78,7 +78,7 @@ Wrote 56320 bytes to zephyr.uf2 > [!NOTE] > You will need an external programmer like `Segger JLink` or `PicoProbe`. -> We were unable to flash the board properly using miltiple `UF2` files (one for MCUboot and one for the main firmware). +> We were unable to flash the board properly using multiple `UF2` files (one for MCUboot and one for the main firmware). > Read more about [flashing the Pi Pico with Zephyr](https://docs.zephyrproject.org/latest/boards/arm/rpi_pico/doc/index.html#flashing) ```sh @@ -95,7 +95,7 @@ west flash --runner jlink > [!WARNING] > When assembling the board, ensure that all USB ports are disconnected from any components, and that there is no power supply connected. -1. Connect Pico-ESP8266 shield to the Raspberry Pi Pico. +1. Connect Pico-ESP8266 shield to the Raspberry Pi Pico. **Important**: The silkscreened USB port representation on the shield should be properly aligned with the actual USB port on the Raspberry Pi Pico. 2. Connect your device using USB. The device will appear as a `CDC-ACM` serial. 3. Use your favourite serial terminal software (`PuTTY`, `minicom`, `screen`) to access the serial console (`115200 8N1`). diff --git a/samples/basic/multiple b/samples/basic/multiple new file mode 100644 index 0000000..e69de29 diff --git a/samples/basic/prj.conf b/samples/basic/prj.conf index ac644b2..06bcd7e 100644 --- a/samples/basic/prj.conf +++ b/samples/basic/prj.conf @@ -22,4 +22,3 @@ CONFIG_IMG_MANAGER=y CONFIG_MPU_ALLOW_FLASH_WRITE=y CONFIG_HEAP_MEM_POOL_SIZE=2048 - diff --git a/samples/without_ota/CMakeLists.txt b/samples/without_ota/CMakeLists.txt index 2e2d065..51005c4 100644 --- a/samples/without_ota/CMakeLists.txt +++ b/samples/without_ota/CMakeLists.txt @@ -52,6 +52,7 @@ ExternalProject_Add( INSTALL_COMMAND "" # This particular build system has no install command BUILD_BYPRODUCTS ${BLYNK_NCP_DIR}/libblynkncp.a DEPENDS zephyr_interface + DEPENDS offsets_h ) # Create a wrapper CMake library that our app can link with @@ -69,3 +70,4 @@ set_target_properties(blynk_ncp_lib PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${ target_link_libraries(app PUBLIC blynk_ncp_lib) target_link_libraries(blynk_ncp_lib INTERFACE kernel) + diff --git a/samples/without_ota/boards/stm32f030_demo.conf b/samples/without_ota/boards/stm32f030_demo.conf index b310e8b..8d57e61 100644 --- a/samples/without_ota/boards/stm32f030_demo.conf +++ b/samples/without_ota/boards/stm32f030_demo.conf @@ -1,3 +1,4 @@ + # Copyright (c) 2024 Blynk Technologies Inc. # SPDX-License-Identifier: Apache-2.0 diff --git a/samples/without_ota/build.sh b/samples/without_ota/build.sh index 5a30efd..ded189f 100755 --- a/samples/without_ota/build.sh +++ b/samples/without_ota/build.sh @@ -1,18 +1,67 @@ #!/bin/sh set -e +BOARD=$1 +ZEPHYR_VERSION=$2 +if [ -z "$BOARD" ]; then + echo "Usage: $0 [ZEPHYR_VERSION]" + exit 1 +fi +# Fallback to default version +if [ -z "$ZEPHYR_VERSION" ]; then + ZEPHYR_VERSION="v0.0.0" + shift 1 +else + shift 2 +fi +echo "Building for board: $BOARD" +echo "Zephyr version: $ZEPHYR_VERSION" +version_gte() { + [ "$(printf '%s\n%s' "$1" "$2" | sort -V | head -n1)" = "$2" ] +} -export BOARD=$1 -shift - +CONF_FILE="" case $BOARD in - adafruit_feather_m0_basic_proto|arduino_uno_r4_minima) - west build -p -b ${BOARD} -- \ - -DEXTRA_CONF_FILE=$(pwd)/boards/adafruit_airlift.conf ${@} - ;; - stm32f030_demo) - west build -p -b ${BOARD} - ;; - *) # Invalid option - echo "Error: Invalid option" - exit 1 + adafruit_feather_m0_basic_proto|arduino_uno_r4_minima) + CONF_FILE="$(pwd)/boards/adafruit_airlift.conf" + ;; + stm32f030_demo) + CONF_FILE="$(pwd)/boards/stm32f030_demo.conf" + + # Backup original stm32f030_demo.conf if it doesn't exist + if [ ! -f "boards/stm32f030_demo.conf.backup" ]; then + cp boards/stm32f030_demo.conf boards/stm32f030_demo.conf.backup + fi + + # Restore original stm32f030_demo.conf + cp boards/stm32f030_demo.conf.backup boards/stm32f030_demo.conf + + # Add legacy configs for versions before 3.5.0 + if ! version_gte "$ZEPHYR_VERSION" "v3.5.0"; then + echo "Adding legacy configuration options to stm32f030_demo.conf for Zephyr version < 3.5.0" + echo "" >> boards/stm32f030_demo.conf + echo "# Legacy configs for Zephyr < 3.5.0" >> boards/stm32f030_demo.conf + echo "CONFIG_ISR_TABLES_LOCAL_DECLARATION=y" >> boards/stm32f030_demo.conf + echo "CONFIG_LTO=y" >> boards/stm32f030_demo.conf + else + echo "Using clean stm32f030_demo.conf for Zephyr version >= 3.5.0 (no legacy configs)" + fi + ;; esac + +# Single build command with appropriate configuration +if [ -n "$CONF_FILE" ]; then + echo "Using CONF_FILE: $CONF_FILE" + west build -p -b "$BOARD" -- -DEXTRA_CONF_FILE="$CONF_FILE" -DKCONFIG_WARN_UNDEF_ASSIGN=n "$@" +else + echo "No extra CONF_FILE used." + west build -p -b "$BOARD" -- -DKCONFIG_WARN_UNDEF_ASSIGN=n "$@" +fi + +# Restore original stm32f030_demo.conf after build (only if it was modified) +if [ "$BOARD" = "stm32f030_demo" ]; then + echo "Restoring original stm32f030_demo.conf" + cp boards/stm32f030_demo.conf.backup boards/stm32f030_demo.conf + echo "Removing backup file" + rm boards/stm32f030_demo.conf.backup +fi + diff --git a/tests/west_main.yaml b/tests/west_main.yaml index eeaffdf..b905276 100644 --- a/tests/west_main.yaml +++ b/tests/west_main.yaml @@ -13,9 +13,13 @@ manifest: import: name-allowlist: - cmsis + - cmsis-dsp + - cmsis-nn + - cmsis_6 - hal_stm32 - hal_rpi_pico - hal_atmel + - hal_renesas - mcuboot - mbedtls