taichunmin / chameleon-ultra.js

A JavaScript SDK for ChameleonUltra support Web Bluetooth API, Web Serial API and Node.js.
http://taichunmin.idv.tw/chameleon-ultra.js/
MIT License
26 stars 1 forks source link

feature: enter DFU and upgrade firmware #124

Closed taichunmin closed 3 months ago

taichunmin commented 3 months ago

refs

taichunmin commented 3 months ago

use https://nightly.link to download firmwares (CORS restriction)

Create a new repo to mirror firmwares: https://github.com/taichunmin/ChameleonUltra-releases

ref: https://github.com/GameTec-live/ChameleonUltraGUI/blob/main/chameleonultragui/lib/helpers/github.dart#L129

taichunmin commented 3 months ago

ChameleonUltra Normal BLE

advertisements data

BLE MAC: C2:3E:D9:74:88:1F
Device type: LE only
Advertising type: Legacy
Flags: GeneralDiscoverable, BrEdrNotSupported
Complete Local Name: ChameleonUltra
Complete List of 16-bit Service UUIDs: 0x180F
Complete List of 128-bit Service UUIDs: 0x6e400001-b5a3-f393-e0a9-e50e24dcca9e
// Raw Data
const advData = Buffer.from('0201060F094368616D656C656F6E556C74726103030F1811079ECADC240EE5A9E093F3A3B50100406E', 'hex')

Nordic UART Service (0x6e400001-b5a3-f393-e0a9-e50e24dcca9e)

- Service
  - Name: Nordic UART Service
  - UUID: 0x6e400001-b5a3-f393-e0a9-e50e24dcca9e
  - Primary Service
- RX Characteristic
  - Name: RX Characteristic
  - UUID: 6e400002-b5a3-f393-e0a9-e50e24dcca9e
  - Properties: Write, Write No Response
- TX Characteristic
  - Name: TX Characteristic
  - UUID: 6e400003-b5a3-f393-e0a9-e50e24dcca9e
  - Properties: Notify

ChameleonUltra DFU BLE

advertisements data

BLE MAC: C2:3E:D9:74:88:20
Device type: LE only
Advertising type: Legacy
Flags: GeneralDiscoverable, BrEdrNotSupported
Incomplete List of 16-bit Service UUIDs: 0xFE59
Complete Local Name: CU-881F
Manufacturer data (Bluetooth Core 4.1):
- Company: No Company ID <0xFFFF>
- 0xC23ED974881F00010100
- Normal BLE MAC: 0xC23ED974881F
// Raw Data
const advData = Buffer.from('020106030259FE080943552D383831460DFFFFFFC23ED974881F00010100', 'hex')

Secure DFU Service (0xFE59)

- Service
  - Name: Secure DFU Service
  - UUID: 0xFE59
  - Primary Service
- Control Point
  - Name: DFU Control Point
  - UUID: 8ec90001-f315-4f60-9fb8-838830daea50
  - Properties: Notify, Write
- Packet
  - Name: DFU Packet
  - UUID: 8ec90002-f315-4f60-9fb8-838830daea50
  - Properties: Write No Response