Skip to content

Commit ca245c0

Browse files
committed
add variant board.txt
1 parent f2a2db4 commit ca245c0

File tree

3 files changed

+276
-32
lines changed

3 files changed

+276
-32
lines changed

boards.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5097,6 +5097,14 @@ GenWL.menu.pnum.GENERIC_WL55JCIX.build.board=GENERIC_WL55JCIX
50975097
GenWL.menu.pnum.GENERIC_WL55JCIX.build.product_line=STM32WL55xx
50985098
GenWL.menu.pnum.GENERIC_WL55JCIX.build.variant=STM32WLxx/WL54JCI_WL55JCI_WLE4J(8-B-C)I_WLE5J(8-B-C)I
50995099

5100+
# Generic node TTN
5101+
GenWL.menu.pnum.GENERIC_NODE=Generic Node TTN
5102+
GenWL.menu.pnum.GENERIC_NODE.upload.maximum_size=262144
5103+
GenWL.menu.pnum.GENERIC_NODE.upload.maximum_data_size=65536
5104+
GenWL.menu.pnum.GENERIC_NODE.build.board=GENERIC_NODE
5105+
GenWL.menu.pnum.GENERIC_NODE.build.product_line=STM32WL55xx
5106+
GenWL.menu.pnum.GENERIC_NODE.build.variant=STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U
5107+
51005108
# Generic WLE4J8Ix
51015109
GenWL.menu.pnum.GENERIC_WLE4J8IX=Generic WLE4J8Ix
51025110
GenWL.menu.pnum.GENERIC_WLE4J8IX.upload.maximum_size=65536
Lines changed: 188 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,188 @@
1+
/** Copyright © 2021 The Things Industries B.V.
2+
*
3+
* Licensed under the Apache License, Version 2.0 (the "License");
4+
* you may not use this file except in compliance with the License.
5+
* You may obtain a copy of the License at
6+
*
7+
* http://www.apache.org/licenses/LICENSE-2.0
8+
*
9+
* Unless required by applicable law or agreed to in writing, software
10+
* distributed under the License is distributed on an "AS IS" BASIS,
11+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
* See the License for the specific language governing permissions and
13+
* limitations under the License.
14+
*/
15+
16+
/* Entry Point */
17+
ENTRY(Reset_Handler)
18+
19+
/* Highest address of the user mode stack */
20+
_estack = ORIGIN(RAM1) + LENGTH(RAM1); /* end of "SRAM1" Ram type memory */
21+
22+
_Min_Heap_Size = 0x400; /* required amount of heap */
23+
_Min_Stack_Size = 0x800; /* required amount of stack */
24+
25+
/* Memories definition */
26+
MEMORY
27+
{
28+
ROM (rx) : ORIGIN = 0x08000000, LENGTH = 256K /* Flash memory dedicated to CM4 */
29+
RAM1 (xrw) : ORIGIN = 0x20000000, LENGTH = 32K /* Non-backup SRAM1 dedicated to CM4 */
30+
RAM2 (xrw) : ORIGIN = 0x20008000, LENGTH = 32K /* Backup SRAM2 dedicated to CM4 */
31+
}
32+
33+
/* Sections */
34+
SECTIONS
35+
{
36+
/* The startup code into "ROM" Rom type memory */
37+
.isr_vector :
38+
{
39+
. = ALIGN(8);
40+
KEEP(*(.isr_vector)) /* Startup code */
41+
. = ALIGN(8);
42+
} >ROM
43+
44+
/* The program code and other data into "ROM" Rom type memory */
45+
.text :
46+
{
47+
. = ALIGN(8);
48+
*(.text) /* .text sections (code) */
49+
*(.text*) /* .text* sections (code) */
50+
*(.glue_7) /* glue arm to thumb code */
51+
*(.glue_7t) /* glue thumb to arm code */
52+
*(.eh_frame)
53+
54+
KEEP (*(.init))
55+
KEEP (*(.fini))
56+
57+
. = ALIGN(8);
58+
_etext = .; /* define a global symbols at end of code */
59+
} >ROM
60+
61+
/* Constant data into "ROM" Rom type memory */
62+
.rodata :
63+
{
64+
. = ALIGN(8);
65+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
66+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
67+
. = ALIGN(8);
68+
} >ROM
69+
70+
.ARM.extab : {
71+
. = ALIGN(8);
72+
*(.ARM.extab* .gnu.linkonce.armextab.*)
73+
. = ALIGN(8);
74+
} >ROM
75+
76+
.ARM : {
77+
. = ALIGN(8);
78+
__exidx_start = .;
79+
*(.ARM.exidx*)
80+
__exidx_end = .;
81+
. = ALIGN(8);
82+
} >ROM
83+
84+
.preinit_array :
85+
{
86+
. = ALIGN(8);
87+
PROVIDE_HIDDEN (__preinit_array_start = .);
88+
KEEP (*(.preinit_array*))
89+
PROVIDE_HIDDEN (__preinit_array_end = .);
90+
. = ALIGN(8);
91+
} >ROM
92+
93+
.init_array :
94+
{
95+
. = ALIGN(8);
96+
PROVIDE_HIDDEN (__init_array_start = .);
97+
KEEP (*(SORT(.init_array.*)))
98+
KEEP (*(.init_array*))
99+
PROVIDE_HIDDEN (__init_array_end = .);
100+
. = ALIGN(8);
101+
} >ROM
102+
103+
.fini_array :
104+
{
105+
. = ALIGN(8);
106+
PROVIDE_HIDDEN (__fini_array_start = .);
107+
KEEP (*(SORT(.fini_array.*)))
108+
KEEP (*(.fini_array*))
109+
PROVIDE_HIDDEN (__fini_array_end = .);
110+
. = ALIGN(8);
111+
} >ROM
112+
113+
/* Used by the startup to initialize data */
114+
_sidata = LOADADDR(.data);
115+
116+
/* Initialized data sections into "SRAM1" Ram type memory */
117+
.data :
118+
{
119+
. = ALIGN(8);
120+
_sdata = .; /* create a global symbol at data start */
121+
*(.data) /* .data sections */
122+
*(.data*) /* .data* sections */
123+
124+
. = ALIGN(8);
125+
_edata = .; /* define a global symbol at data end */
126+
127+
} >RAM1 AT> ROM
128+
129+
/* Uninitialized data section into "SRAM1" Ram type memory */
130+
. = ALIGN(8);
131+
.bss :
132+
{
133+
/* This is used by the startup in order to initialize the .bss section */
134+
_sbss = .; /* define a global symbol at bss start */
135+
__bss_start__ = _sbss;
136+
*(.bss)
137+
*(.bss*)
138+
*(COMMON)
139+
140+
. = ALIGN(8);
141+
_ebss = .; /* define a global symbol at bss end */
142+
__bss_end__ = _ebss;
143+
} >RAM1
144+
145+
/* Data section into "SRAM1" Ram type memory: Non-backup SRAM1 dedicated to CM4 */
146+
. = ALIGN(8);
147+
RAM1_region :
148+
{
149+
_sRAM1_region = .; /* define a global symbol at section start */
150+
*(.RAM1_region)
151+
152+
. = ALIGN(8);
153+
_eRAM1_region = .; /* define a global symbol at section end */
154+
} >RAM1
155+
156+
/* Data section into "SRAM2" Ram type memory: Backup SRAM2 dedicated to CM4 */
157+
. = ALIGN(8);
158+
RAM2_region :
159+
{
160+
_sRAM2_region = .; /* define a global symbol at section start */
161+
*(.RAM2_region)
162+
163+
. = ALIGN(8);
164+
_eRAM2_region = .; /* define a global symbol at section end */
165+
} >RAM2
166+
167+
/* User_heap_stack section, used to check that there is enough "SRAM1" Ram type memory left */
168+
._user_heap_stack :
169+
{
170+
. = ALIGN(8);
171+
PROVIDE ( end = . );
172+
PROVIDE ( _end = . );
173+
. = . + _Min_Heap_Size;
174+
. = . + _Min_Stack_Size;
175+
. = ALIGN(8);
176+
__RAM_segment_used_end__ = .;
177+
} >RAM1
178+
179+
/* Remove information from the compiler libraries */
180+
/DISCARD/ :
181+
{
182+
libc.a ( * )
183+
libm.a ( * )
184+
libgcc.a ( * )
185+
}
186+
187+
.ARM.attributes 0 : { *(.ARM.attributes) }
188+
}

variants/STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U/variant_GENERIC_NODE.cpp

Lines changed: 80 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -15,42 +15,90 @@
1515

1616
// Digital PinName array
1717
const PinName digitalPin[] = {
18-
PB_3, // D0/USR_BTN/SWO/RTS
19-
PA_15, // D1/BUZZER
20-
PA_2, // D2/TX
21-
PA_3, // D3/RX
22-
PA_11, // D4/SDA2/A1
23-
PA_12, // D5/SCL2/A2
24-
PA_13, // D6/A3/SWDIO
25-
PA_14, // D7/A4/SWCLK
26-
PA_0, // D8/FE_CTRL1
27-
PA_1, // D9/FE_CTRL2
28-
PA_4, // D10/CS1 FLASH
29-
PA_5, // D11/SCK1
30-
PA_6, // D12/MISO
31-
PA_7, // D13/MOSI
32-
PA_8, // D14/ACCEL_INT2
33-
PA_9, // D15/SCL1
34-
PA_10, // D16/SDA1
35-
PB_0, // D17/VDD_TCX0
36-
PB_2, // D18/VABAT_ADC/A0
37-
PB_4, // D19/VBAT_READ_EN
38-
PB_5, // D20/LED_RED
39-
PB_6, // D21/LED_GREEN
40-
PB_7, // D22/LED_BLUE
41-
PB_8, // D23/FE_CTRL3
42-
PB_12, // D24/LS2_FLASH_EN
43-
PC_13, // D25/LS1_SENSORS_EN
44-
PH_3 // D26/BOOT0
18+
PB_3, // D0/USR_BTN/SWO/RTS
19+
PA_15, // D1/BUZZER
20+
PA_2, // D2/TX
21+
PA_3, // D3/RX
22+
PA_11, // D4/SDA2/A1
23+
PA_12, // D5/SCL2/A2
24+
PA_13, // D6/A3/SWDIO
25+
PA_14, // D7/A4/SWCLK
26+
PA_0, // D8/FE_CTRL1
27+
PA_1, // D9/FE_CTRL2
28+
PA_4, // D10/CS1 FLASH
29+
PA_5, // D11/SCK1
30+
PA_6, // D12/MISO
31+
PA_7, // D13/MOSI
32+
PA_8, // D14/ACCEL_INT2
33+
PA_9, // D15/SCL1
34+
PA_10, // D16/SDA1
35+
PB_0, // D17/VDD_TCX0
36+
PB_2, // D18/VABAT_ADC/A0
37+
PB_4, // D19/VBAT_READ_EN
38+
PB_5, // D20/LED_RED
39+
PB_6, // D21/LED_GREEN
40+
PB_7, // D22/LED_BLUE
41+
PB_8, // D23/FE_CTRL3
42+
PB_12, // D24/LS2_FLASH_EN
43+
PC_13, // D25/LS1_SENSORS_EN
44+
PH_3 // D26/BOOT0
4545
};
4646

4747
// Analog (Ax) pin number array
4848
const uint32_t analogInputPin[] = {
49-
18, // A0, PB2
50-
4, // A1, PA11
51-
5, // A2, PA12
52-
6, // A3, PA13
53-
7, // A4, PA14
49+
18, // A0, PB2
50+
4, // A1, PA11
51+
5, // A2, PA12
52+
6, // A3, PA13
53+
7, // A4, PA14
5454
};
5555

56+
// ----------------------------------------------------------------------------
57+
#ifdef __cplusplus
58+
extern "C"
59+
{
60+
#endif
61+
62+
/**
63+
* @brief System Clock Configuration
64+
* @param None
65+
* @retval None
66+
*/
67+
WEAK void SystemClock_Config(void)
68+
{
69+
RCC_OscInitTypeDef RCC_OscInitStruct = {0};
70+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {0};
71+
72+
/** Configure the main internal regulator output voltage
73+
*/
74+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
75+
/** Initializes the CPU, AHB and APB busses clocks
76+
*/
77+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI;
78+
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
79+
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
80+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6;
81+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
82+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
83+
{
84+
Error_Handler();
85+
}
86+
/** Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers
87+
*/
88+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK3 | RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2;
89+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_MSI;
90+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
91+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
92+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
93+
RCC_ClkInitStruct.AHBCLK3Divider = RCC_SYSCLK_DIV1;
94+
95+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK)
96+
{
97+
Error_Handler();
98+
}
99+
}
100+
101+
#ifdef __cplusplus
102+
}
103+
#endif
56104
#endif /* ARDUINO_GENERIC_* */

0 commit comments

Comments
 (0)