Skip to content

Commit 73fb7f9

Browse files
committed
variant(WBA): add WBA55C(E-G)U generic support
Signed-off-by: Frederic Pillon <[email protected]>
1 parent 776f02c commit 73fb7f9

File tree

4 files changed

+329
-2
lines changed

4 files changed

+329
-2
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
7272
- [Generic STM32L5 boards](#generic-stm32l5-boards)
7373
- [Generic STM32U5 boards](#generic-stm32u5-boards)
7474
- [Generic STM32WB boards](#generic-stm32wb-boards)
75+
- [Generic STM32WBA boards](#generic-stm32wba-boards)
7576
- [Generic STM32WL boards](#generic-stm32wl-boards)
7677
- [3D printer boards](#3d-printer-boards)
7778
- [Blues Wireless boards](#blues-wireless-boards)
@@ -727,6 +728,12 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
727728
| :green_heart: | STM32WB5MMG | Generic Board | *2.1.0* | |
728729
| :green_heart: | STM32WB55RC<br>STM32WB55RE<br>STM32WB55RG | Generic Board | *2.0.0* | |
729730

731+
### Generic STM32WBA boards
732+
733+
| Status | Device(s) | Name | Release | Notes |
734+
| :----: | :-------: | ---- | :-----: | :---- |
735+
| :yellow_heart: | STM32WBA55CEU<br>STM32WBA55CGU | Generic Board | **2.8.0** | |
736+
730737
### Generic STM32WL boards
731738

732739
| Status | Device(s) | Name | Release | Notes |

boards.txt

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10274,6 +10274,48 @@ GenWB.menu.upload_method.dfuMethod.upload.protocol=2
1027410274
GenWB.menu.upload_method.dfuMethod.upload.options=
1027510275
GenWB.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
1027610276

10277+
################################################################################
10278+
# Generic WBA
10279+
GenWBA.name=Generic STM32WBA series
10280+
10281+
GenWBA.build.core=arduino
10282+
GenWBA.build.board=GenWBA
10283+
GenWBA.build.st_extra_flags=-D{build.product_line} {build.xSerial}
10284+
GenWBA.build.mcu=cortex-m33
10285+
GenWBA.build.fpu=-mfpu=fpv4-sp-d16
10286+
GenWBA.build.float-abi=-mfloat-abi=hard
10287+
GenWBA.build.series=STM32WBAxx
10288+
GenWBA.build.flash_offset=0x0
10289+
GenWBA.upload.maximum_size=0
10290+
GenWBA.upload.maximum_data_size=0
10291+
10292+
# Generic WBA55CEUx
10293+
GenWBA.menu.pnum.GENERIC_WBA55CEUX=Generic WBA55CEUx
10294+
GenWBA.menu.pnum.GENERIC_WBA55CEUX.upload.maximum_size=524288
10295+
GenWBA.menu.pnum.GENERIC_WBA55CEUX.upload.maximum_data_size=98304
10296+
GenWBA.menu.pnum.GENERIC_WBA55CEUX.build.board=GENERIC_WBA55CEUX
10297+
GenWBA.menu.pnum.GENERIC_WBA55CEUX.build.product_line=STM32WBA55xx
10298+
GenWBA.menu.pnum.GENERIC_WBA55CEUX.build.variant=STM32WBAxx/WBA55C(E-G)U
10299+
10300+
# Generic WBA55CGUx
10301+
GenWBA.menu.pnum.GENERIC_WBA55CGUX=Generic WBA55CGUx
10302+
GenWBA.menu.pnum.GENERIC_WBA55CGUX.upload.maximum_size=1048576
10303+
GenWBA.menu.pnum.GENERIC_WBA55CGUX.upload.maximum_data_size=131072
10304+
GenWBA.menu.pnum.GENERIC_WBA55CGUX.build.board=GENERIC_WBA55CGUX
10305+
GenWBA.menu.pnum.GENERIC_WBA55CGUX.build.product_line=STM32WBA55xx
10306+
GenWBA.menu.pnum.GENERIC_WBA55CGUX.build.variant=STM32WBAxx/WBA55C(E-G)U
10307+
10308+
# Upload menu
10309+
GenWBA.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD)
10310+
GenWBA.menu.upload_method.swdMethod.upload.protocol=0
10311+
GenWBA.menu.upload_method.swdMethod.upload.options=
10312+
GenWBA.menu.upload_method.swdMethod.upload.tool=stm32CubeProg
10313+
10314+
GenWBA.menu.upload_method.serialMethod=STM32CubeProgrammer (Serial)
10315+
GenWBA.menu.upload_method.serialMethod.upload.protocol=1
10316+
GenWBA.menu.upload_method.serialMethod.upload.options={serial.port.file}
10317+
GenWBA.menu.upload_method.serialMethod.upload.tool=stm32CubeProg
10318+
1027710319
################################################################################
1027810320
# Generic WL
1027910321
GenWL.name=Generic STM32WL series
@@ -11355,6 +11397,12 @@ GenWB.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE
1135511397
GenWB.menu.xserial.disabled=Disabled (no Serial support)
1135611398
GenWB.menu.xserial.disabled.build.xSerial=
1135711399

11400+
GenWBA.menu.xserial.generic=Enabled (generic 'Serial')
11401+
GenWBA.menu.xserial.none=Enabled (no generic 'Serial')
11402+
GenWBA.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE
11403+
GenWBA.menu.xserial.disabled=Disabled (no Serial support)
11404+
GenWBA.menu.xserial.disabled.build.xSerial=
11405+
1135811406
GenWL.menu.xserial.generic=Enabled (generic 'Serial')
1135911407
GenWL.menu.xserial.none=Enabled (no generic 'Serial')
1136011408
GenWL.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE
@@ -12231,6 +12279,26 @@ GenWB.menu.opt.ogstd.build.flags.optimize=-Og
1223112279
GenWB.menu.opt.o0std=No Optimization (-O0)
1223212280
GenWB.menu.opt.o0std.build.flags.optimize=-O0
1223312281

12282+
GenWBA.menu.opt.osstd=Smallest (-Os default)
12283+
GenWBA.menu.opt.oslto=Smallest (-Os) with LTO
12284+
GenWBA.menu.opt.oslto.build.flags.optimize=-Os -flto
12285+
GenWBA.menu.opt.o1std=Fast (-O1)
12286+
GenWBA.menu.opt.o1std.build.flags.optimize=-O1
12287+
GenWBA.menu.opt.o1lto=Fast (-O1) with LTO
12288+
GenWBA.menu.opt.o1lto.build.flags.optimize=-O1 -flto
12289+
GenWBA.menu.opt.o2std=Faster (-O2)
12290+
GenWBA.menu.opt.o2std.build.flags.optimize=-O2
12291+
GenWBA.menu.opt.o2lto=Faster (-O2) with LTO
12292+
GenWBA.menu.opt.o2lto.build.flags.optimize=-O2 -flto
12293+
GenWBA.menu.opt.o3std=Fastest (-O3)
12294+
GenWBA.menu.opt.o3std.build.flags.optimize=-O3
12295+
GenWBA.menu.opt.o3lto=Fastest (-O3) with LTO
12296+
GenWBA.menu.opt.o3lto.build.flags.optimize=-O3 -flto
12297+
GenWBA.menu.opt.ogstd=Debug (-Og)
12298+
GenWBA.menu.opt.ogstd.build.flags.optimize=-Og
12299+
GenWBA.menu.opt.o0std=No Optimization (-O0)
12300+
GenWBA.menu.opt.o0std.build.flags.optimize=-O0
12301+
1223412302
GenWL.menu.opt.osstd=Smallest (-Os default)
1223512303
GenWL.menu.opt.oslto=Smallest (-Os) with LTO
1223612304
GenWL.menu.opt.oslto.build.flags.optimize=-Os -flto
@@ -12624,6 +12692,14 @@ GenWB.menu.dbg.enable_log.build.flags.debug=
1262412692
GenWB.menu.dbg.enable_all=Core Logs and Symbols Enabled (-g)
1262512693
GenWB.menu.dbg.enable_all.build.flags.debug=-g
1262612694

12695+
GenWBA.menu.dbg.none=None
12696+
GenWBA.menu.dbg.enable_sym=Symbols Enabled (-g)
12697+
GenWBA.menu.dbg.enable_sym.build.flags.debug=-g -DNDEBUG
12698+
GenWBA.menu.dbg.enable_log=Core logs Enabled
12699+
GenWBA.menu.dbg.enable_log.build.flags.debug=
12700+
GenWBA.menu.dbg.enable_all=Core Logs and Symbols Enabled (-g)
12701+
GenWBA.menu.dbg.enable_all.build.flags.debug=-g
12702+
1262712703
GenWL.menu.dbg.none=None
1262812704
GenWL.menu.dbg.enable_sym=Symbols Enabled (-g)
1262912705
GenWL.menu.dbg.enable_sym.build.flags.debug=-g -DNDEBUG
@@ -12943,6 +13019,16 @@ GenWB.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float
1294313019
GenWB.menu.rtlib.full=Newlib Standard
1294413020
GenWB.menu.rtlib.full.build.flags.ldspecs=
1294513021

13022+
GenWBA.menu.rtlib.nano=Newlib Nano (default)
13023+
GenWBA.menu.rtlib.nanofp=Newlib Nano + Float Printf
13024+
GenWBA.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float
13025+
GenWBA.menu.rtlib.nanofs=Newlib Nano + Float Scanf
13026+
GenWBA.menu.rtlib.nanofs.build.flags.ldspecs=--specs=nano.specs -u _scanf_float
13027+
GenWBA.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf
13028+
GenWBA.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float
13029+
GenWBA.menu.rtlib.full=Newlib Standard
13030+
GenWBA.menu.rtlib.full.build.flags.ldspecs=
13031+
1294613032
GenWL.menu.rtlib.nano=Newlib Nano (default)
1294713033
GenWL.menu.rtlib.nanofp=Newlib Nano + Float Printf
1294813034
GenWL.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float

variants/STM32WBAxx/WBA55C(E-G)U/generic_clock.c

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,57 @@
2020
*/
2121
WEAK void SystemClock_Config(void)
2222
{
23-
/* SystemClock_Config can be generated by STM32CubeMX */
24-
#warning "SystemClock_Config() is empty. Default clock at reset is used."
23+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
24+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
25+
RCC_PeriphCLKInitTypeDef PeriphClkInit = {};
26+
27+
/** Configure the main internal regulator output voltage
28+
*/
29+
if (HAL_PWREx_ControlVoltageScaling(PWR_REGULATOR_VOLTAGE_SCALE1) != HAL_OK) {
30+
Error_Handler();
31+
}
32+
33+
/** Initializes the CPU, AHB and APB busses clocks
34+
*/
35+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI;
36+
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
37+
RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT;
38+
RCC_OscInitStruct.PLL1.PLLState = RCC_PLL_ON;
39+
RCC_OscInitStruct.PLL1.PLLSource = RCC_PLLSOURCE_HSI;
40+
RCC_OscInitStruct.PLL1.PLLM = 1;
41+
RCC_OscInitStruct.PLL1.PLLN = 12;
42+
RCC_OscInitStruct.PLL1.PLLP = 2;
43+
RCC_OscInitStruct.PLL1.PLLQ = 2;
44+
RCC_OscInitStruct.PLL1.PLLR = 2;
45+
RCC_OscInitStruct.PLL1.PLLFractional = 4096;
46+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
47+
Error_Handler();
48+
}
49+
50+
/** Initializes the CPU, AHB and APB busses clocks
51+
*/
52+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK
53+
| RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2
54+
| RCC_CLOCKTYPE_PCLK7 | RCC_CLOCKTYPE_HCLK5;
55+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
56+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
57+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
58+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
59+
RCC_ClkInitStruct.APB7CLKDivider = RCC_HCLK_DIV1;
60+
RCC_ClkInitStruct.AHB5_PLL1_CLKDivider = RCC_SYSCLK_PLL1_DIV4;
61+
RCC_ClkInitStruct.AHB5_HSEHSI_CLKDivider = RCC_SYSCLK_HSEHSI_DIV1;
62+
63+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_3) != HAL_OK) {
64+
Error_Handler();
65+
}
66+
67+
/** Initializes the peripherals clocks
68+
*/
69+
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_LPUART1;
70+
PeriphClkInit.Lpuart1ClockSelection = RCC_LPUART1CLKSOURCE_HSI;
71+
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) {
72+
Error_Handler();
73+
}
2574
}
2675

2776
#endif /* ARDUINO_GENERIC_* */
Lines changed: 185 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,185 @@
1+
/*
2+
******************************************************************************
3+
**
4+
** @file : LinkerScript.ld
5+
**
6+
** @author : Auto-generated by STM32CubeIDE
7+
**
8+
** @brief : Linker script for STM32WBA55CGUx Device from STM32WBA series
9+
** 1024KBytes FLASH
10+
** 128KBytes RAM
11+
**
12+
** Set heap size, stack size and stack location according
13+
** to application requirements.
14+
**
15+
** Set memory bank area and size if external memory is used
16+
**
17+
** Target : STMicroelectronics STM32
18+
**
19+
** Distribution: The file is distributed as is, without any warranty
20+
** of any kind.
21+
**
22+
******************************************************************************
23+
** @attention
24+
**
25+
** Copyright (c) 2024 STMicroelectronics.
26+
** All rights reserved.
27+
**
28+
** This software is licensed under terms that can be found in the LICENSE file
29+
** in the root directory of this software component.
30+
** If no LICENSE file comes with this software, it is provided AS-IS.
31+
**
32+
******************************************************************************
33+
*/
34+
35+
/* Entry Point */
36+
ENTRY(Reset_Handler)
37+
38+
/* Highest address of the user mode stack */
39+
_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */
40+
41+
_Min_Heap_Size = 0x200; /* required amount of heap */
42+
_Min_Stack_Size = 0x400; /* required amount of stack */
43+
44+
/* Memories definition */
45+
MEMORY
46+
{
47+
RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE
48+
FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET
49+
}
50+
51+
/* Sections */
52+
SECTIONS
53+
{
54+
/* The startup code into "FLASH" Rom type memory */
55+
.isr_vector :
56+
{
57+
. = ALIGN(4);
58+
KEEP(*(.isr_vector)) /* Startup code */
59+
. = ALIGN(4);
60+
} >FLASH
61+
62+
/* The program code and other data into "FLASH" Rom type memory */
63+
.text :
64+
{
65+
. = ALIGN(4);
66+
*(.text) /* .text sections (code) */
67+
*(.text*) /* .text* sections (code) */
68+
*(.glue_7) /* glue arm to thumb code */
69+
*(.glue_7t) /* glue thumb to arm code */
70+
*(.eh_frame)
71+
72+
KEEP (*(.init))
73+
KEEP (*(.fini))
74+
75+
. = ALIGN(4);
76+
_etext = .; /* define a global symbols at end of code */
77+
} >FLASH
78+
79+
/* Constant data into "FLASH" Rom type memory */
80+
.rodata :
81+
{
82+
. = ALIGN(4);
83+
*(.rodata) /* .rodata sections (constants, strings, etc.) */
84+
*(.rodata*) /* .rodata* sections (constants, strings, etc.) */
85+
. = ALIGN(4);
86+
} >FLASH
87+
88+
.ARM.extab : {
89+
. = ALIGN(4);
90+
*(.ARM.extab* .gnu.linkonce.armextab.*)
91+
. = ALIGN(4);
92+
} >FLASH
93+
94+
.ARM : {
95+
. = ALIGN(4);
96+
__exidx_start = .;
97+
*(.ARM.exidx*)
98+
__exidx_end = .;
99+
. = ALIGN(4);
100+
} >FLASH
101+
102+
.preinit_array :
103+
{
104+
. = ALIGN(4);
105+
PROVIDE_HIDDEN (__preinit_array_start = .);
106+
KEEP (*(.preinit_array*))
107+
PROVIDE_HIDDEN (__preinit_array_end = .);
108+
. = ALIGN(4);
109+
} >FLASH
110+
111+
.init_array :
112+
{
113+
. = ALIGN(4);
114+
PROVIDE_HIDDEN (__init_array_start = .);
115+
KEEP (*(SORT(.init_array.*)))
116+
KEEP (*(.init_array*))
117+
PROVIDE_HIDDEN (__init_array_end = .);
118+
. = ALIGN(4);
119+
} >FLASH
120+
121+
.fini_array :
122+
{
123+
. = ALIGN(4);
124+
PROVIDE_HIDDEN (__fini_array_start = .);
125+
KEEP (*(SORT(.fini_array.*)))
126+
KEEP (*(.fini_array*))
127+
PROVIDE_HIDDEN (__fini_array_end = .);
128+
. = ALIGN(4);
129+
} >FLASH
130+
131+
/* Used by the startup to initialize data */
132+
_sidata = LOADADDR(.data);
133+
134+
/* Initialized data sections into "RAM" Ram type memory */
135+
.data :
136+
{
137+
. = ALIGN(4);
138+
_sdata = .; /* create a global symbol at data start */
139+
*(.data) /* .data sections */
140+
*(.data*) /* .data* sections */
141+
*(.RamFunc) /* .RamFunc sections */
142+
*(.RamFunc*) /* .RamFunc* sections */
143+
144+
. = ALIGN(4);
145+
_edata = .; /* define a global symbol at data end */
146+
147+
} >RAM AT> FLASH
148+
149+
/* Uninitialized data section into "RAM" Ram type memory */
150+
. = ALIGN(4);
151+
.bss :
152+
{
153+
/* This is used by the startup in order to initialize the .bss section */
154+
_sbss = .; /* define a global symbol at bss start */
155+
__bss_start__ = _sbss;
156+
*(.bss)
157+
*(.bss*)
158+
*(COMMON)
159+
160+
. = ALIGN(4);
161+
_ebss = .; /* define a global symbol at bss end */
162+
__bss_end__ = _ebss;
163+
} >RAM
164+
165+
/* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */
166+
._user_heap_stack :
167+
{
168+
. = ALIGN(8);
169+
PROVIDE ( end = . );
170+
PROVIDE ( _end = . );
171+
. = . + _Min_Heap_Size;
172+
. = . + _Min_Stack_Size;
173+
. = ALIGN(8);
174+
} >RAM
175+
176+
/* Remove information from the compiler libraries */
177+
/DISCARD/ :
178+
{
179+
libc.a ( * )
180+
libm.a ( * )
181+
libgcc.a ( * )
182+
}
183+
184+
.ARM.attributes 0 : { *(.ARM.attributes) }
185+
}

0 commit comments

Comments
 (0)