• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..--

README_hl78xx_fw_update.mdD29-Dec-20255.4 KiB171133

hl78xx_firmware_update_xmodem_1k.pyD29-Dec-202526.8 KiB639555

README_hl78xx_fw_update.md

1# HL78xx Modem Firmware Update Script
2
3## Overview
4Python script for updating Sierra Wireless HL78xx cellular modem firmware via XMODEM-1K protocol.
5
6## Requirements
7- Python 3.6 or later
8- pyserial: `pip install pyserial`
9- xmodem: `pip install xmodem`
10- Direct serial connection to modem UART
11
12## Supported Modems
13- Sierra Wireless HL7800
14- Sierra Wireless HL7802
15- Sierra Wireless HL7810
16- Other HL78xx variants
17
18## Usage
19
20### Direct Connection to Modem
21When connected directly to the modem UART:
22
23```bash
24python hl78xx_firmware_update_direct.py -p COM5 -f firmware.ua
25```
26
27### With Zephyr AT Client Bridge
28When using the Zephyr AT client sample as a bridge:
29
301. Flash the `at_client` sample to your board
312. Use the bridge version of the script (if available) or connect through the console port
32
33### Command Line Options
34```
35-p, --port PORT       Serial port (e.g., /dev/ttyUSB0, COM5) [required]
36-f, --firmware FILE   Firmware file path (.ua file) [required]
37-b, --baudrate BAUD   Baud rate (default: 115200)
38-t, --timeout SEC     Update timeout in seconds (default: 600)
39-v, --verbose         Enable verbose logging
40```
41
42## Examples
43
44### Linux
45```bash
46# Basic update
47python hl78xx_firmware_update_direct.py -p /dev/ttyUSB0 -f HL7800.4.6.7.0.ua
48
49# With verbose logging
50python hl78xx_firmware_update_direct.py -p /dev/ttyUSB0 -f firmware.ua -v
51
52# Custom timeout for slow connections
53python hl78xx_firmware_update_direct.py -p /dev/ttyUSB0 -f firmware.ua -t 900
54```
55
56### Windows
57```bash
58# Basic update
59python hl78xx_firmware_update_direct.py -p COM5 -f HL7800.4.6.7.0.ua
60
61# With verbose logging
62python hl78xx_firmware_update_direct.py -p COM5 -f firmware.ua -v
63```
64
65## Update Sequence
661. **Connect** - Opens serial port to modem
672. **Enable Indications** - Sends `AT+WDSI=?` to query supported ranges, then enables maximum value
683. **Initiate Download** - Sends `AT+WDSD=<filesize>`
694. **XMODEM Transfer** - Transfers firmware file using XMODEM-1K protocol with real-time progress bar
705. **Verify Download** - Waits for `OK` and `+WDSI: 3` confirmation
716. **Start Installation** - Sends `AT+WDSR=4`
727. **Monitor Installation** - Waits for `+WDSI: 14` (installation starting)
738. **Wait for Result** - Monitors for `+WDSI: 16` (success) or `+WDSI: 15` (failure)
74
75## WDSI Indications
76The script monitors these AT command indications:
77
78- `+WDSI: 3` - Firmware package downloaded successfully
79- `+WDSI: 14` - Installation starting (modem rebooting)
80- `+WDSI: 15` - Installation failed
81- `+WDSI: 16` - Installation successful
82
83**Note:** The modem sends these indications with a space after the colon (e.g., `+WDSI: 16`)
84
85## Firmware Files
86- Extension: `.ua` (Update Archive)
87- Type: Delta updates (upgrade from current version to target version)
88- Source: Contact Sierra Wireless or your distributor
89- Size: Typically 500KB - 5MB depending on update scope
90
91## Troubleshooting
92
93### "Port already in use"
94- Close any terminal applications connected to the modem
95- Check if ModemManager is running on Linux: `sudo systemctl stop ModemManager`
96
97### "Timeout waiting for XMODEM ready signal"
98- Verify modem is powered on and responding
99- Check baud rate matches modem configuration
100- Try sending `AT` command manually to verify connectivity
101- Use `-v` flag for verbose output to see what modem is sending
102
103### "XMODEM transfer failed"
104- Verify firmware file is not corrupted
105- Check serial connection stability
106- Increase timeout with `-t 900`
107- Some modems use checksum mode instead of CRC - script handles both
108
109### "Installation failed (+WDSI:15)"
110- Firmware file may be incompatible with current modem version
111- Insufficient flash space on modem
112- Verify you have the correct firmware file for your modem model
113
114## Technical Details
115
116### Progress Display
117During firmware transfer, the script displays a real-time progress bar:
118```
119Progress: [████████████░░░░░░░░░░░░░░░░░░] 40% (229,376/570,988 bytes) | 5.2 KB/s | ETA: 65s
120```
121- Visual progress bar (30 characters wide)
122- Percentage completed
123- Bytes transferred / total bytes
124- Current transfer rate (KB/s)
125- Estimated time to completion (ETA)
126- Updates every 1% on the same line
127
128### XMODEM Protocol
129- Uses XMODEM-1K with 1024-byte packets
130- Supports both CRC and checksum modes
131- Automatically detects modem's preferred mode based on ready signal
132
133### Serial Configuration
134- Baud rate: 115200 (default, configurable)
135- Data bits: 8
136- Parity: None
137- Stop bits: 1
138- Flow control: None
139
140### Timing
141- Download time: Varies by file size (~2-10 minutes typical)
142  - Progress bar shows: percentage, bytes transferred, transfer rate, and ETA
143  - Updates every 1% for real-time feedback
144- Installation time: 5-15 minutes
145- Total update time: 10-30 minutes typical
146
147## Integration with Zephyr
148
149This script is designed to work with the Zephyr RTOS `at_client` sample:
150
1511. Build and flash the AT client sample to your board
1522. The sample creates a transparent UART bridge
1533. Run this script connecting to the console UART
1544. AT commands and XMODEM data flow through the bridge to the modem
155
156See `samples/drivers/modem/at_client/` for the bridge application.
157
158## Error Codes
159- Exit 0: Update successful
160- Exit 1: Update failed or error occurred
161
162## License
163SPDX-License-Identifier: Apache-2.0
164Copyright (c) 2025 Netfeasa Ltd.
165
166## Support
167For issues or questions:
168- Modem-specific questions: Contact Sierra Wireless support
169- Script issues: Open issue in Zephyr project
170- Zephyr integration: See AT client sample documentation
171