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

Complete sn32f2xx support, add functionality #5

Merged
merged 46 commits into from
Sep 14, 2024
Merged
Show file tree
Hide file tree
Changes from 28 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
40f1e00
add 290 support
dexter93 Jun 13, 2024
dfd004f
add 240C support
dexter93 Aug 23, 2024
9206e7e
abstract buffer size
dexter93 Aug 23, 2024
8c3fd32
abstract hid reports size from actual payload
dexter93 Aug 23, 2024
523b35e
rename commands to properly reflect ISP protocol
dexter93 Aug 23, 2024
7dbb528
v2.0.1
dexter93 Aug 24, 2024
4276fed
debug: print out verbose fails
dexter93 Aug 26, 2024
e841dc9
debug: try to print error states
dexter93 Aug 26, 2024
b444a43
correct cs location
dexter93 Aug 26, 2024
fe329aa
add better password checks
dexter93 Aug 26, 2024
cf2fc27
print out supported vid pid for known chips
dexter93 Aug 26, 2024
0eefacf
fail if chip version is not supported
dexter93 Aug 26, 2024
916e9c5
fix bad --offset argument reqs
dexter93 Sep 5, 2024
8f79b95
280: preliminary support
dexter93 Sep 5, 2024
58a43dd
erase: correct behavior
dexter93 Sep 5, 2024
f350501
add 280 series PID
dexter93 Sep 6, 2024
288e1a6
update buffer handling to send 64b always
dexter93 Sep 6, 2024
5608960
rename isp password check
dexter93 Sep 6, 2024
a23b8bd
slight cleanup
dexter93 Sep 6, 2024
f9670dd
v2.0.2 bump
dexter93 Sep 6, 2024
6b011f6
fix command offsets
dexter93 Sep 7, 2024
7b7a96c
introduce a mechanism to retry if busy
dexter93 Sep 7, 2024
af47949
file ops: do NOT keep it open until exit
dexter93 Sep 7, 2024
87e77f6
always cleanup on exit
dexter93 Sep 7, 2024
80cb4d1
document --noofset
dexter93 Sep 7, 2024
c920498
update the docs
dexter93 Sep 7, 2024
782c13e
standardize logging setup
dexter93 Sep 7, 2024
1ad3487
v2.0.3
dexter93 Sep 7, 2024
bbd493d
support sn32f220 and sn32f230
dexter93 Sep 10, 2024
1df4c8a
cleanup security level checks
dexter93 Sep 10, 2024
4cac294
fixup protocol checks for 240b and 260
dexter93 Sep 10, 2024
729c662
abstract page erase
dexter93 Sep 10, 2024
9d00b37
refactor cs reset
dexter93 Sep 10, 2024
42406c7
fixup buffer size handling in hid_get_feature
dexter93 Sep 10, 2024
e45924e
ensure we're checking the correct reply
dexter93 Sep 10, 2024
a16c308
add 220 and 230 pids, refactor pid check
dexter93 Sep 10, 2024
0380ae0
add flash erase verification
dexter93 Sep 10, 2024
4971ec4
add flash program checksum to verification
dexter93 Sep 10, 2024
9a23d7d
v2.0.4
dexter93 Sep 10, 2024
37f44e5
cleanup code option print
dexter93 Sep 13, 2024
f2ec3ed
speed up procedures
dexter93 Sep 13, 2024
4a9c052
update docs and pid tables
dexter93 Sep 13, 2024
1f9341c
persist while attempting to reboot to bootloader
dexter93 Sep 13, 2024
f83799c
add sonix reboot option
dexter93 Sep 14, 2024
d6c0516
exit if a program operation is already pending
dexter93 Sep 14, 2024
8f6d09a
v2.0.5
dexter93 Sep 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Sonix Flasher C

A CLI-based Flasher for Sonix 24x/26x MCUs.
A CLI-based Flasher for Sonix SN32F2xx MCUs.

## Description

Expand Down Expand Up @@ -39,6 +39,50 @@ make sonixflasher
./sonixflasher
```

#### Command List:

- `--vidpid -v` Set VID and PID for the device to flash.
- `--offset -o` Set flashing offset (default: 0).
- `--file -f` Binary of the firmware to flash (*.bin extension).
- `--jumploader -j` Define if flashing a jumploader.
- `--reboot -r` Request bootloader reboot in OEM firmware (options: evision, hfd).
- `--debug -d` Enable debug mode.
- `--list-vidpid -l` Display supported VID/PID pairs.
- `--nooffset -k` Disable offset checks.
- `--version -V` Print version information.
- `--help -h` Show this help message.

#### ISP Bootloader Mode Defaults:

+-----------------+--------+--------+
| Device | VID | PID |
+-----------------+--------+--------+
| SONIX SN32F26x | 0x0C45 | 0x7010 |
| SONIX SN32F24xB | 0x0C45 | 0x7040 |
| SONIX SN32F24xC | 0x0C45 | 0x7145 |
| SONIX SN32F24x | 0x0C45 | 0x7900 |
| SONIX SN32F28x | 0x0C45 | 0x7120 |
| SONIX SN32F29x | 0x0C45 | 0x7140 |
+-----------------+--------+--------+

Notice that some devices support flashing while booted. In that case, use
```
--reboot
```
to expose the ISP mode

## Usage Examples

- **Flash jumploader to device with VID/PID 0x0c45/0x7040:**

```
sonixflasher --vidpid 0c45/7040 --file fw.bin -j
```
- **Flash firmware to device with VID/PID 0x0c45/0x7040 and offset 0x200:**

```
sonixflasher --vidpid 0c45/7040 --file fw.bin -o 0x200
```

## License

Expand Down
Loading
Loading