Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 182c9a8

Browse files
Stephan Fabryfpistm
andcommittedMay 23, 2024·
variants(wl): added Support for ELV-BM-TRX1
Signed-off-by: Stephan Fabry <[email protected]> Co-Authored-by: Frederic Pillon <[email protected]>
1 parent 0e9d108 commit 182c9a8

File tree

7 files changed

+622
-0
lines changed

7 files changed

+622
-0
lines changed
 

‎README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
8484
- [LoRa boards](#lora-boards)
8585
- [Midatronics boards](#midatronics-boards)
8686
- [SparkFun boards](#sparkfun-boards)
87+
- [ELV Boards](#elv-boards)
8788

8889
**Note about Status**:
8990
- :green_heart: board support is available since the specified release version.
@@ -831,6 +832,12 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
831832
| :green_heart: | STM32F405RG | [SparkFun MicroMod Processor Board - STM32F405](https://www.sparkfun.com/products/21326) | *2.6.0* | |
832833
| :green_heart: | STM32WB5MMG | [SparkFun MicroMod Processor Board - STM32WB5MMG](https://www.sparkfun.com/products/21438) | *2.6.0* | |
833834

835+
### [ELV Boards](https://de.elv.com/lorawan)
836+
837+
| Status | Device(s) | Name | Release | Notes |
838+
| :----: | :-------: | ---- | :-----: | :---- |
839+
| :yellow_heart: | STM32WLE5JB | ELV-BM-TRX1 | **2.8.0** | |
840+
834841
## Next release
835842

836843
See [milestones](https://github.com/stm32duino/Arduino_Core_STM32/milestones) to have an overview of the next release content.

‎boards.txt

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11277,6 +11277,40 @@ SparkFun.menu.upload_method.dfuMethod.upload.protocol=2
1127711277
SparkFun.menu.upload_method.dfuMethod.upload.options=
1127811278
SparkFun.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg
1127911279

11280+
################################################################################
11281+
# ELV Modular System boards
11282+
11283+
ELV_Modular_System.name=ELV Modular System boards
11284+
ELV_Modular_System.build.core=arduino
11285+
ELV_Modular_System.build.board=ELV_Modular_System
11286+
ELV_Modular_System.build.variant_h=variant_{build.board}.h
11287+
ELV_Modular_System.upload.maximum_size=0
11288+
ELV_Modular_System.upload.maximum_data_size=0
11289+
11290+
# ELV-BM-TRX1 board
11291+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1=ELV-LW-Base ELV_BM_TRX1
11292+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.upload.maximum_size=129024
11293+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.upload.maximum_data_size=49152
11294+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.mcu=cortex-m4
11295+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.board=ELV_BM_TRX1
11296+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.series=STM32WLxx
11297+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.product_line=STM32WLE5xx
11298+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.variant=STM32WLxx/WL54JCI_WL55JCI_WLE4J(8-B-C)I_WLE5J(8-B-C)I
11299+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.peripheral_pins=-DCUSTOM_PERIPHERAL_PINS
11300+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.flash_offset=0x800
11301+
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.st_extra_flags=-D{build.product_line} -DUSE_CM4_STARTUP_FILE {build.xSerial}
11302+
11303+
# Upload menu
11304+
ELV_Modular_System.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD) with Bootloader
11305+
ELV_Modular_System.menu.upload_method.swdMethod.upload.protocol=0
11306+
ELV_Modular_System.menu.upload_method.swdMethod.upload.tool=stm32CubeProg
11307+
11308+
11309+
ELV_Modular_System.menu.upload_method.serialMethod=STM32CubeProgrammer (Serial) with Bootloader
11310+
ELV_Modular_System.menu.upload_method.serialMethod.upload.protocol=1
11311+
ELV_Modular_System.menu.upload_method.serialMethod.upload.options={serial.port.file}
11312+
ELV_Modular_System.menu.upload_method.serialMethod.upload.tool=stm32CubeProg
11313+
1128011314
################################################################################
1128111315
# Serialx activation
1128211316
Nucleo_144.menu.xserial.generic=Enabled (generic 'Serial')
@@ -11497,6 +11531,12 @@ SparkFun.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NO
1149711531
SparkFun.menu.xserial.disabled=Disabled (no Serial support)
1149811532
SparkFun.menu.xserial.disabled.build.xSerial=
1149911533

11534+
ELV_Modular_System.menu.xserial.generic=Enabled (generic 'Serial')
11535+
ELV_Modular_System.menu.xserial.none=Enabled (no generic 'Serial')
11536+
ELV_Modular_System.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE
11537+
ELV_Modular_System.menu.xserial.disabled=Disabled (no Serial support)
11538+
ELV_Modular_System.menu.xserial.disabled.build.xSerial=
11539+
1150011540
# USB connectivity
1150111541
Nucleo_144.menu.usb.none=None
1150211542
Nucleo_144.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART)
@@ -12547,6 +12587,26 @@ SparkFun.menu.opt.ogstd.build.flags.optimize=-Og
1254712587
SparkFun.menu.opt.o0std=No Optimization (-O0)
1254812588
SparkFun.menu.opt.o0std.build.flags.optimize=-O0
1254912589

12590+
ELV_Modular_System.menu.opt.osstd=Smallest (-Os default)
12591+
ELV_Modular_System.menu.opt.oslto=Smallest (-Os) with LTO
12592+
ELV_Modular_System.menu.opt.oslto.build.flags.optimize=-Os -flto
12593+
ELV_Modular_System.menu.opt.o1std=Fast (-O1)
12594+
ELV_Modular_System.menu.opt.o1std.build.flags.optimize=-O1
12595+
ELV_Modular_System.menu.opt.o1lto=Fast (-O1) with LTO
12596+
ELV_Modular_System.menu.opt.o1lto.build.flags.optimize=-O1 -flto
12597+
ELV_Modular_System.menu.opt.o2std=Faster (-O2)
12598+
ELV_Modular_System.menu.opt.o2std.build.flags.optimize=-O2
12599+
ELV_Modular_System.menu.opt.o2lto=Faster (-O2) with LTO
12600+
ELV_Modular_System.menu.opt.o2lto.build.flags.optimize=-O2 -flto
12601+
ELV_Modular_System.menu.opt.o3std=Fastest (-O3)
12602+
ELV_Modular_System.menu.opt.o3std.build.flags.optimize=-O3
12603+
ELV_Modular_System.menu.opt.o3lto=Fastest (-O3) with LTO
12604+
ELV_Modular_System.menu.opt.o3lto.build.flags.optimize=-O3 -flto
12605+
ELV_Modular_System.menu.opt.ogstd=Debug (-Og)
12606+
ELV_Modular_System.menu.opt.ogstd.build.flags.optimize=-Og
12607+
ELV_Modular_System.menu.opt.o0std=No Optimization (-O0)
12608+
ELV_Modular_System.menu.opt.o0std.build.flags.optimize=-O0
12609+
1255012610
# Debug information
1255112611
Nucleo_144.menu.dbg.none=None
1255212612
Nucleo_144.menu.dbg.enable_sym=Symbols Enabled (-g)
@@ -12816,6 +12876,14 @@ SparkFun.menu.dbg.enable_log.build.flags.debug=
1281612876
SparkFun.menu.dbg.enable_all=Core Logs and Symbols Enabled (-g)
1281712877
SparkFun.menu.dbg.enable_all.build.flags.debug=-g
1281812878

12879+
ELV_Modular_System.menu.dbg.none=None
12880+
ELV_Modular_System.menu.dbg.enable_sym=Symbols Enabled (-g)
12881+
ELV_Modular_System.menu.dbg.enable_sym.build.flags.debug=-g -DNDEBUG
12882+
ELV_Modular_System.menu.dbg.enable_log=Core logs Enabled
12883+
ELV_Modular_System.menu.dbg.enable_log.build.flags.debug=
12884+
ELV_Modular_System.menu.dbg.enable_all=Core Logs and Symbols Enabled (-g)
12885+
ELV_Modular_System.menu.dbg.enable_all.build.flags.debug=-g
12886+
1281912887
# C Runtime Library
1282012888
Nucleo_144.menu.rtlib.nano=Newlib Nano (default)
1282112889
Nucleo_144.menu.rtlib.nanofp=Newlib Nano + Float Printf
@@ -13166,3 +13234,13 @@ SparkFun.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf
1316613234
SparkFun.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float
1316713235
SparkFun.menu.rtlib.full=Newlib Standard
1316813236
SparkFun.menu.rtlib.full.build.flags.ldspecs=
13237+
13238+
ELV_Modular_System.menu.rtlib.nano=Newlib Nano (default)
13239+
ELV_Modular_System.menu.rtlib.nanofp=Newlib Nano + Float Printf
13240+
ELV_Modular_System.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float
13241+
ELV_Modular_System.menu.rtlib.nanofs=Newlib Nano + Float Scanf
13242+
ELV_Modular_System.menu.rtlib.nanofs.build.flags.ldspecs=--specs=nano.specs -u _scanf_float
13243+
ELV_Modular_System.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf
13244+
ELV_Modular_System.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float
13245+
ELV_Modular_System.menu.rtlib.full=Newlib Standard
13246+
ELV_Modular_System.menu.rtlib.full.build.flags.ldspecs=

‎cmake/boards_db.cmake

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5884,6 +5884,60 @@ target_compile_options(ELEKTOR_F072CB_serial_none INTERFACE
58845884
"SHELL:-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE"
58855885
)
58865886

5887+
# ELV_BM_TRX1
5888+
# -----------------------------------------------------------------------------
5889+
5890+
set(ELV_BM_TRX1_VARIANT_PATH "${CMAKE_CURRENT_LIST_DIR}/../variants/STM32WLxx/WL54JCI_WL55JCI_WLE4J(8-B-C)I_WLE5J(8-B-C)I")
5891+
set(ELV_BM_TRX1_MAXSIZE 124927)
5892+
set(ELV_BM_TRX1_MAXDATASIZE 16383)
5893+
set(ELV_BM_TRX1_MCU cortex-m4)
5894+
set(ELV_BM_TRX1_FPCONF "-")
5895+
add_library(ELV_BM_TRX1 INTERFACE)
5896+
target_compile_options(ELV_BM_TRX1 INTERFACE
5897+
"SHELL:-DSTM32WLE5xx -DUSE_CM4_STARTUP_FILE "
5898+
"SHELL:"
5899+
"SHELL:"
5900+
"SHELL: "
5901+
-mcpu=${ELV_BM_TRX1_MCU}
5902+
)
5903+
target_compile_definitions(ELV_BM_TRX1 INTERFACE
5904+
"STM32WLxx"
5905+
"ARDUINO_ELV_BM_TRX1"
5906+
"BOARD_NAME=\"ELV_BM_TRX1\""
5907+
"BOARD_ID=ELV_BM_TRX1"
5908+
"VARIANT_H=\"variant_ELV_BM_TRX1.h\""
5909+
)
5910+
target_include_directories(ELV_BM_TRX1 INTERFACE
5911+
${CMAKE_CURRENT_LIST_DIR}/../system/STM32WLxx
5912+
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/STM32WLxx_HAL_Driver/Inc
5913+
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/STM32WLxx_HAL_Driver/Src
5914+
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/CMSIS/Device/ST/STM32WLxx/Include/
5915+
${CMAKE_CURRENT_LIST_DIR}/../system/Drivers/CMSIS/Device/ST/STM32WLxx/Source/Templates/gcc/
5916+
${ELV_BM_TRX1_VARIANT_PATH}
5917+
)
5918+
5919+
target_link_options(ELV_BM_TRX1 INTERFACE
5920+
"LINKER:--default-script=${ELV_BM_TRX1_VARIANT_PATH}/ldscript.ld"
5921+
"LINKER:--defsym=LD_FLASH_OFFSET=0x0800"
5922+
"LINKER:--defsym=LD_MAX_SIZE=124927"
5923+
"LINKER:--defsym=LD_MAX_DATA_SIZE=16383"
5924+
"SHELL: "
5925+
-mcpu=${ELV_BM_TRX1_MCU}
5926+
)
5927+
5928+
add_library(ELV_BM_TRX1_serial_disabled INTERFACE)
5929+
target_compile_options(ELV_BM_TRX1_serial_disabled INTERFACE
5930+
"SHELL:"
5931+
)
5932+
add_library(ELV_BM_TRX1_serial_generic INTERFACE)
5933+
target_compile_options(ELV_BM_TRX1_serial_generic INTERFACE
5934+
"SHELL:-DHAL_UART_MODULE_ENABLED"
5935+
)
5936+
add_library(ELV_BM_TRX1_serial_none INTERFACE)
5937+
target_compile_options(ELV_BM_TRX1_serial_none INTERFACE
5938+
"SHELL:-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE"
5939+
)
5940+
58875941
# ETHERCAT_DUINO
58885942
# -----------------------------------------------------------------------------
58895943

‎variants/STM32WLxx/WL54JCI_WL55JCI_WLE4J(8-B-C)I_WLE5J(8-B-C)I/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ add_library(variant_bin STATIC EXCLUDE_FROM_ALL
2222
generic_clock.c
2323
PeripheralPins.c
2424
PeripheralPins_LORA_E5_MINI.c
25+
variant_ELV_BM_TRX1.cpp
2526
variant_generic.cpp
2627
variant_LORA_E5_MINI.cpp
2728
variant_NUCLEO_WL55JC1.cpp
Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2024, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
/*
14+
* Automatically generated from STM32WL54JCIx.xml, STM32WL55JCIx.xml
15+
* STM32WLE4J8Ix.xml, STM32WLE4JBIx.xml
16+
* STM32WLE4JCIx.xml, STM32WLE5J8Ix.xml
17+
* STM32WLE5JBIx.xml, STM32WLE5JCIx.xml
18+
* CubeMX DB release 6.0.100
19+
*/
20+
#if defined(ARDUINO_ELV_BM_TRX1)
21+
#include "Arduino.h"
22+
#include "PeripheralPins.h"
23+
24+
/* =====
25+
* Notes:
26+
* - The pins mentioned Px_y_ALTz are alternative possibilities which use other
27+
* HW peripheral instances. You can use them the same way as any other "normal"
28+
* pin (i.e. analogWrite(PA7_ALT1, 128);).
29+
*
30+
* - Commented lines are alternative possibilities which are not used per default.
31+
* If you change them, you will have to know what you do
32+
* =====
33+
*/
34+
35+
//*** ADC ***
36+
37+
#ifdef HAL_ADC_MODULE_ENABLED
38+
WEAK const PinMap PinMap_ADC[] = {
39+
{PA_13, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9
40+
{PA_14, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC_IN10
41+
{PB_14, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1
42+
{NC, NP, 0}
43+
};
44+
#endif
45+
46+
//*** DAC ***
47+
48+
#ifdef HAL_DAC_MODULE_ENABLED
49+
WEAK const PinMap PinMap_DAC[] = {
50+
{PA_10, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1
51+
{NC, NP, 0}
52+
};
53+
#endif
54+
55+
//*** I2C ***
56+
57+
#ifdef HAL_I2C_MODULE_ENABLED
58+
WEAK const PinMap PinMap_I2C_SDA[] = {
59+
{PA_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
60+
{PA_15, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
61+
{PB_14, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
62+
{NC, NP, 0}
63+
};
64+
#endif
65+
66+
#ifdef HAL_I2C_MODULE_ENABLED
67+
WEAK const PinMap PinMap_I2C_SCL[] = {
68+
{PA_7, I2C3, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C3)},
69+
{PA_12, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)},
70+
{NC, NP, 0}
71+
};
72+
#endif
73+
74+
//*** No I3C ***
75+
76+
//*** TIM ***
77+
78+
#ifdef HAL_TIM_MODULE_ENABLED
79+
WEAK const PinMap PinMap_TIM[] = {
80+
{PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3
81+
{PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4
82+
{PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1
83+
{PA_6, TIM16, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM16, 1, 0)}, // TIM16_CH1
84+
{PA_7, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 1, 1)}, // TIM1_CH1N
85+
{PA_7_ALT1, TIM17, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF14_TIM17, 1, 0)}, // TIM17_CH1
86+
{PA_11, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 4, 0)}, // TIM1_CH4
87+
{PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2
88+
{PB_14, TIM1, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM1, 2, 1)}, // TIM1_CH2N
89+
{NC, NP, 0}
90+
};
91+
#endif
92+
93+
//*** UART ***
94+
95+
#ifdef HAL_UART_MODULE_ENABLED
96+
WEAK const PinMap PinMap_UART_TX[] = {
97+
{PA_2, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
98+
{PA_2_ALT1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
99+
{PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
100+
{NC, NP, 0}
101+
};
102+
#endif
103+
104+
#ifdef HAL_UART_MODULE_ENABLED
105+
WEAK const PinMap PinMap_UART_RX[] = {
106+
{PA_3, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
107+
{PA_3_ALT1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)},
108+
{PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
109+
{NC, NP, 0}
110+
};
111+
#endif
112+
113+
#ifdef HAL_UART_MODULE_ENABLED
114+
WEAK const PinMap PinMap_UART_RTS[] = {
115+
{PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
116+
{PB_3, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
117+
{PB_12, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
118+
{NC, NP, 0}
119+
};
120+
#endif
121+
122+
#ifdef HAL_UART_MODULE_ENABLED
123+
WEAK const PinMap PinMap_UART_CTS[] = {
124+
{PA_6, LPUART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_LPUART1)},
125+
{PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)},
126+
{NC, NP, 0}
127+
};
128+
#endif
129+
130+
//*** SPI ***
131+
132+
#ifdef HAL_SPI_MODULE_ENABLED
133+
WEAK const PinMap PinMap_SPI_MOSI[] = {
134+
{PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
135+
{PA_7_ALT1, SUBGHZSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF13_DEBUG_SUBGHZSPI)},
136+
{PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
137+
{NC, NP, 0}
138+
};
139+
#endif
140+
141+
#ifdef HAL_SPI_MODULE_ENABLED
142+
WEAK const PinMap PinMap_SPI_MISO[] = {
143+
{PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
144+
{PA_6_ALT1, SUBGHZSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF13_DEBUG_SUBGHZSPI)},
145+
{PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
146+
{NC, NP, 0}
147+
};
148+
#endif
149+
150+
#ifdef HAL_SPI_MODULE_ENABLED
151+
WEAK const PinMap PinMap_SPI_SCLK[] = {
152+
{PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
153+
{PA_5_ALT1, SUBGHZSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF13_DEBUG_SUBGHZSPI)},
154+
{NC, NP, 0}
155+
};
156+
#endif
157+
158+
#ifdef HAL_SPI_MODULE_ENABLED
159+
WEAK const PinMap PinMap_SPI_SSEL[] = {
160+
{PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)},
161+
{PA_4_ALT1, SUBGHZSPI, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF13_DEBUG_SUBGHZSPI)},
162+
{NC, NP, 0}
163+
};
164+
#endif
165+
166+
//*** No CAN ***
167+
168+
//*** No ETHERNET ***
169+
170+
//*** No QUADSPI ***
171+
172+
//*** No USB ***
173+
174+
//*** No SD ***
175+
176+
#endif /* ARDUINO_ELV_BM_TRX1 */
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2024, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#if defined(ARDUINO_ELV_BM_TRX1)
14+
#include "pins_arduino.h"
15+
// Digital PinName array
16+
const PinName digitalPin[] = {
17+
NC, // D0
18+
PB_12, // D1
19+
PA_0 , // D2
20+
PB_14, // D3/A0
21+
PC_13, // D4
22+
PA_9 , // D5
23+
PA_10, // D6
24+
PA_11, // D7
25+
PA_12, // D8
26+
NC, // D9
27+
NC, // D10
28+
NC, // D11
29+
NC, // D12
30+
NC, // D13
31+
NC, // D14
32+
NC, // D15
33+
NC, // D16
34+
PA_14, // D17/A2
35+
PA_13, // D18/A3
36+
PA_2 , // D19
37+
PA_3 , // D20
38+
PA_4 , // D21
39+
PA_5 , // D22
40+
PA_6 , // D23
41+
PA_7 , // D24
42+
PA_15, // D25
43+
PB_3, // D26
44+
PC_4, // D27
45+
PC_5 // D28
46+
};
47+
48+
// Analog (Ax) pin number array
49+
const uint32_t analogInputPin[] = {
50+
3, // A0, PB14
51+
11, // A1, PA14
52+
12 // A2, PA13
53+
};
54+
55+
// ----------------------------------------------------------------------------
56+
#ifdef __cplusplus
57+
extern "C" {
58+
#endif
59+
60+
/*
61+
* @brief System Clock Configuration
62+
* @param None
63+
* @retval None
64+
*/
65+
WEAK void SystemClock_Config(void)
66+
{
67+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
68+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
69+
/* Configure the main internal regulator output voltage*/
70+
71+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
72+
73+
/* Initializes the CPU, AHB and APB busses clocks*/
74+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
75+
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
76+
RCC_OscInitStruct.HSEDiv = RCC_HSE_DIV1;
77+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
78+
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
79+
RCC_OscInitStruct.PLL.PLLM = RCC_PLLM_DIV2;
80+
RCC_OscInitStruct.PLL.PLLN = 6;
81+
RCC_OscInitStruct.PLL.PLLP = RCC_PLLP_DIV2;
82+
RCC_OscInitStruct.PLL.PLLR = RCC_PLLR_DIV2;
83+
RCC_OscInitStruct.PLL.PLLQ = RCC_PLLQ_DIV2;
84+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
85+
Error_Handler();
86+
}
87+
/* Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers*/
88+
89+
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK3 | RCC_CLOCKTYPE_HCLK
90+
| RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1
91+
| RCC_CLOCKTYPE_PCLK2;
92+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_MSI;
93+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
94+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
95+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
96+
RCC_ClkInitStruct.AHBCLK3Divider = RCC_SYSCLK_DIV1;
97+
98+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
99+
Error_Handler();
100+
}
101+
}
102+
#ifdef __cplusplus
103+
}
104+
#endif
105+
#endif /* ARDUINO_ELV_BM_TRX1 */
Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2024, STMicroelectronics
4+
* All rights reserved.
5+
*
6+
* This software component is licensed by ST under BSD 3-Clause license,
7+
* the "License"; You may not use this file except in compliance with the
8+
* License. You may obtain a copy of the License at:
9+
* opensource.org/licenses/BSD-3-Clause
10+
*
11+
*******************************************************************************
12+
*/
13+
#pragma once
14+
15+
/*----------------------------------------------------------------------------
16+
* STM32 pins number
17+
*----------------------------------------------------------------------------*/
18+
19+
// J2
20+
#define PB12 1
21+
#define PA0 2
22+
#define PB14 PIN_A0
23+
#define PC13 4
24+
#define PA9 5
25+
#define PA10 6
26+
#define PA11 7
27+
#define PA12 8
28+
// J1
29+
#define PA14 PIN_A1
30+
#define PA13 PIN_A2
31+
#define PA2 19
32+
#define PA3 20
33+
#define PA4 21
34+
#define PA5 22
35+
#define PA6 23
36+
#define PA7 24
37+
// Not on connectors
38+
#define PA15 25
39+
#define PB3 26
40+
#define PC4 27
41+
#define PC5 28
42+
43+
// Not connected
44+
// PA1
45+
// PA8
46+
// PB0
47+
// PB1
48+
// PB2
49+
// PB4
50+
// PB5
51+
// PB6
52+
// PB7
53+
// PB8
54+
// PB9
55+
// PB10
56+
// PB11
57+
// PB13
58+
// PB15
59+
// PC0
60+
// PC1
61+
// PC2
62+
// PC3
63+
// PC6
64+
// PC14
65+
// PC15
66+
// PH3
67+
68+
// Alternate pins number
69+
#define PA2_ALT1 (PA2 | ALT1)
70+
#define PA3_ALT1 (PA3 | ALT1)
71+
#define PA4_ALT1 (PA4 | ALT1)
72+
#define PA5_ALT1 (PA5 | ALT1)
73+
#define PA6_ALT1 (PA6 | ALT1)
74+
#define PA7_ALT1 (PA7 | ALT1)
75+
76+
#define NUM_DIGITAL_PINS 29
77+
#define NUM_ANALOG_INPUTS 3
78+
79+
// On-board LED pin number
80+
#define LED1 PB3
81+
#define LED2 PA15
82+
#ifndef LED_BUILTIN
83+
#define LED_BUILTIN LED1
84+
#endif
85+
#define LED_GREEN LED1
86+
#define LED_RED LED2
87+
88+
// On-board user button
89+
#ifndef USER_BTN
90+
#define USER_BTN PA0
91+
#endif
92+
93+
// SPI definitions
94+
#ifndef PIN_SPI_SS
95+
#define PIN_SPI_SS PA4
96+
#endif
97+
#ifndef PIN_SPI_SS1
98+
#define PIN_SPI_SS1 PNUM_NOT_DEFINED
99+
#endif
100+
#ifndef PIN_SPI_SS2
101+
#define PIN_SPI_SS2 PNUM_NOT_DEFINED
102+
#endif
103+
#ifndef PIN_SPI_SS3
104+
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
105+
#endif
106+
#ifndef PIN_SPI_MOSI
107+
#define PIN_SPI_MOSI PA7
108+
#endif
109+
#ifndef PIN_SPI_MISO
110+
#define PIN_SPI_MISO PA6
111+
#endif
112+
#ifndef PIN_SPI_SCK
113+
#define PIN_SPI_SCK PA5
114+
#endif
115+
116+
// I2C definitions
117+
#ifndef PIN_WIRE_SDA
118+
#define PIN_WIRE_SDA PA11
119+
#endif
120+
#ifndef PIN_WIRE_SCL
121+
#define PIN_WIRE_SCL PA12
122+
#endif
123+
124+
// Timer Definitions
125+
// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin
126+
#ifndef TIMER_TONE
127+
#define TIMER_TONE TIM16
128+
#endif
129+
#ifndef TIMER_SERVO
130+
#define TIMER_SERVO TIM17
131+
#endif
132+
133+
// UART Definitions
134+
#ifndef SERIAL_UART_INSTANCE
135+
#define SERIAL_UART_INSTANCE 1
136+
#endif
137+
138+
// Default pin used for generic 'Serial' instance
139+
// Mandatory for Firmata
140+
#ifndef PIN_SERIAL_RX
141+
#define PIN_SERIAL_RX PA10
142+
#endif
143+
#ifndef PIN_SERIAL_TX
144+
#define PIN_SERIAL_TX PA9
145+
#endif
146+
147+
// Alias
148+
#ifndef DEBUG_SUBGHZSPI_MOSI
149+
#define DEBUG_SUBGHZSPI_MOSI PA7_ALT1
150+
#endif
151+
#ifndef DEBUG_SUBGHZSPI_MISO
152+
#define DEBUG_SUBGHZSPI_MISO PA6_ALT1
153+
#endif
154+
#ifndef DEBUG_SUBGHZSPI_SCLK
155+
#define DEBUG_SUBGHZSPI_SCLK PA5_ALT1
156+
#endif
157+
#ifndef DEBUG_SUBGHZSPI_SS
158+
#define DEBUG_SUBGHZSPI_SS PA4_ALT1
159+
#endif
160+
161+
// LORAWAN settings
162+
#define LORAWAN_RFSWITCH_PINS PC4,PC5
163+
#define LORAWAN_RFSWITCH_PIN_COUNT 2
164+
#define LORAWAN_RFSWITCH_OFF_VALUES LOW,LOW
165+
#define LORAWAN_RFSWITCH_RX_VALUES HIGH,LOW
166+
#define LORAWAN_RFSWITCH_RFO_LP_VALUES HIGH,HIGH
167+
#define LORAWAN_RFSWITCH_RFO_HP_VALUES LOW,HIGH
168+
#define XTAL_DEFAULT_CAP_VALUE ( 0x14UL )
169+
#define LORAWAN_BOARD_HAS_TCXO 0
170+
#define LORAWAN_BOARD_HAS_DCDC 1
171+
#define LORAWAN_TX_CONFIG RBI_CONF_RFO_LP
172+
#define EU868_TX_MAX_DATARATE DR_5
173+
#define EU868_RX_MAX_DATARATE DR_5
174+
#define EU868_DEFAULT_ANTENNA_GAIN 2.0f
175+
/*----------------------------------------------------------------------------
176+
* Arduino objects - C++ only
177+
*----------------------------------------------------------------------------*/
178+
179+
#ifdef __cplusplus
180+
// These serial port names are intended to allow libraries and architecture-neutral
181+
// sketches to automatically default to the correct port name for a particular type
182+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
183+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
184+
//
185+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
186+
//
187+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
188+
//
189+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
190+
//
191+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
192+
//
193+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
194+
// pins are NOT connected to anything by default.
195+
#ifndef SERIAL_PORT_MONITOR
196+
#define SERIAL_PORT_MONITOR Serial
197+
#endif
198+
#ifndef SERIAL_PORT_HARDWARE
199+
#define SERIAL_PORT_HARDWARE Serial
200+
#endif
201+
#endif

0 commit comments

Comments
 (0)
Please sign in to comment.