[WIRE-10] Make ota error codes homogeneous and board specific
pennam opened this issue · 0 comments
pennam commented
This issue will resume the WIP on this issue and related PR:
ESP32
- #389
- arduino-libraries/Arduino_ESP32_OTA#16
- arduino-libraries/Arduino_ESP32_OTA#19
- arduino-libraries/Arduino_ESP32_OTA#24
Value | Description | |
---|---|---|
None | 0 | No Error |
NoOtaStorage | -302 | Partition table is not compatible with OTA #19 |
OtaStorageInit | -303 | Failure initializing OTA storage. Check partition table |
OtaHeaderLength | -305 | OTA header length field do not match http content length |
OtaHeaderCrc | -306 | OTA header CRC32 mismatch |
OtaHeaterMagicNumber | -307 | Wrong magic number in OTA header |
ParseHttpHeader | -308 | Error parsing http Header. Parsing occurs to check Http response and content length |
UrlParseError | -309 | Unknown url type not http nor https |
ServerConnectError | -310 | Cannot connect to download server |
HttpHeaderError | -311 | Cannot download http Header |
OtaDownload | -312 | Downloaded file size not matching http Content-Length |
OtaHeaderTimeout | -313 | Timeout downloading OTA Header |
HttpResponse | -314 | Received http response different from 200 OK |
OtaStorageEnd | -315 | Error writing configuration to bootloader. Can be extended calling Update.getError() |
SAMD
Error codes are coming from NINA-FW
Error | Value | Description |
---|---|---|
None | 0 | No Error |
OtaHeaderCrc | -206 | OTA header CRC32 mismatch |
OtaDownload | -212 | OTA file size do not match OTA header length field |
OpenUpdateFile | -219 | Cannot create file to download update. fopen() failure |
Rename | -223 | Error renaming file before starting OTA. rename() failure |
Other error codes can be added checking and extending downloadAndSaveFile(...)
RP2040 Connect
Error | Value |
---|---|
None | 0 |
StorageInit | -103 |
ParseHttpHeader | -108 |
UrlParse | -109 |
ServerConnect | -110 |
HttpHeader | -111 |
HttpResponse | -114 #392 |
HttpData | -102 |
OpenUpdateFile | -119 |
WriteUpdateFile | -120 |
Reformat | -121 |
Unmount | -122 |
UNO WiFi R4
Error | Value |
---|---|
None | 0 |
NoOtaStorage | -402 |
OtaStorageInit | -403 |
OtaHeaderLength | -405 |
OtaHeaderCrc | -406 |
OtaHeaderMagicNumber | -407 |
ParseHttpHeader | -408 |
UrlParse | -409 |
ServerConnect | -410 |
HttpHeader | -411 |
OtaDownload | -412 |
OtaHeaderTimeout | -413 |
HttpResponse | -414 |
OtaStorageEnd | -415 |
StorageConfig | -416 |
Library | -417 |
Modem | -418 |
TODO check flasher errors
| OtaFlash | -412 |
STM32H7
Value | Description | |
---|---|---|
NoCapableBootloader | -1 | Bootloader version cannot handle OTA |
NoOtaStorage | -2 | Defined but not used |
OtaStorageInit | -3 | Cannot initialize OTA storage |
OtaStorageOpen | -4 | Cannot open OTA file for download |
OtaHeaderLength | -5 | OTA header length field do not match http content length |
OtaHeaderCrc | -6 | OTA header CRC32 mismatch |
OtaHeaterMagicNumber | -7 | Wrong magic number in OTA header |
- mbed download error codes : https://os.mbed.com/docs/mbed-os/v6.16/mbed-os-api-doxy/nsapi__types_8h_source.html
Summary As is
ESP32 | UNO WiFi R4 | STM32H7 | RP2040 | SAMD21 | |
---|---|---|---|---|---|
None | 0 | 0 | 0 | 0 | 0 |
NoCapableBootloader | NA | NA | -1 | NA | NA |
StorageConfig | NA | -401 | NA | NA | NA |
NoOtaStorage | -302 | -402 | -2 Defined but not used | NA | NA |
OtaStorageInit | -303 | -403 | -3 | ErrorFlashInit -107 | NA |
OtaStorageOpen | NA | NA | -4 | NA | NA |
OtaStorageEnd | -304 | -404 | NA | NA | NA |
UrlParseError | -305 | -405 | NA | -100 | NA |
ServerConnectError | -306 | -406 | NA | -101 | NA |
HttpHeaderError | -307 | -407 | NA | -102 | NA |
ParseHttpHeader | -308 | -408 | NA | -106 | NA |
OtaHeaderLength | -309 | -409 | -5 | NA | NA |
OtaHeaderCrc | -310 | -410 | -6 | NA | -203 |
OtaHeaterMagicNumber | -311 | -411 | -7 | NA | NA |
OtaDownload | -312 | -412 | NA | HttpDataError -103 | -202 |
OtaHeaderTimeout | -313 | -413 | NA | NA | NA |
HttpResponse | -314 | -414 | NA | NA | NA |
ErrorOpenUpdateFile | NA | NA | NA | -104 | -201 |
ErrorWriteUpdateFile | NA | NA | NA | -105 | NA |
ErrorReformat | NA | NA | NA | -108 | NA |
ErrorUnmount | NA | NA | NA | -109 | NA |
Errorrename | NA | NA | NA | NA | -204 |
Summary To Be
ESP32 | UNO WiFi R4 | STM32H7 | RP2040 | SAMD21 | |
---|---|---|---|---|---|
None | 0 | 0 | 0 | 0 | 0 |
NoCapableBootloader | NA | NA | -1 | NA | NA |
NoOtaStorage | -302 | -402 | -2 | NA | NA |
OtaStorageInit | -303 | -403 | -3 | -103 | NA |
OtaStorageOpen | NA | NA | -4 | NA | NA |
OtaHeaderLength | -305 | -405 | -5 | NA | NA |
OtaHeaderCrc | -306 | -406 | -6 | NA | -206 |
OtaHeaterMagicNumber | -307 | -407 | -7 | NA | NA |
ParseHttpHeader | -308 | -408 | NA | -108 | NA |
UrlParseError | -309 | -409 | NA | -109 | NA |
ServerConnectError | -310 | -410 | NA | -110 | NA |
HttpHeaderError | -311 | -411 | NA | -111 | NA |
OtaDownload | -312 | -412 | NA | -112 | -212 |
OtaHeaderTimeout | -313 | -413 | NA | NA | NA |
HttpResponse | -314 | -414 | NA | -114 | NA |
OtaStorageEnd | -315 | -415 | NA | NA | NA |
StorageConfig | NA | -416 | NA | NA | NA |
Library | NA | -417 | NA | NA | NA |
Modem | NA | -418 | NA | NA | NA |
ErrorOpenUpdateFile | NA | NA | NA | -119 | -219 |
ErrorWriteUpdateFile | NA | NA | NA | -120 | NA |
ErrorReformat | NA | NA | NA | -121 | NA |
ErrorUnmount | NA | NA | NA | -122 | NA |
ErrorRename | NA | NA | NA | NA | -223 |