45 lines
571 B
Plaintext
Executable File
45 lines
571 B
Plaintext
Executable File
|
|
uint8_t bootloader(FILE *stream);
|
|
|
|
Starten der Bootloader Logik.
|
|
|
|
Funktion:
|
|
|
|
|
|
|
|
Wiederhole bis zu 10mal:
|
|
Sende Bootloader Kennung auf <stream>
|
|
Warte 100ms
|
|
Antwort erhalten
|
|
Ja: Kommandoschleife
|
|
|
|
Kommandoschleife:
|
|
Lese <cmd>
|
|
...
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Protokoll:
|
|
|
|
<cmd> <len> *[ <data> ] <chk>
|
|
|
|
cmd: Byte 0x00 Noop
|
|
|
|
0x10 Erase Application Code
|
|
0x11 Send up to 16 Bytes to be flashed to application section
|
|
0x12 Set Flash Pointer
|
|
0x18 retrieve flash parameters (size, pagesize)
|
|
|
|
0x40 bootloader reply
|
|
|
|
0x2A Bootloader ID
|
|
0xA2 Bootloader ID-Reply
|
|
|
|
|
|
|
|
|