Skip to content

Commit 3310efb

Browse files
committed
[STM32] an update of I/O map for LilyGO T3-STM32 [skip ci]
1 parent 413f218 commit 3310efb

File tree

4 files changed

+61
-25
lines changed

4 files changed

+61
-25
lines changed

software/firmware/source/SoftRF/src/platform/STM32.cpp

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,35 @@ static void STM32_post_init()
632632
Serial.println();
633633
Serial.flush();
634634
}
635-
#endif /* ARDUINO_NUCLEO_L073RZ || ARDUINO_GENERIC_WLE5CCUX */
635+
#elif defined(ARDUINO_GENERIC_WL55CCUX)
636+
if (hw_info.model == SOFTRF_MODEL_LABUBU) {
637+
Serial.println();
638+
Serial.println(F("SoftRF Labubu Edition Power-on Self Test"));
639+
Serial.println();
640+
Serial.flush();
641+
642+
Serial.println(F("Built-in components:"));
643+
644+
Serial.print(F("RADIO : "));
645+
Serial.println(hw_info.rf == RF_IC_SX1262 ? F("PASS") : F("FAIL"));
646+
Serial.print(F("CLK SRC : "));
647+
Serial.println(STM32_has_TCXO ? F("TCXO") : F("XTAL"));
648+
Serial.print(F("DISPLAY : "));
649+
Serial.println(hw_info.display != DISPLAY_NONE ? F("PASS") : F("FAIL"));
650+
651+
Serial.println();
652+
Serial.println(F("External components:"));
653+
Serial.print(F("GNSS : "));
654+
Serial.println(hw_info.gnss != GNSS_MODULE_NONE ? F("PASS") : F("N/A"));
655+
Serial.print(F("BMx280 : "));
656+
Serial.println(hw_info.baro == BARO_MODULE_BMP280 ? F("PASS") : F("N/A"));
657+
658+
Serial.println();
659+
Serial.println(F("Power-on Self Test is complete."));
660+
Serial.println();
661+
Serial.flush();
662+
}
663+
#endif /* NUCLEO_L073RZ || GENERIC_WLE5CCUX || GENERIC_WL55CCUX */
636664

637665
Serial.println(F("Data output device(s):"));
638666

software/firmware/source/SoftRF/src/platform/STM32.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -267,8 +267,8 @@ typedef struct stm32_backup_struct {
267267
#define UATSerial Serial
268268
#define SerialOutput Serial
269269

270-
#define SOC_ADC_VOLTAGE_DIV 1 /* TBD */
271-
#define VREFINT 1200 /* TBD */
270+
#define SOC_ADC_VOLTAGE_DIV 1 /* TBD */
271+
#define VREFINT 1212 // mV, STM32WLE5 datasheet value
272272

273273
#include "iomap/Olimex_STM32WL.h"
274274

@@ -331,8 +331,8 @@ typedef struct stm32_backup_struct {
331331
#define UATSerial Serial
332332
#define SerialOutput Serial
333333

334-
#define SOC_ADC_VOLTAGE_DIV 1 /* TBD */
335-
#define VREFINT 1200 /* TBD */
334+
#define SOC_ADC_VOLTAGE_DIV 2.3 // T3-STM32 has 100k/100k voltage divider
335+
#define VREFINT 1212 // mV, STM32WL55 datasheet value
336336

337337
#include "iomap/LilyGO_T3_STM32.h"
338338

Lines changed: 23 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
11

22
/* Peripherals */
3-
#define SOC_GPIO_PIN_CONS_RX PA10
4-
#define SOC_GPIO_PIN_CONS_TX PA9
3+
#define SOC_GPIO_PIN_CONS_RX PA10 /* USART1_RX */
4+
#define SOC_GPIO_PIN_CONS_TX PA9 /* USART1_TX */
55

6-
#define SOC_GPIO_PIN_GNSS_RX PA3
7-
#define SOC_GPIO_PIN_GNSS_TX PA2
8-
#define SOC_GPIO_PIN_GNSS_PPS PB7
6+
#define SOC_GPIO_PIN_GNSS_RX PA3 /* USART2_RX */
7+
#define SOC_GPIO_PIN_GNSS_TX PA2 /* USART2_TX */
8+
#define SOC_GPIO_PIN_GNSS_PPS PB5
99

10-
#define SOC_GPIO_PIN_LED PB8 // ext. NeoPixel
10+
#define SOC_GPIO_PIN_LED PA12 // ext. NeoPixel
1111

12-
#define SOC_GPIO_LED_GREEN PA0 // active HIGH
13-
#define SOC_GPIO_LED_RED PA1 // active HIGH
12+
#define SOC_GPIO_LED_GREEN PA0 // active HIGH
13+
#define SOC_GPIO_LED_RED PA1 // active HIGH
1414
#define SOC_GPIO_PIN_STATUS SOC_GPIO_LED_GREEN
1515

16-
#define SOC_GPIO_PIN_BUZZER PB4 // ext. buzzer
16+
#define SOC_GPIO_PIN_BUZZER PB4 // ext. buzzer
1717

18-
#define SOC_GPIO_PIN_BATTERY PB3
18+
#define SOC_GPIO_PIN_BATTERY PB3 // 100K + 100K voltage divider on VBAT
19+
#define SOC_GPIO_PIN_SOLAR PA11 // 100K + 100K voltage divider on SOLAR_IN
1920

2021
/* I2C */
21-
#define SOC_GPIO_PIN_SDA PA11
22-
#define SOC_GPIO_PIN_SCL PA12
22+
#define SOC_GPIO_PIN_SDA PB7 /* I2C1_SDA */
23+
#define SOC_GPIO_PIN_SCL PB8 /* I2C1_SCL */
2324

2425
/* SPI */
25-
#define SOC_GPIO_PIN_MOSI PA7
26-
#define SOC_GPIO_PIN_MISO PA6
27-
#define SOC_GPIO_PIN_SCK PA5
26+
#define SOC_GPIO_PIN_MOSI PA7 /* SPI1_MOSI */
27+
#define SOC_GPIO_PIN_MISO PA6 /* SPI1_MISO */
28+
#define SOC_GPIO_PIN_SCK PA5 /* SPI1_SCK */
2829

2930
/* Micro-SD */
30-
#define SOC_GPIO_PIN_SD_SS PA4
31+
#define SOC_GPIO_PIN_SD_SS PA4 /* SPI1_NSS */
3132

3233
/* OLED */
33-
#define SOC_GPIO_PIN_OLED_SS PB12
34+
#define SOC_GPIO_PIN_OLED_SS PB12 /* SPI2_NSS */
3435
#define SOC_GPIO_PIN_OLED_DC PA8
3536

3637
/* SX1262 */
@@ -42,12 +43,14 @@
4243
#define SOC_GPIO_TCXO PB0
4344

4445
/* RF antenna switch */
45-
#define SOC_GPIO_ANT_RX PB2 /* active HIGH */
46-
#define SOC_GPIO_ANT_TX PB6 /* active HIGH */
46+
#define SOC_GPIO_ANT_RX PB2 /* active HIGH */
47+
#define SOC_GPIO_ANT_TX PB6 /* active HIGH */
4748

4849
/* button */
49-
#define SOC_GPIO_PIN_BUTTON PH3 // BOOT0
50+
#define SOC_GPIO_PIN_BUTTON PH3 // BOOT0
5051

5152
/* 32768 Hz crystal */
5253
#define SOC_GPIO_PIN_XP PC14
5354
#define SOC_GPIO_PIN_XN PC15
55+
56+
/* Spare: PA15 , PC13 */

software/firmware/source/SoftRF/src/platform/nRF52.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,6 +1052,9 @@ static void nRF52_setup()
10521052
if (Wire.endTransmission() == 0) {
10531053
nRF52_board = NRF52_LILYGO_TECHO_PLUS;
10541054
}
1055+
} else {
1056+
Wire.beginTransmission(SC7A20H_ADDRESS_L);
1057+
nRF52_has_imu = (Wire.endTransmission() == 0);
10551058
}
10561059
}
10571060
}
@@ -1703,6 +1706,8 @@ static void nRF52_setup()
17031706

17041707
case NRF52_ELECROW_TN_M3:
17051708
/* TBD */
1709+
hw_info.imu = ACC_SC7A20H;
1710+
IMU_Time_Marker = millis();
17061711
break;
17071712

17081713
default:

0 commit comments

Comments
 (0)