Midnight Sun Firmware
Loading...
Searching...
No Matches
fota_error.h
1#pragma once
2
3/************************************************************************************************
4 * @file fota_error.h
5 *
6 * @brief Error codes for firmware over the air (FOTA) updates
7 *
8 * @date 2025-04-03
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11
12/* Standard library Headers */
13
14/* Inter-component Headers */
15
16/* Intra-component Headers */
17
27typedef enum FotaError {
37 FOTA_ERROR_FLASH_WRITE_FAILED,
38 FOTA_ERROR_FLASH_WRITE_OUT_OF_BOUNDS,
39 FOTA_ERROR_FLASH_WRITE_NOT_ALIGNED,
40 FOTA_ERROR_FLASH_READ_FAILED,
41 FOTA_ERROR_FLASH_ERASE,
42 FOTA_ERROR_FLASH_VERIFICATION_FAILED,
43
44 FOTA_ERROR_INVALID_PACKET,
45
46 // DFU errors
47 FOTA_ERROR_BOOTLOADER_SUCCESS,
48 FOTA_ERROR_BOOTLOADER_INVALID_STATE,
49 FOTA_ERROR_BOOTLOADER_UNINITIALIZED,
50 FOTA_ERROR_BOOTLOADER_INVALID_DATAGRAM,
51 FOTA_ERROR_BOOTLOADER_WRITE_IN_PROGRESS,
52 FOTA_ERROR_BOOTLOADER_FAILURE,
53 FOTA_ERROR_BOOTLOADER_SEQUENCE_OUT_OF_ORDER,
54 FOTA_ERROR_BOOTLOADER_BINARY_OVERSIZED,
55
56 // CAN errors
57 FOTA_CAN_INIT_ERR,
58 FOTA_CAN_TRANSMISSION_ERROR,
59 FOTA_CAN_RECEIVE_ERROR,
60
61 FOTA_ERROR_NO_MEMORY,
62 FOTA_ERROR_NO_DATAGRAM_FOUND,
63
64 FOTA_ERROR_JUMP_FAILED,
66
70#define fota_error_ok_or_return(code) \
71 ({ \
72 __typeof__(code) fota_err = (code); \
73 if (fota_err) return fota_err; \
74 })
75
FotaError
FOTA Error code definitions.
Definition: fota_error.h:27
@ FOTA_ERROR_RESOURCE_EXHAUSTED
Definition: fota_error.h:29
@ FOTA_ERROR_TIMEOUT
Definition: fota_error.h:32
@ FOTA_ERROR_INVALID_ARGS
Definition: fota_error.h:30
@ FOTA_ERROR_INTERNAL_ERROR
Definition: fota_error.h:31
@ FOTA_ERROR_CRC32_MISMATCH
Definition: fota_error.h:34
@ FOTA_ERROR_SUCCESS
Definition: fota_error.h:28
@ FOTA_ERROR_CRC32_DATA_NOT_ALIGNED
Definition: fota_error.h:35