Skip to content

Commit

Permalink
Anjay-zephyr-client 24.05
Browse files Browse the repository at this point in the history
Improvements:
- Adjusted `nrf9160dk_nrf9160_ns` build to meet new default target
- Reworked build system to use `sysbuild` for FOTA builds on upstream Zephyr and T-Mobile SDKs
  • Loading branch information
Kucmasz committed May 28, 2024
1 parent 05eeab0 commit 7432d3b
Show file tree
Hide file tree
Showing 41 changed files with 622 additions and 414 deletions.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
# Changelog

## 24.05 (May 28th, 2024)

### Improvements
- Adjusted `nrf9160dk_nrf9160_ns` build to meet new default target
- Reworked build system to use `sysbuild` for FOTA builds on upstream Zephyr and T-Mobile SDKs

## 24.02 (February 16th, 2024)

### Improvements
- Changed C stdlib to Picolibc (Zephyr's default) for most projects
- Added TF-M support for nRF7002 DK board (changed the board variant from `nrf7002dk_nrf5340_cpuapp` to `nrf7002dk_nrf5340_cpuapp_ns`)
- Added new parameter to specify log virtual port for factory provisioning script
- Updated Zephyr SDK to 0.16.4

## 23.11 (November 21st, 2023)

Expand Down
56 changes: 0 additions & 56 deletions bubblemaker/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -35,62 +35,6 @@ if(CONFIG_PARTITION_MANAGER_ENABLED)
message(FATAL_ERROR "${pm_missing_message}")
endif()

set(FOTA_BINARY_FILE "${CMAKE_CURRENT_BINARY_DIR}/zephyr/app_update.bin")
endif()
elseif(CONFIG_ANJAY_CLIENT_BUILD_MCUBOOT_AUTOMATICALLY)
if("${CONFIG_MCUBOOT_SIGNATURE_KEY_FILE}" STREQUAL "")
if(NOT CONFIG_MCUBOOT_GENERATE_UNSIGNED_IMAGE)
message(FATAL_ERROR "Either MCUBOOT_SIGNATURE_KEY_FILE or MCUBOOT_GENERATE_UNSIGNED_IMAGE need to be set in Kconfig")
endif()
else()
set(MCUBOOT_SIGNATURE_KEY_FILE "${CONFIG_MCUBOOT_SIGNATURE_KEY_FILE}")
if(NOT IS_ABSOLUTE "${MCUBOOT_SIGNATURE_KEY_FILE}")
set(MCUBOOT_SIGNATURE_KEY_FILE "${WEST_TOPDIR}/${MCUBOOT_SIGNATURE_KEY_FILE}")
endif()
endif()
make_directory("${CMAKE_CURRENT_BINARY_DIR}/mcuboot")
execute_process(COMMAND "${CMAKE_COMMAND}"
-GNinja
"-DAPPLICATION_CONFIG_DIR=${CMAKE_CURRENT_SOURCE_DIR}/child_image/mcuboot"
"-DBOARD=${BOARD}"
"-DCONF_FILE=${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr/prj.conf"
"-DCONF_FILE_INCLUDE_FRAGMENTS=ON"
"-DCONFIG_BOOT_SIGNATURE_KEY_FILE=\"${MCUBOOT_SIGNATURE_KEY_FILE}\""
"-DDTC_OVERLAY_FILE=${CMAKE_CURRENT_SOURCE_DIR}/child_image/mcuboot/boards/${BOARD}.overlay"
"${ZEPHYR_BASE}/../bootloader/mcuboot/boot/zephyr"
WORKING_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/mcuboot"
RESULT_VARIABLE MCUBOOT_CMAKE_RESULT)
if(NOT MCUBOOT_CMAKE_RESULT EQUAL 0)
message(FATAL_ERROR "Configuring MCUboot failed")
endif()

add_custom_target(mcuboot COMMAND "${CMAKE_COMMAND}" --build "${CMAKE_CURRENT_BINARY_DIR}/mcuboot")

# NOTE: This is largely copied from CMakeLists.txt in Zephyr itself.
# However, using that would require setting HEX_FILES_TO_MERGE *before*
# find_package(Zephyr), and we can't do that because we need to examine
# Kconfig variables, which are populated by find_package(Zephyr).
# That's why we do it ourselves here...
set(MERGED_HEX_NAME "${CMAKE_CURRENT_BINARY_DIR}/zephyr/merged.hex")
# In Zephyr 3.2, mergehex.py has been moved
# from scripts/mergehex.py to scripts/build/mergehex.py
set(MERGEHEX_SCRIPT "${ZEPHYR_BASE}/scripts/build/mergehex.py")
if(NOT EXISTS "${MERGEHEX_SCRIPT}")
set(MERGEHEX_SCRIPT "${ZEPHYR_BASE}/scripts/mergehex.py")
endif()
add_custom_command(OUTPUT "${MERGED_HEX_NAME}"
COMMAND "${PYTHON_EXECUTABLE}"
"${MERGEHEX_SCRIPT}"
-o "${MERGED_HEX_NAME}"
"${CMAKE_CURRENT_BINARY_DIR}/mcuboot/zephyr/zephyr.hex"
"${CMAKE_CURRENT_BINARY_DIR}/zephyr/zephyr.signed.hex"
DEPENDS mcuboot zephyr_final)
add_custom_target(mergehex ALL DEPENDS "${MERGED_HEX_NAME}")

if(TARGET runners_yaml_props_target)
get_target_property(RUNNERS_YAML_CONTENTS runners_yaml_props_target yaml_contents)
string(REGEX REPLACE "zephyr[a-zA-Z0-9._-]*[.]hex" "merged.hex" RUNNERS_YAML_CONTENTS "${RUNNERS_YAML_CONTENTS}")
set_property(TARGET runners_yaml_props_target PROPERTY yaml_contents "${RUNNERS_YAML_CONTENTS}")
endif()
endif()

Expand Down
12 changes: 0 additions & 12 deletions bubblemaker/Kconfig

This file was deleted.

9 changes: 8 additions & 1 deletion bubblemaker/boards/nrf9160dk_nrf9160_ns.conf
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ CONFIG_HEAP_MEM_POOL_SIZE=2048
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y
CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION="24.2.0"
CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION="24.5.0"

# Shell settings
CONFIG_SHELL_MINIMAL=y
Expand Down Expand Up @@ -85,3 +85,10 @@ CONFIG_WS2812_STRIP=y
CONFIG_SPI=y

CONFIG_GPIO=y

# External flash
CONFIG_SPI=y
CONFIG_SPI_NOR=y
CONFIG_SPI_NOR_FLASH_LAYOUT_PAGE_SIZE=4096
CONFIG_SPI_NOR_SFDP_DEVICETREE=y
CONFIG_PM_EXTERNAL_FLASH_MCUBOOT_SECONDARY=y
87 changes: 87 additions & 0 deletions bubblemaker/boards/nrf9160dk_nrf9160_ns_intflash.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,87 @@
# anjay-zephyr-client
CONFIG_ANJAY_ZEPHYR_DEVICE_MANUFACTURER="AVSystem"
CONFIG_ANJAY_ZEPHYR_MODEL_NUMBER="Bubblemaker"
CONFIG_ANJAY_ZEPHYR_GPS=n
CONFIG_ANJAY_ZEPHYR_GPS_NRF_A_GPS=n

CONFIG_ANJAY_ZEPHYR_FOTA=y

# Anjay Settings
CONFIG_ANJAY_COMPAT_ZEPHYR_TLS=y
CONFIG_ANJAY_COMPAT_NET=y
CONFIG_ANJAY_COMPAT_TIME=y
CONFIG_ANJAY_LOG_LEVEL_INF=y
CONFIG_ANJAY_WITH_NET_STATS=n
CONFIG_ANJAY_WITH_SENML_JSON=y
CONFIG_ANJAY_WITH_TRACE_LOGS=n
CONFIG_ANJAY_WITH_ACCESS_CONTROL=n

# General Settings
CONFIG_MAIN_STACK_SIZE=2048
CONFIG_SYSTEM_WORKQUEUE_STACK_SIZE=4096
CONFIG_LOG_RUNTIME_FILTERING=n
CONFIG_LOG_CMDS=n
CONFIG_LOG_MAX_LEVEL=3
CONFIG_HWINFO=n

# Networking
CONFIG_NET_NATIVE=n
CONFIG_NET_IF_MAX_IPV4_COUNT=2
CONFIG_NET_TCP_ISN_RFC6528=n
CONFIG_NET_LOG=n

# nRF LTE
CONFIG_NRF_MODEM_LIB=y
CONFIG_MODEM_INFO=y
CONFIG_LTE_LINK_CONTROL=y
CONFIG_LTE_NETWORK_MODE_LTE_M_GPS=y
CONFIG_LTE_AUTO_INIT_AND_CONNECT=n
CONFIG_LTE_NETWORK_TIMEOUT=600
CONFIG_NRF_CLOUD_GPS_LOG_LEVEL_INF=y

# Clock synchronization
CONFIG_DATE_TIME=y
CONFIG_DATE_TIME_UPDATE_INTERVAL_SECONDS=600
CONFIG_DATE_TIME_TOO_OLD_SECONDS=600
CONFIG_DATE_TIME_NTP_QUERY_TIME_SECONDS=5

# File system
CONFIG_FLASH_PAGE_LAYOUT=y
CONFIG_MPU_ALLOW_FLASH_WRITE=y
CONFIG_STREAM_FLASH=y

# Heap
CONFIG_HEAP_MEM_POOL_SIZE=2048

# MCUboot
CONFIG_BOOTLOADER_MCUBOOT=y
CONFIG_IMG_MANAGER=y
CONFIG_IMG_ERASE_PROGRESSIVELY=y
CONFIG_MCUBOOT_IMGTOOL_SIGN_VERSION="24.5.0"

# Shell settings
CONFIG_SHELL_MINIMAL=y
CONFIG_SHELL_WILDCARD=n
CONFIG_SHELL_VT100_COMMANDS=y
CONFIG_SHELL_VT100_COLORS=n
CONFIG_SHELL_STATS=n
CONFIG_SHELL_CMDS=n
CONFIG_SHELL_TAB=y
CONFIG_SHELL_TAB_AUTOCOMPLETION=y
CONFIG_SHELL_CMDS_RESIZE=n
CONFIG_DEVICE_SHELL=n
CONFIG_DATE_SHELL=n
CONFIG_DEVMEM_SHELL=n
CONFIG_MCUBOOT_SHELL=n
CONFIG_KERNEL_SHELL=y

# Bubblemaker
CONFIG_SENSOR=y
CONFIG_ADC=y
CONFIG_W1=y

CONFIG_LED_STRIP=y
CONFIG_WS2812_STRIP=y
CONFIG_SPI=y

CONFIG_GPIO=y
87 changes: 49 additions & 38 deletions bubblemaker/pm_static_nrf9160dk_nrf9160_ns.yml
Original file line number Diff line number Diff line change
@@ -1,24 +1,21 @@
EMPTY_0:
address: 0xf8000
end_address: 0xfe000
address: 0xfa000
end_address: 0x100000
placement:
after:
- mcuboot_scratch
- settings_storage
region: flash_primary
size: 0x6000
EMPTY_1:
address: 0xe0000
end_address: 0xe8000
placement:
after:
- mcuboot_secondary
region: flash_primary
size: 0x8000
app:
address: 0x18000
end_address: 0x78000
end_address: 0xe8000
region: flash_primary
size: 0x60000
size: 0xd0000
external_flash:
address: 0xd8000
end_address: 0x800000
region: external_flash
size: 0x728000
mcuboot:
address: 0x0
end_address: 0x10000
Expand All @@ -39,23 +36,22 @@ mcuboot_pad:
size: 0x200
mcuboot_primary:
address: 0x10000
end_address: 0x78000
end_address: 0xe8000
orig_span: &id001
- mcuboot_pad
- app
- tfm
- app
- mcuboot_pad
region: flash_primary
sharers: 0x1
size: 0x68000
size: 0xd8000
span: *id001
mcuboot_primary_app:
address: 0x10200
end_address: 0x78000
end_address: 0xe8000
orig_span: &id002
- app
- tfm
region: flash_primary
size: 0x67e00
size: 0xd7e00
span: *id002
mcuboot_scratch:
address: 0xe8000
Expand All @@ -68,34 +64,41 @@ mcuboot_scratch:
region: flash_primary
size: 0x10000
mcuboot_secondary:
address: 0x78000
end_address: 0xe0000
address: 0x0
device: DT_CHOSEN(nordic_pm_ext_flash)
end_address: 0xd8000
placement:
after:
- mcuboot_primary
align:
start: 0x8000
region: flash_primary
start: 0x4
region: external_flash
share_size:
- mcuboot_primary
size: 0x68000
size: 0xd8000
dfu_target_fmfu:
address: 0xd8000
device: DT_CHOSEN(nordic_pm_ext_flash)
end_address: 0x2d8000
placement:
after:
- mcuboot_secondary
region: external_flash
size: 0x200000
nonsecure_storage:
address: 0xfe000
end_address: 0x100000
orig_span: &id003
address: 0xf8000
end_address: 0xfa000
orig_span: &id004
- settings_storage
placement:
before:
- end
region: flash_primary
size: 0x2000
span: *id003
span: *id004
settings_storage:
address: 0xfe000
end_address: 0x100000
address: 0xf8000
end_address: 0xfa000
inside:
- nonsecure_storage
placement:
align:
start: 0x8000
before:
- end
region: flash_primary
Expand All @@ -110,12 +113,20 @@ tfm:
- app
region: flash_primary
size: 0x7e00
tfm_nonsecure:
address: 0x18000
end_address: 0xe8000
orig_span: &id008
- app
region: flash_primary
size: 0xd0000
span: *id008
tfm_secure:
address: 0x10000
end_address: 0x18000
orig_span: &id004
orig_span: &id009
- mcuboot_pad
- tfm
region: flash_primary
size: 0x8000
span: *id004
span: *id009
Loading

0 comments on commit 7432d3b

Please sign in to comment.