Skip to content

Commit

Permalink
variants(wl): added Support for ELV-BM-TRX1
Browse files Browse the repository at this point in the history
Signed-off-by: Stephan Fabry <stephan.fabry@eq-3.com>
  • Loading branch information
Stephan Fabry authored and fpistm committed May 23, 2024
1 parent f31d070 commit b69d113
Show file tree
Hide file tree
Showing 4 changed files with 410 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
- [LoRa boards](#lora-boards)
- [Midatronics boards](#midatronics-boards)
- [SparkFun boards](#sparkfun-boards)
- [ELV Boards](#elv-boards)

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

### [ELV Boards](https://de.elv.com/lorawan)

| Status | Device(s) | Name | Release | Notes |
| :----: | :-------: | ---- | :-----: | :---- |
| :yellow_heart: | STM32WLE5JB | ELV-BM-TRX1 | **2.8.0** | |

## Next release

See [milestones](https://github.com/stm32duino/Arduino_Core_STM32/milestones) to have an overview of the next release content.
Expand Down
78 changes: 78 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11277,6 +11277,40 @@ SparkFun.menu.upload_method.dfuMethod.upload.protocol=2
SparkFun.menu.upload_method.dfuMethod.upload.options=
SparkFun.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg

################################################################################
# ELV Modular System boards

ELV_Modular_System.name=ELV Modular System boards
ELV_Modular_System.build.core=arduino
ELV_Modular_System.build.board=ELV_Modular_System
ELV_Modular_System.build.variant_h=variant_{build.board}.h
ELV_Modular_System.upload.maximum_size=0
ELV_Modular_System.upload.maximum_data_size=0

# ELV-BM-TRX1 board
ELV_Modular_System.menu.pnum.ELV_BM_TRX1=ELV-LW-Base ELV_BM_TRX1
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.upload.maximum_size=124927
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.upload.maximum_data_size=16383
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.mcu=cortex-m4
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.board=ELV_BM_TRX1
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.series=STM32WLxx
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.product_line=STM32WLE5xx
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.variant=STM32WLxx/WL54JCI_WL55JCI_WLE4J(8-B-C)I_WLE5J(8-B-C)I
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.variant_h=variant_ELV_BM_TRX1.h
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.flash_offset=0x800
ELV_Modular_System.menu.pnum.ELV_BM_TRX1.build.st_extra_flags=-D{build.product_line} -DUSE_CM4_STARTUP_FILE {build.xSerial}

# Upload menu
ELV_Modular_System.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD) with Bootloader
ELV_Modular_System.menu.upload_method.swdMethod.upload.protocol=0
ELV_Modular_System.menu.upload_method.swdMethod.upload.tool=stm32CubeProg


ELV_Modular_System.menu.upload_method.serialMethod=STM32CubeProgrammer (Serial) with Bootloader
ELV_Modular_System.menu.upload_method.serialMethod.upload.protocol=1
ELV_Modular_System.menu.upload_method.serialMethod.upload.options={serial.port.file}
ELV_Modular_System.menu.upload_method.serialMethod.upload.tool=stm32CubeProg

################################################################################
# Serialx activation
Nucleo_144.menu.xserial.generic=Enabled (generic 'Serial')
Expand Down Expand Up @@ -11497,6 +11531,12 @@ SparkFun.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NO
SparkFun.menu.xserial.disabled=Disabled (no Serial support)
SparkFun.menu.xserial.disabled.build.xSerial=

ELV_Modular_System.xserial.generic=Enabled (generic 'Serial')
ELV_Modular_System.xserial.none=Enabled (no generic 'Serial')
ELV_Modular_System.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE
ELV_Modular_System.xserial.disabled=Disabled (no Serial support)
ELV_Modular_System.xserial.disabled.build.xSerial=

# USB connectivity
Nucleo_144.menu.usb.none=None
Nucleo_144.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART)
Expand Down Expand Up @@ -12547,6 +12587,26 @@ SparkFun.menu.opt.ogstd.build.flags.optimize=-Og
SparkFun.menu.opt.o0std=No Optimization (-O0)
SparkFun.menu.opt.o0std.build.flags.optimize=-O0

ELV_Modular_System.menu.opt.osstd=Smallest (-Os default)
ELV_Modular_System.menu.opt.oslto=Smallest (-Os) with LTO
ELV_Modular_System.menu.opt.oslto.build.flags.optimize=-Os -flto
ELV_Modular_System.menu.opt.o1std=Fast (-O1)
ELV_Modular_System.menu.opt.o1std.build.flags.optimize=-O1
ELV_Modular_System.menu.opt.o1lto=Fast (-O1) with LTO
ELV_Modular_System.menu.opt.o1lto.build.flags.optimize=-O1 -flto
ELV_Modular_System.menu.opt.o2std=Faster (-O2)
ELV_Modular_System.menu.opt.o2std.build.flags.optimize=-O2
ELV_Modular_System.menu.opt.o2lto=Faster (-O2) with LTO
ELV_Modular_System.menu.opt.o2lto.build.flags.optimize=-O2 -flto
ELV_Modular_System.menu.opt.o3std=Fastest (-O3)
ELV_Modular_System.menu.opt.o3std.build.flags.optimize=-O3
ELV_Modular_System.menu.opt.o3lto=Fastest (-O3) with LTO
ELV_Modular_System.menu.opt.o3lto.build.flags.optimize=-O3 -flto
ELV_Modular_System.menu.opt.ogstd=Debug (-Og)
ELV_Modular_System.menu.opt.ogstd.build.flags.optimize=-Og
ELV_Modular_System.menu.opt.o0std=No Optimization (-O0)
ELV_Modular_System.menu.opt.o0std.build.flags.optimize=-O0

# Debug information
Nucleo_144.menu.dbg.none=None
Nucleo_144.menu.dbg.enable_sym=Symbols Enabled (-g)
Expand Down Expand Up @@ -12816,6 +12876,14 @@ SparkFun.menu.dbg.enable_log.build.flags.debug=
SparkFun.menu.dbg.enable_all=Core Logs and Symbols Enabled (-g)
SparkFun.menu.dbg.enable_all.build.flags.debug=-g

ELV_Modular_System.menu.dbg.none=None
ELV_Modular_System.menu.dbg.enable_sym=Symbols Enabled (-g)
ELV_Modular_System.menu.dbg.enable_sym.build.flags.debug=-g -DNDEBUG
ELV_Modular_System.menu.dbg.enable_log=Core logs Enabled
ELV_Modular_System.menu.dbg.enable_log.build.flags.debug=
ELV_Modular_System.menu.dbg.enable_all=Core Logs and Symbols Enabled (-g)
ELV_Modular_System.menu.dbg.enable_all.build.flags.debug=-g

# C Runtime Library
Nucleo_144.menu.rtlib.nano=Newlib Nano (default)
Nucleo_144.menu.rtlib.nanofp=Newlib Nano + Float Printf
Expand Down Expand Up @@ -13166,3 +13234,13 @@ SparkFun.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf
SparkFun.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float
SparkFun.menu.rtlib.full=Newlib Standard
SparkFun.menu.rtlib.full.build.flags.ldspecs=

ELV_Modular_System.menu.rtlib.nano=Newlib Nano (default)
ELV_Modular_System.menu.rtlib.nanofp=Newlib Nano + Float Printf
ELV_Modular_System.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float
ELV_Modular_System.menu.rtlib.nanofs=Newlib Nano + Float Scanf
ELV_Modular_System.menu.rtlib.nanofs.build.flags.ldspecs=--specs=nano.specs -u _scanf_float
ELV_Modular_System.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf
ELV_Modular_System.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float
ELV_Modular_System.menu.rtlib.full=Newlib Standard
ELV_Modular_System.menu.rtlib.full.build.flags.ldspecs=
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
/*
*******************************************************************************
* Copyright (c) 2024, STMicroelectronics
* All rights reserved.
*
* This software component is licensed by ST under BSD 3-Clause license,
* the "License"; You may not use this file except in compliance with the
* License. You may obtain a copy of the License at:
* opensource.org/licenses/BSD-3-Clause
*
*******************************************************************************
*/
#if defined(ARDUINO_ELV_BM_TRX1)
#include "pins_arduino.h"
// Digital PinName array
const PinName digitalPin[] = {
PA_0, // D0
PA_1, // D1
PA_2, // D2
PA_3, // D3
PA_4, // D4
PA_5, // D5
PA_6, // D6
PA_7, // D7
PA_8, // D8
PA_9, // D9
PA_10, // D10/A0
PA_11, // D11/A1
PA_12, // D12/A2
PA_13, // D13/A3
PA_14, // D14/A4
PA_15, // D15/A5
PB_0, // D16
PB_1, // D17/A6
PB_2, // D18/A7
PB_3, // D19/A8
PB_4, // D20/A9
PB_5, // D21
PB_6, // D22
PB_7, // D23
PB_8, // D24
PB_9, // D25
PB_10, // D26
PB_11, // D27
PB_12, // D28
PB_13, // D29/A10
PB_14, // D30/A11
PB_15, // D31
PC_0, // D32
PC_1, // D33
PC_2, // D34
PC_3, // D35
PC_4, // D36
PC_5, // D37
PC_6, // D38
PC_13, // D39
PC_14, // D40
PC_15, // D41
PH_3 // D42
};

// Analog (Ax) pin number array
const uint32_t analogInputPin[] = {
10, // A0, PA10
11, // A1, PA11
12, // A2, PA12
13, // A3, PA13
14, // A4, PA14
15, // A5, PA15
17, // A6, PB1
18, // A7, PB2
19, // A8, PB3
20, // A9, PB4
29, // A10, PB13
30 // A11, PB14
};

// ----------------------------------------------------------------------------
#ifdef __cplusplus
extern "C" {
#endif

/*
* @brief System Clock Configuration
* @param None
* @retval None
*/
WEAK void SystemClock_Config(void)
{
RCC_OscInitTypeDef RCC_OscInitStruct = {};
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
/* Configure the main internal regulator output voltage*/

__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE1);
/* Initializes the CPU, AHB and APB busses clocks*/

RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI;
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_11;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
Error_Handler();
}
/* Configure the SYSCLKSource, HCLK, PCLK1 and PCLK2 clocks dividers*/

RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK3 | RCC_CLOCKTYPE_HCLK
| RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1
| RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_MSI;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
RCC_ClkInitStruct.AHBCLK3Divider = RCC_SYSCLK_DIV1;

if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK) {
Error_Handler();
}
}
#ifdef __cplusplus
}
#endif
#endif /* ARDUINO_ELV_BM_TRX1 */
Loading

0 comments on commit b69d113

Please sign in to comment.