Firmware: - bsp_usart: RX moved from RXDNE byte-queue IRQ to DMA CH2 circular ring (2KB) + IDLE-irq wakeup; bytes keep landing during flash-erase interrupt-off windows (the reason lockstep was needed before) - app_ota: stream mode (ble_protocol.md section 6.7) - 16B BEGIN with flags bit0=STREAM (UART channel only), DATA acked on 4KB sector crossings (original chunk length; two ack-gating bugs fixed during field test), throttled BAD_STATE for go-back-N - FreeRTOS heap 20KB->18KB: the 2KB ring pushed the stack top past the 0x2000C000 SRAM cliff (probed via SWD: accesses above fault on this silicon, usable app SRAM is 32KB) which locked the board at boot; merge_image.py now hard-fails the package when the image initial SP leaves (0x20004000, 0x2000C000] Tools: - ble_ota_update.py: UART stream sender (8KB window, stall watchdog rewind, auto-fallback to lockstep on pre-V1.00.24 firmware, --lockstep to force); case-insensitive option parsing - flash_package.py/bat: stream NSpyocd output live (chunked reads keep the \r progress bar), vendor banner rebranded to CAIIC NSLINK UMP - merge_image.py: initial-SP cliff guard Verified: UART stream OTA both directions, 55.8KB in ~5.9s @9.5kB/s 0 rewinds (lockstep was 39s), PASS after reboot; board boot fixed and verified via SWD. Docs: ble_protocol.md section 6.7, dev log section 47 (+ SRAM cliff post-mortem), AGENTS.md RAM rule rewritten (both cliffs) + V1.00.25
26 lines
891 B
Batchfile
26 lines
891 B
Batchfile
@echo off
|
|
rem ============================================================
|
|
rem flash_package.bat [image] - erase the chip and program the
|
|
rem merged package via NS-LINK (NSpyocd); thin wrapper over
|
|
rem flash_package.py (streams output with the CAIIC banner).
|
|
rem [image] optional, default: tools\out\mothercup_ble_prod.hex
|
|
rem Connect NS-LINK to SWD (PA4/PA5) and the reset pin first,
|
|
rem and CLOSE Keil (it holds the probe).
|
|
rem ============================================================
|
|
setlocal
|
|
|
|
set PYEXE=
|
|
python --version >nul 2>&1 && set PYEXE=python
|
|
if not defined PYEXE (
|
|
if exist "%LOCALAPPDATA%\Programs\Python\Python312\python.exe" (
|
|
set PYEXE="%LOCALAPPDATA%\Programs\Python\Python312\python.exe"
|
|
)
|
|
)
|
|
if not defined PYEXE (
|
|
echo python not found - install Python 3 or fix PATH
|
|
exit /b 1
|
|
)
|
|
|
|
%PYEXE% "%~dp0flash_package.py" %*
|
|
exit /b %ERRORLEVEL%
|