Flutter Android App: Fix STM32 Firmware Update Over USB-Serial

Заказчик: AI | Опубликовано: 30.12.2025
Бюджет: 1000 $

Fix STM32 Firmware Update in Flutter Android App - Boat Lift Controller Project Overview We have a Flutter Android application (Atlantis Dealer Tool Kit) that communicates with an STM32H743VIT6-based boat lift controller via USB-to-serial adapter. The app successfully reads/writes commands in text mode, but firmware updates fail to sync with the STM32 bootloader. What Works: Arduino IDE successfully uploads firmware to the same controller using the same USB connection and UPDATE button procedure. What Fails: Our Flutter app cannot sync with the STM32 bootloader (AN3155 protocol) - we get "Timeout waiting for ACK/NACK" with no response when sending 0x7F sync byte. The Problem When attempting to flash firmware via our app: 1. User presses physical UPDATE button on controller (enters STM32 bootloader mode) 2. App sends 0x7F sync byte repeatedly over UART (115200 baud, EVEN parity) 3. Expected: Bootloader responds with 0x79 (ACK) 4. Actual: Timeout - no response from bootloader Arduino IDE works perfectly with identical hardware and procedure. What We've Tried (All Failed) 1. ✗ Dart implementation using Flutter's usb_serial package with EVEN parity switching 2. ✗ Native Kotlin implementation using usb-serial-for-android library (same library Arduino IDE uses) 3. ✗ Proper timing sequence matching Arduino IDE (set parity before UPDATE button press) 4. ✗ Buffer clearing and null byte skipping 5. ✗ Multiple retry attempts with delays between attempts 6. ✗ Repeated 0x7F transmission for 3+ seconds 7. ✗ Extended timeouts (up to 30 seconds) 8. ✗ Various approaches to USB disconnect/reconnect sequences All attempts result in: "Timeout waiting for ACK/NACK" Requirements Must Have: - Expert knowledge of Android USB Host API - Experience with STM32 bootloader protocol (AN3155) - Flutter + native Android (Kotlin/Java) integration via method channels - Understanding of UART serial communication (baud rate, parity, stop bits) - Ability to debug why bootloader won't respond despite correct protocol implementation - Experience with usb-serial-for-android library or similar - Available to start immediately Nice to Have: - Experience with Arduino IDE's upload mechanism - Prior success implementing STM32 bootloader on Android - Knowledge of stm32flash or stm32loader command-line tools - Flutter plugin development experience - Experience debugging with USB protocol analyzers The Solution We Need Implement a working STM32 firmware update that: 1. Receives firmware binary from Flutter (Uint8List) 2. Opens USB device natively using Android USB Host API (or fixes existing USB connection) 3. Communicates with STM32 bootloader using correct settings (115200 baud, EVEN parity, 8N1) 4. Successfully flashes firmware following AN3155 protocol: - Send 0x7F, receive 0x79 (ACK) ← Fix this critical sync issue - GET command (bootloader version) - GET_ID command (chip ID) - EXTENDED_ERASE (mass erase) - WRITE_MEMORY (256-byte chunks) - GO command (jump to application) 5. Reports progress back to Flutter via EventChannel 6. Handles errors gracefully with clear error messages 7. Works reliably in the field (no Arduino IDE dependency) Approach is flexible: You can fix our existing Dart code, implement pure native Android code, use command-line tools (stm32flash/stm32loader), or any proven method that works. Deliverables 1. ✅ Working native Android code (Kotlin/Java) or fixed Dart implementation that successfully flashes STM32 firmware 2. ✅ Method channel integration with Flutter (if using native approach) 3. ✅ Progress callbacks streamed to Flutter UI via EventChannel 4. ✅ Comprehensive error handling with clear user-facing messages 5. ✅ Brief documentation explaining what was wrong and how you fixed it 6. ✅ Code integrated into our existing Flutter app 7. ✅ Tested and verified on actual hardware (we can provide remote testing access) Technical Details Hardware: - STM32H743VIT6 microcontroller - USB-to-serial adapter (CH340/CP2102/FTDI compatible) - Android tablet with USB-OTG support - User presses physical UPDATE button to enter bootloader mode Serial Settings: - Baud rate: 115200 - Parity: EVEN - Data bits: 8 - Stop bits: 1 Procedure (Same as Arduino IDE): 1. User presses UPDATE button on controller (enters bootloader mode) 2. App sends 0x7F sync byte over UART at 115200 baud, EVEN parity 3. Bootloader should respond with 0x79 (ACK) ← This never happens in our app 4. Flash process continues with GET, ERASE, WRITE, GO commands Current Codebase: - Flutter app with existing USB service (works for JSON text mode communication) - Partial Dart bootloader implementation (lib/services/stm32_bootloader_service.dart) - Partial native Kotlin implementation (android/app/src/main/kotlin/.../Stm32Bootloader.kt) - GitHub repo will be shared with selected freelancer STM32 Bootloader Protocol (AN3155): Full protocol documentation available at STMicroelectronics website. We've correctly implemented the protocol on paper, but something is preventing the initial ACK response. Budget $500-$1000 USD - negotiable based on experience and approach Timeline 1-2 weeks - prefer quick turnaround for field deployment To Apply Please include: 1. Your experience with Android USB Host API and STM32 bootloaders 2. Any previous STM32 or firmware update work (links to similar projects if available) 3. Your theory on why Arduino IDE works but our app doesn't 4. Your proposed approach to solve this (Dart fix, native Android, external tools, etc.) 5. Estimated timeline and availability 6. Any questions you have about the project Questions We'll Ask: - Have you successfully implemented STM32 bootloader communication on Android before? - Do you have access to STM32 hardware for testing? (We can provide remote access if needed) - What debugging tools/methods would you use to diagnose this sync failure? - Will you implement in Dart, native Android (Kotlin), or use external tools? - Have you worked with EVEN parity serial communication on Android? --- This is a paid project with potential for ongoing work on the app. We need someone who can dive deep, figure out why Arduino IDE succeeds where we fail, and implement a rock-solid solution that works in production.