File tree Expand file tree Collapse file tree 4 files changed +63
-0
lines changed
hal/targets/cmsis/TARGET_ARM_SSG/TARGET_BEETLE Expand file tree Collapse file tree 4 files changed +63
-0
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ LR_IROM1 0x00000000 0x00040000 { ; load region size_region
27
27
*.o (RESET, +FIRST)
28
28
*(InRoot$$Sections)
29
29
.ANY (+RO)
30
+ CORDIO_RO_2.1.o (*)
30
31
}
31
32
; Total: 80 vectors = 320 bytes (0x140) to be reserved in RAM
32
33
RW_IRAM1 (0x20000000+0x140) (0x20000-0x140) { ; RW data
Original file line number Diff line number Diff line change @@ -70,6 +70,12 @@ SECTIONS
70
70
. = ALIGN (4);
71
71
} > VECTORS
72
72
73
+ .cordio :
74
+ {
75
+ *CORDIO_RO_2.1.o
76
+ *TRIM_2.1.o
77
+ } > FLASH
78
+
73
79
.text :
74
80
{
75
81
*(.text*)
Original file line number Diff line number Diff line change @@ -119,3 +119,36 @@ void SystemPowerResume(power_mode_t mode)
119
119
__DSB ();
120
120
}
121
121
}
122
+
123
+
124
+ /*
125
+ * System config data storage functions
126
+ * Reserved as the data is not strictly persistent
127
+ */
128
+
129
+ /*
130
+ * __System_Config_GetBDAddr(): Address for the BLE device on the air.
131
+ */
132
+ void __System_Config_GetBDAddr (uint8_t * addr , uint8_t byte_len )
133
+ {
134
+ SystemCoreConfigData * p ;
135
+ int bank1addr = EFlash_ReturnBank1BaseAddress ();
136
+
137
+ if (byte_len > 6 )
138
+ {
139
+ return ;
140
+ }
141
+
142
+ if (bank1addr < 0 )
143
+ {
144
+ memset (addr , 0xFF , byte_len );
145
+ }
146
+ else
147
+ {
148
+ /* 2x bank1 address is the top as banks have to be symmetric sizes */
149
+ /* The data is stored at the end.*/
150
+ p = (SystemCoreConfigData * ) ((2 * bank1addr ) - SYSTEM_CORE_CONFIG_DATA_SIZE );
151
+
152
+ memcpy (addr , p -> BD_ADDR , byte_len );
153
+ }
154
+ }
Original file line number Diff line number Diff line change @@ -65,6 +65,29 @@ void SystemPowerSuspend(power_mode_t mode);
65
65
*/
66
66
void SystemPowerResume (power_mode_t mode );
67
67
68
+ /*
69
+ * Definitions for storing static configuration data in Beetle
70
+ * This is not strictly persistent data as it will get wiped out on chip erase.
71
+ *
72
+ * There are only read functions provided.
73
+ * No Write function to prevent accidental writes resulting in
74
+ * the system being non responsive.
75
+ * Use the Flash manual before trying to write anything in the last 4k.
76
+ */
77
+ #define SYSTEM_CORE_CONFIG_DATA_SIZE (0x200) /* 512 bytes*/
78
+
79
+ typedef struct {
80
+ uint32_t BD_ADDR [2 ];
81
+
82
+ /*rest reserved*/
83
+ uint32_t reserved [SYSTEM_CORE_CONFIG_DATA_SIZE - 2 ];
84
+ } SystemCoreConfigData ;
85
+
86
+ /*
87
+ * __System_Config_GetBDAddr(): Address for the BLE device on the air.
88
+ */
89
+ void __System_Config_GetBDAddr (uint8_t * addr , uint8_t len );
90
+
68
91
#ifdef __cplusplus
69
92
}
70
93
#endif
You can’t perform that action at this time.
0 commit comments