Skip to content

Commit 49cfeb4

Browse files
committed
variant: WL: add Generic Node Sensor Edition from TTI
1 parent bced43b commit 49cfeb4

File tree

4 files changed

+272
-0
lines changed

4 files changed

+272
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -420,6 +420,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d
420420

421421
| Status | Device(s) | Name | Release | Notes |
422422
| :----: | :-------: | ---- | :-----: | :---- |
423+
| :yellow_heart: | STM32WL55CC | [Generic Node Sensor Edition](https://www.genericnode.com/docs/sensor-edition) (GNSE) by TTI | **2.1.0** | [GNSE GitHub](https://github.com/TheThingsIndustries/generic-node-se) |
423424
| :yellow_heart: | STM32WL54CC<br>STM32WL55CC | Generic Board | **2.1.0** | |
424425
| :yellow_heart: | STM32WL55JC<br>STM32WL55JC | Generic Board | **2.1.0** | |
425426
| :yellow_heart: | STM32WLE4C8<br>STM32WLE4CB<br>STM32WLE4CC | Generic Board | **2.1.0** | |

boards.txt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5081,6 +5081,15 @@ GenWL.build.mcu=cortex-m4
50815081
GenWL.build.series=STM32WLxx
50825082
GenWL.build.cmsis_lib_gcc=arm_cortexM4lf_math
50835083

5084+
# Generic node SE by The Things Industries
5085+
GenWL.menu.pnum.GENERIC_NODE_SE_TTI=Generic Node SE (TTI)
5086+
GenWL.menu.pnum.GENERIC_NODE_SE_TTI.upload.maximum_size=262144
5087+
GenWL.menu.pnum.GENERIC_NODE_SE_TTI.upload.maximum_data_size=65536
5088+
GenWL.menu.pnum.GENERIC_NODE_SE_TTI.build.board=GENERIC_NODE_SE_TTI
5089+
GenWL.menu.pnum.GENERIC_NODE_SE_TTI.build.product_line=STM32WL55xx
5090+
GenWL.menu.pnum.GENERIC_NODE_SE_TTI.build.variant_h=variant_GENERIC_NODE_SE_TTI.h
5091+
GenWL.menu.pnum.GENERIC_NODE_SE_TTI.build.variant=STM32WLxx/WL54CCU_WL55CCU_WLE4C(8-B-C)U_WLE5C(8-B-C)U
5092+
50845093
# Generic WL54CCUx
50855094
GenWL.menu.pnum.GENERIC_WL54CCUX=Generic WL54CCUx
50865095
GenWL.menu.pnum.GENERIC_WL54CCUX.upload.maximum_size=262144
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2021, 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_GENERIC_NODE_SE_TTI)
14+
#include "pins_arduino.h"
15+
16+
// Digital PinName array
17+
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/LS1_SENSORS_EN
43+
PC_13, // D25/LS2_FLASH_EN
44+
PH_3, // D26/BOOT0
45+
PC_14, // D27/OSC32-IN
46+
PC_15 // D28/OSC32-OUT
47+
};
48+
49+
// Analog (Ax) pin number array
50+
const uint32_t analogInputPin[] = {
51+
18, // A0, PB2
52+
4, // A1, PA11
53+
5, // A2, PA12
54+
6, // A3, PA13
55+
7 // A4, PA14
56+
};
57+
58+
// ----------------------------------------------------------------------------
59+
#ifdef __cplusplus
60+
extern "C" {
61+
#endif
62+
63+
/**
64+
* @brief System Clock Configuration
65+
* @param None
66+
* @retval None
67+
*/
68+
WEAK void SystemClock_Config(void)
69+
{
70+
RCC_OscInitTypeDef RCC_OscInitStruct = {};
71+
RCC_ClkInitTypeDef RCC_ClkInitStruct = {};
72+
73+
/** Configure the main internal regulator output voltage
74+
*/
75+
__HAL_PWR_VOLTAGESCALING_CONFIG(PWR_REGULATOR_VOLTAGE_SCALE2);
76+
/** Initializes the CPU, AHB and APB busses clocks
77+
*/
78+
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_MSI;
79+
RCC_OscInitStruct.MSIState = RCC_MSI_ON;
80+
RCC_OscInitStruct.MSICalibrationValue = RCC_MSICALIBRATION_DEFAULT;
81+
RCC_OscInitStruct.MSIClockRange = RCC_MSIRANGE_6;
82+
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_NONE;
83+
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) {
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
89+
| RCC_CLOCKTYPE_SYSCLK | RCC_CLOCKTYPE_PCLK1
90+
| RCC_CLOCKTYPE_PCLK2;
91+
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_MSI;
92+
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
93+
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1;
94+
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
95+
RCC_ClkInitStruct.AHBCLK3Divider = RCC_SYSCLK_DIV1;
96+
97+
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_0) != HAL_OK) {
98+
Error_Handler();
99+
}
100+
}
101+
102+
#ifdef __cplusplus
103+
}
104+
#endif
105+
#endif /* ARDUINO_GENERIC_* */
Lines changed: 157 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,157 @@
1+
/*
2+
*******************************************************************************
3+
* Copyright (c) 2021, 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+
#define PB3 0
19+
#define PA15 1
20+
#define PA2 2
21+
#define PA3 3
22+
#define PA11 PIN_A1
23+
#define PA12 PIN_A2
24+
#define PA13 PIN_A3
25+
#define PA14 PIN_A4
26+
#define PA0 8
27+
#define PA1 9
28+
#define PA4 10
29+
#define PA5 11
30+
#define PA6 12
31+
#define PA7 13
32+
#define PA8 14
33+
#define PA9 15
34+
#define PA10 16
35+
#define PB0 17
36+
#define PB2 PIN_A0
37+
#define PB4 19
38+
#define PB5 20
39+
#define PB6 21
40+
#define PB7 22
41+
#define PB8 23
42+
#define PB12 24
43+
#define PC13 25
44+
#define PH3 26
45+
#define PC14 27 // OSC32-IN
46+
#define PC15 28 // OSC32-OUT
47+
48+
// Alternate pins number
49+
#define PA1_ALT1 (PA1 | ALT1)
50+
#define PA2_ALT1 (PA2 | ALT1)
51+
#define PA3_ALT1 (PA3 | ALT1)
52+
#define PA7_ALT1 (PA7 | ALT1)
53+
#define PB8_ALT1 (PB8 | ALT1)
54+
55+
#define NUM_DIGITAL_PINS 29
56+
#define NUM_ANALOG_INPUTS 5
57+
58+
// On-board LED pin number
59+
#define LED_RED PB5
60+
#ifndef LED_BUILTIN
61+
#define LED_BUILTIN LED_RED
62+
#endif
63+
#define LED_GREEN PB6
64+
#define LED_BLUE PB7
65+
66+
67+
// On-board user button
68+
#define B1_BTN PB3
69+
#ifndef USER_BTN
70+
#define USER_BTN B1_BTN
71+
#endif
72+
73+
// SPI definitions
74+
#ifndef PIN_SPI_SS
75+
#define PIN_SPI_SS PA4
76+
#endif
77+
#ifndef PIN_SPI_SS1
78+
#define PIN_SPI_SS1 PA15
79+
#endif
80+
#ifndef PIN_SPI_SS2
81+
#define PIN_SPI_SS2 PB2
82+
#endif
83+
#ifndef PIN_SPI_SS3
84+
#define PIN_SPI_SS3 PNUM_NOT_DEFINED
85+
#endif
86+
#ifndef PIN_SPI_MOSI
87+
#define PIN_SPI_MOSI PA7
88+
#endif
89+
#ifndef PIN_SPI_MISO
90+
#define PIN_SPI_MISO PA6
91+
#endif
92+
#ifndef PIN_SPI_SCK
93+
#define PIN_SPI_SCK PA5
94+
#endif
95+
96+
// I2C definitions
97+
#ifndef PIN_WIRE_SDA
98+
#define PIN_WIRE_SDA PA10
99+
#endif
100+
#ifndef PIN_WIRE_SCL
101+
#define PIN_WIRE_SCL PA9
102+
#endif
103+
104+
// Timer Definitions
105+
#ifndef TIMER_TONE
106+
#define TIMER_TONE TIM16
107+
#endif
108+
#ifndef TIMER_SERVO
109+
#define TIMER_SERVO TIM17
110+
#endif
111+
112+
// UART Definitions
113+
#ifndef SERIAL_UART_INSTANCE
114+
#define SERIAL_UART_INSTANCE 101
115+
#endif
116+
117+
// Default pin used for generic 'Serial' instance
118+
// Mandatory for Firmata
119+
#ifndef PIN_SERIAL_RX
120+
#define PIN_SERIAL_RX PA3
121+
#endif
122+
#ifndef PIN_SERIAL_TX
123+
#define PIN_SERIAL_TX PA2
124+
#endif
125+
126+
// Extra HAL modules
127+
#if !defined(HAL_DAC_MODULE_DISABLED)
128+
#define HAL_DAC_MODULE_ENABLED
129+
#endif
130+
131+
/*----------------------------------------------------------------------------
132+
* Arduino objects - C++ only
133+
*----------------------------------------------------------------------------*/
134+
135+
#ifdef __cplusplus
136+
// These serial port names are intended to allow libraries and architecture-neutral
137+
// sketches to automatically default to the correct port name for a particular type
138+
// of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN,
139+
// the first hardware serial port whose RX/TX pins are not dedicated to another use.
140+
//
141+
// SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor
142+
//
143+
// SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial
144+
//
145+
// SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library
146+
//
147+
// SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins.
148+
//
149+
// SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX
150+
// pins are NOT connected to anything by default.
151+
#ifndef SERIAL_PORT_MONITOR
152+
#define SERIAL_PORT_MONITOR Serial
153+
#endif
154+
#ifndef SERIAL_PORT_HARDWARE
155+
#define SERIAL_PORT_HARDWARE Serial
156+
#endif
157+
#endif

0 commit comments

Comments
 (0)