Morse Micro IoT SDK  2.9.7
mbin.h
1/*
2 * Copyright 2023 Morse Micro
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
15#pragma once
16
17#ifndef PACKED
19#define PACKED __attribute__((packed))
20#endif
21
24{
25 FIELD_TYPE_FW_TLV_BCF_ADDR = 0x0001,
26 FIELD_TYPE_MAGIC = 0x8000,
27 FIELD_TYPE_FW_SEGMENT = 0x8001,
28 FIELD_TYPE_FW_SEGMENT_DEFLATED = 0x8002,
29 FIELD_TYPE_BCF_BOARD_CONFIG = 0x8100,
30 FIELD_TYPE_BCF_REGDOM = 0x8101,
31 FIELD_TYPE_BCF_BOARD_DESC = 0x8102,
32 FIELD_TYPE_BCF_BUILD_VER = 0x8103,
33 FIELD_TYPE_SW_SEGMENT = 0x8201,
34 FIELD_TYPE_SW_SEGMENT_DEFLATED = 0x8202,
35 FIELD_TYPE_EOF = 0x8f00,
36 FIELD_TYPE_EOF_WITH_SIGNATURE = 0x8f01,
37};
38
41{
43 uint16_t type;
45 uint16_t len;
46};
47
50{
52 uint32_t base_address;
53};
54
57{
59 uint32_t base_address;
61 uint16_t chunk_size;
63 uint8_t zlib_header[2];
64};
65
68{
70 uint8_t country_code[2];
72 uint16_t reserved;
73};
74
76#define MBIN_SW_MAGIC_NUMBER (0x57534d4d)
78#define MBIN_FW_MAGIC_NUMBER (0x57464d4d)
80#define MBIN_BCF_MAGIC_NUMBER (0x43424d4d)
81
#define PACKED
Macro for the compiler packed attribute.
Definition: mbin.h:19
mbin_tlv_types
Enumeration of TLV field types.
Definition: mbin.h:24
Data header in a FIELD_TYPE_XX_SEGMENT_DEFLATED field.
Definition: mbin.h:57
uint16_t chunk_size
Size of deflated data, infer size of compressed data from TLV length.
Definition: mbin.h:61
uint32_t base_address
Destination base address at which the data should be loaded.
Definition: mbin.h:59
Data header in a FIELD_TYPE_BCF_REGDOM field.
Definition: mbin.h:68
uint16_t reserved
Reserved.
Definition: mbin.h:72
Data header in a FIELD_TYPE_XX_SEGMENT field.
Definition: mbin.h:50
uint32_t base_address
Destination base address at which the data should be loaded.
Definition: mbin.h:52
TLV header data structure.
Definition: mbin.h:41
uint16_t len
Length of payload (excludes header).
Definition: mbin.h:45
uint16_t type
Type (see mbin_tlv_types).
Definition: mbin.h:43