feat(arduino): flash verified Hana Cloud firmware in-app - #1
Merged
owjs3901 merged 23 commits intoAug 24, 2026
Merged
Conversation
Serialize firmware events as camelCase deviceId and reset the Uno at 1200 baud so avrdude talks to the bootloader instead of the running sketch.
A second 1200-baud pulse before avrdude made the bootloader miss the sync window. Keep the port free and let Arduino CLI reset the board once.
avrdude occasionally misses the 8-second bootloader window and reports programmer is not responding even though the bundled CLI uploads fine standalone. Retry the upload up to three times, rediscovering the port between attempts.
Closing the settings window (including onboarding finish) now restores the floating overlay, so a first-run user lands directly in scanning instead of a blank desktop.
Waiting/connecting/reconnecting states no longer rewrite the overlay status line, so the four scan cells never shift while the switch link is being established. Interval adaptation notices (e.g. 최근 반응이 빨라져) keep their seat.
설치 흐름을 hana-registry 조회 → hex 다운로드·검증 → 자체 플래싱으로 전환한다. 번들 arduino-cli 사이드카와 개발기 절대경로 스케치 픽스처는 제거된다. - registry.rs: 레지스트리 클라이언트. 호스트 고정·리다이렉트 금지, 용량 제한, 5초 타임아웃, SHA-256 검증 후 last-known-good 캐시. VID/PID는 u16 라운드트립 비교, descriptor 별칭은 NFKC 정규화 계약 (레지스트리 테스트 벡터 통과) 적용. - flasher.rs: Intel HEX 파서와 STK500v1(optiboot) 업로더. 청크마다 word 주소를 증가시키는 주소 커서, 헤더 합 wrapping 체크섬, ATmega328P 서명 검증. 전체 세션을 가짜 시리얼로 프레임 단위 테스트. - firmware.rs: VID/PID 필터 제거(등록 판단은 레지스트리), Generic CDC product 폴백으로 알려진 보드명 복원, Verify 단계 부팅 재시도 윈도우, downloadFailed 에러 코드 추가. - arduino.rs: installer_lease_alive 플래그로 살아있는 임대만 중복 거부 — Setup 모드에서 설치 시작이 거부되던 회귀 수정. - tauri.conf.json: externalBin 제거, binaries/ 삭제. 실기기 검증: Uno R3에서 빈 스케치 → 설치 → HANBEON_UNO_V1 핸드셰이크 및 스위치 입력 73건 정상 처리 확인.
Cargo.toml은 reqwest(app_registry)와 ureq(registry 보드 펌웨어)를 병행 하고, lib.rs는 양쪽 모듈을 모두 등록한다. asFirmwareState는 구버전 snake_case device_id 입력도 받되 정규화 후 camelCase만 남긴다(소비자 단일 계약). 병합 후 Rust 170 테스트, TS 38 테스트 통과, clippy·typecheck 클린.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
registry.json과 대조합니다.dev-five-git/hana-cloud의 보드 manifest와 컴파일된 Intel HEX를 내려받아 SHA-256, 크기, schema, board id, FQBN을 검증합니다.Safety and cross-platform fixes
0xFF로 채워 각 페이지를 한 번만 기록합니다./dev/cu.*필터를 macOS에만 한정해 Linux/dev/ttyACM*,/dev/ttyUSB*가 정상 인식됩니다.Verification
cargo test --workspace: 180 unit + 34 integration tests passedcargo clippy --workspace --all-targets -- -D warnings: passedcargo fmt --all -- --check: passedbun test: 70 passedbun run typecheck: passedbun run build: desktop/admin production builds passedarduino-uno-r3.hex: declared/actual size 11,211 bytes and SHA-256b177f39bd3dcbbb817b853ba594796d69644e6ce407456f0ce0005b35bd149f1verified