Morse Micro IoT SDK  2.11.2
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_COREDUMP_MEM_REGION = 0x0002,
27 FIELD_TYPE_MAGIC = 0x8000,
28 FIELD_TYPE_FW_SEGMENT = 0x8001,
29 FIELD_TYPE_FW_SEGMENT_DEFLATED = 0x8002,
30 FIELD_TYPE_BCF_BOARD_CONFIG = 0x8100,
31 FIELD_TYPE_BCF_REGDOM = 0x8101,
32 FIELD_TYPE_BCF_BOARD_DESC = 0x8102,
33 FIELD_TYPE_BCF_BUILD_VER = 0x8103,
34 FIELD_TYPE_SW_SEGMENT = 0x8201,
35 FIELD_TYPE_SW_SEGMENT_DEFLATED = 0x8202,
36 FIELD_TYPE_EOF = 0x8f00,
37 FIELD_TYPE_EOF_WITH_SIGNATURE = 0x8f01,
38};
39
42{
43 COREDUMP_MEM_REGION_GENERAL = 0x0001,
44 COREDUMP_MEM_REGION_ASSERT_INFO = 0x0002,
45};
46
49{
51 uint16_t type;
53 uint16_t len;
54};
55
58{
60 uint32_t base_address;
61};
62
65{
67 uint32_t base_address;
69 uint16_t chunk_size;
71 uint8_t zlib_header[2];
72};
73
76{
78 uint8_t country_code[2];
80 uint16_t reserved;
81};
82
84#define MBIN_SW_MAGIC_NUMBER (0x57534d4d)
86#define MBIN_FW_MAGIC_NUMBER (0x57464d4d)
88#define MBIN_BCF_MAGIC_NUMBER (0x43424d4d)
89
#define PACKED
Macro for the compiler packed attribute.
Definition: mbin.h:19
mbin_coredump_region_types
Enumeration of core dump memory region types.
Definition: mbin.h:42
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:65
uint16_t chunk_size
Size of deflated data, infer size of compressed data from TLV length.
Definition: mbin.h:69
uint32_t base_address
Destination base address at which the data should be loaded.
Definition: mbin.h:67
Data header in a FIELD_TYPE_BCF_REGDOM field.
Definition: mbin.h:76
uint16_t reserved
Reserved.
Definition: mbin.h:80
Data header in a FIELD_TYPE_XX_SEGMENT field.
Definition: mbin.h:58
uint32_t base_address
Destination base address at which the data should be loaded.
Definition: mbin.h:60
TLV header data structure.
Definition: mbin.h:49
uint16_t len
Length of payload (excludes header).
Definition: mbin.h:53
uint16_t type
Type (see mbin_tlv_types).
Definition: mbin.h:51