forked from alibaba/AliOS-Things
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathboard.c
89 lines (85 loc) · 3.05 KB
/
board.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
#include "hal/soc/soc.h"
#include "serial_api.h"
#include <aos/kernel.h>
#define HAL_PARTITION_SYS_DATA HAL_PARTITION_MAX
/* Logic partition on flash devices */
const hal_logic_partition_t hal_partitions[] =
{
#if 0
[HAL_PARTITION_BOOTLOADER] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "Bootloader",
.partition_start_addr = 0x18001000,
.partition_length = 0x5000, //20k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
#endif
[HAL_PARTITION_APPLICATION] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "Application",
.partition_start_addr = 0x18006000,
.partition_length = 0x96000,//600K bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
#if 1
[HAL_PARTITION_OTA_TEMP] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "OTA Storage",
.partition_start_addr = 0x1809c000,
.partition_length = 0x5e000,//376K bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
#endif
[HAL_PARTITION_SYS_DATA] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "SYS Data",
.partition_start_addr = 0x180fa000,
.partition_length = 0x1000,
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_1] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER1",
.partition_start_addr = 0x180fb000,//
.partition_length = 0x1000, //4k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_2] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER2",
.partition_start_addr = 0x180fc000,//
.partition_length = 0x2000, //8k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_3] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER3",
.partition_start_addr = 0x180fe000,//
.partition_length = 0x1000, //4k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
[HAL_PARTITION_PARAMETER_4] =
{
.partition_owner = HAL_FLASH_EMBEDDED,
.partition_description = "PARAMETER4",
.partition_start_addr = 0x180ff000, //
.partition_length = 0x1000, //4k bytes
.partition_options = PAR_OPT_READ_EN | PAR_OPT_WRITE_EN,
},
};
uart_dev_t uart_0 = {
0,
{921600, DATA_WIDTH_8BIT, NO_PARITY, STOP_BITS_1, FLOW_CONTROL_DISABLED},
NULL,
};
void board_init(void)
{
hal_uart_init(&uart_0);
}