Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ giga.upload.vid=0x2341
giga.upload.pid=0x0366
giga.upload.interface=0
giga.upload.use_1200bps_touch=true
giga.upload.use_pre_upload_check=true
giga.upload.wait_for_upload_port=true
giga.upload.native_usb=true
giga.upload.maximum_size=1966080
Expand Down
6 changes: 5 additions & 1 deletion loader/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ target_sources_ifdef(CONFIG_USB_DEVICE_STACK_NEXT app PRIVATE

FILE(GLOB app_sources *.c)
target_sources(app PRIVATE ${app_sources})
target_compile_definitions(app PUBLIC _XOPEN_SOURCE=700)

zephyr_compile_definitions(
-D_XOPEN_SOURCE=700
-DCONFIG_USB_CONFIGURATION_STRING_DESC=STRINGIFY\(BUILD_VERSION\)
)

target_link_libraries(app PUBLIC blobs)
2 changes: 2 additions & 0 deletions loader/prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -49,3 +49,5 @@ CONFIG_RTC=y
CONFIG_RTC_ALARM=y
CONFIG_RTC_UPDATE=y
CONFIG_RTC_CALIBRATION=y

CONFIG_USB_CONFIGURATION_STRING_DESC_ENABLE=y
4 changes: 4 additions & 0 deletions platform.txt
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,10 @@ tools.stm32flash.erase.pattern="{path}/{cmd}" {serial.port} -e 1024 -b 2400
# DFU_UTIL
#

tools.dfu-util.pre_cmd.linux={build.variant.path}/check_loader_version.sh
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On Windows should we have a .bat version of this script?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I hope to get rid of the script 😄 And replace with something cleaner

Copy link
Copy Markdown

@pillo79 pillo79 May 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is no need for a script, the version can be extracted earlier so it's available as a variable in the platform/board files.
However, if only there was a way to compare a string via the txt logic... 😇

tools.dfu-util.pre_upload_check.pattern="{pre_cmd}" {upload.port.properties.configuration}
tools.dfu-util.pre_upload.pattern="{path}/{cmd}" --device ,{bootloader.vid}:{bootloader.pid} -D "{runtime.platform.path}/firmwares/{bootloader.file}" -a{bootloader.interface} --dfuse-address={bootloader.address}

upload.dfuse=--dfuse-address={upload.address}:leave
bootloader.dfuse=--dfuse-address={bootloader.address}:leave

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash

Check failure on line 1 in variants/arduino_giga_r1_stm32h747xx_m7/check_loader_version.sh

View workflow job for this annotation

GitHub Actions / Scan code for licenses

Missing license and copyright information

DIR=$(dirname "$(readlink -f "$0")")
VERSION=$(grep "define BUILD_VERSION" ${DIR}/llext-edk/include/zephyr/include/generated/zephyr/version.h | cut -f3 -d " ")
if [ "$VERSION" != "$1" ]; then
echo "Loader version mismatch: expected $1, got $VERSION, reflashing loader"
exit 1
fi
exit 0
2 changes: 1 addition & 1 deletion west.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ manifest:
projects:
- name: zephyr
remote: arduino
revision: zephyr-arduino-v4.2.0
revision: zephyr-arduino-v4.2.0+iConfig
import:
name-allowlist:
- cmsis
Expand Down
Loading