From 3aabdf2f6bc4119576248bc383d20da47e759748 Mon Sep 17 00:00:00 2001 From: Angus Gratton Date: Tue, 31 May 2022 16:37:40 +1000 Subject: [PATCH] stm32/boards/B_L072Z_LRWAN1: Add pin definitions for internal SX1262. Includes fixing the SCK connection pin. This work was funded through GitHub Sponsors. Signed-off-by: Angus Gratton --- .../boards/B_L072Z_LRWAN1/mpconfigboard.h | 3 ++- ports/stm32/boards/B_L072Z_LRWAN1/pins.csv | 22 +++++++++++++++---- 2 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ports/stm32/boards/B_L072Z_LRWAN1/mpconfigboard.h b/ports/stm32/boards/B_L072Z_LRWAN1/mpconfigboard.h index 7d96eedda9..375b971786 100644 --- a/ports/stm32/boards/B_L072Z_LRWAN1/mpconfigboard.h +++ b/ports/stm32/boards/B_L072Z_LRWAN1/mpconfigboard.h @@ -40,8 +40,9 @@ #define MICROPY_HW_I2C1_SDA (pin_B9) // SPI buses +// SPI1 on the CMWX1ZZABZ module is connected internally to the SX1276 #define MICROPY_HW_SPI1_NSS (pin_A15) -#define MICROPY_HW_SPI1_SCK (pin_A5) +#define MICROPY_HW_SPI1_SCK (pin_B3) #define MICROPY_HW_SPI1_MISO (pin_A6) #define MICROPY_HW_SPI1_MOSI (pin_A7) #define MICROPY_HW_SPI2_NSS (pin_B12) diff --git a/ports/stm32/boards/B_L072Z_LRWAN1/pins.csv b/ports/stm32/boards/B_L072Z_LRWAN1/pins.csv index e54b8b818a..82bc9ceb95 100644 --- a/ports/stm32/boards/B_L072Z_LRWAN1/pins.csv +++ b/ports/stm32/boards/B_L072Z_LRWAN1/pins.csv @@ -29,17 +29,26 @@ LED_RED,PB7 ,PA3 ,PA4 ,PA5 -,PA6 -,PA7 +SX_MISO,PA6 +SX_MOSI,PA7 ,PA8 ,PA9 ,PA10 ,PA11 -,PA12 +SX_TCXO_VCC,PA12 +# Note about SX_TCXO_VCC: Unlike all of the other SX_ pins, PA12 is only +# connected to TCXO_VCC on the Discovery Board and will have a different +# connection on custom hardware using the same Murata module. +# +# By default it also does nothing, need to move jumper JP9 to make it control +# TCXO_VCC at all. Note PA12 is by default also USB DP so need to disable +# USB - call pyb.usb_mode(None) or rebuild without MICROPY_HW_ENABLE_USB - +# in order to use it at all. ,PA13 ,PA14 -,PA15 +SX_CS,PA15 ,PB2 +SX_SCK,PB3 ,PB5 ,PB6 ,PB7 @@ -49,3 +58,8 @@ LED_RED,PB7 ,PB13 ,PB14 ,PB15 +SX_RESET,PC0 +SX_DIO0,PB4 +SX_DIO1,PB1 +SX_DIO2,PB0 +SX_DIO3,PC13