Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[RSDK-8932] ota docs, local server #361

Merged
merged 15 commits into from
Dec 19, 2024
Merged
234 changes: 234 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ members = [
"micro-rdk-server",
"micro-rdk-ffi",
"examples/modular-drivers",
"etc/ota-server",
Copy link
Member

Choose a reason for hiding this comment

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

Let's call this "ota-dev-server" or "ota-test-server" to clarify that it isn't meant for production use.

Copy link
Member

Choose a reason for hiding this comment

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

Oh, forgot about this one. Please remember to rename this before merge.

Copy link
Member Author

Choose a reason for hiding this comment

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

yup, making those code changes now

]

default-members = [
Expand Down
11 changes: 7 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ upload: cargo-ver
cargo +esp espflash flash --package micro-rdk-server --monitor --partition-table micro-rdk-server/esp32/partitions.csv --baud 460800 -f 80mhz --bin micro-rdk-server-esp32 --target=xtensa-esp32-espidf -Zbuild-std=std,panic_abort

test:
cargo test -p micro-rdk --lib --features native
cargo test -p micro-rdk --lib --features native,ota

clippy-native:
cargo clippy -p micro-rdk --no-deps --features native -- -Dwarnings
cargo clippy -p micro-rdk --no-deps --features native,ota -- -Dwarnings

clippy-esp32:
cargo +esp clippy -p micro-rdk --features esp32,ota --target=xtensa-esp32-espidf -Zbuild-std=std,panic_abort -- -Dwarnings
Expand Down Expand Up @@ -99,12 +99,15 @@ doc-open:
size:
find . -name "esp-build.map" -exec ${IDF_PATH}/tools/idf_size.py {} \;

build-esp32-bin:
cargo +esp espflash save-image --package micro-rdk-server --merge --chip esp32 target/xtensa-esp32-espidf/micro-rdk-server-esp32.bin -T micro-rdk-server/esp32/partitions.csv -s 4mb --bin micro-rdk-server-esp32 --target=xtensa-esp32-espidf -Zbuild-std=std,panic_abort --release
build-esp32-bin: build-esp32-ota
acmorrow marked this conversation as resolved.
Show resolved Hide resolved
cargo +esp espflash save-image --package micro-rdk-server --features=ota --merge --chip esp32 target/xtensa-esp32-espidf/micro-rdk-server-esp32.bin -T micro-rdk-server/esp32/ota_8mb_partitions.csv -s 8mb --bin micro-rdk-server-esp32 --target=xtensa-esp32-espidf -Zbuild-std=std,panic_abort --release
Copy link
Member

Choose a reason for hiding this comment

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

These are getting really quite long, and there are some subtle differences between the two commands that are obscured by other minor variations. Could you please:

  • Go multi-line for these
  • Ensure the flag order between build-esp32-bin and build-esp32-ota is the same, and use the same form of each flag (-T vs --partition-table), and convert any short-form arguments (e.g. -s) into long form?
  • While you are here, could you add --skip-update-check as well?
build-esp32-ota:
        cargo +esp espflash save-image \
            --package micro-rdk-server \
            ...
            --partition-table micro-rdk-server/esp32/ota_8mb_partitions.csv \
            --flash-size 8mb

etc.


build-esp32-ota:
cargo +esp espflash save-image --package micro-rdk-server --features=ota --chip=esp32 ./target/xtensa-esp32-espidf/micro-rdk-server-esp32-ota.bin --bin=micro-rdk-server-esp32 --partition-table=micro-rdk-server/esp32/ota_8mb_partitions.csv --target=xtensa-esp32-espidf -Zbuild-std=std,panic_abort --release

serve-ota: build-esp32-ota
cargo r --package ota-server

flash-esp32-bin:
ifneq (,$(wildcard ./target/xtensa-esp32-espidf/micro-rdk-server-esp32.bin))
espflash write-bin 0x0 ./target/xtensa-esp32-espidf/micro-rdk-server-esp32.bin --baud 460800 && sleep 2 && espflash monitor
Expand Down
Loading
Loading