From be5665e4efb49d8507d0e080688234ad7b5bb19b Mon Sep 17 00:00:00 2001 From: Frederic Pillon Date: Mon, 15 Mar 2021 14:29:58 +0100 Subject: [PATCH] [variant] Add Generic L1xx Signed-off-by: Frederic Pillon --- README.md | 16 +- boards.txt | 314 +++++++++++++++++- .../PeripheralPins_RAK811_TRACKER.c | 218 ++++++++++++ .../generic_clock.c | 33 +- .../ldscript.ld | 177 ++++++++++ .../variant_RAK811_TRACKER.cpp | 44 +-- .../variant_RAK811_TRACKER.h | 131 ++++---- .../L151RET_L152RET_L162RET/PeripheralPins.c | 5 +- .../L151RET_L152RET_L162RET/generic_clock.c | 33 +- .../L151RET_L152RET_L162RET/ldscript.ld | 177 ++++++++++ .../variant_NUCLEO_L152RE.cpp | 148 +++++++++ .../variant_NUCLEO_L152RE.h | 155 +++++++++ .../STM32L1xx/NUCLEO_L152RE/PeripheralPins.c | 256 -------------- .../STM32L1xx/NUCLEO_L152RE/PinNamesVar.h | 30 -- variants/STM32L1xx/NUCLEO_L152RE/ldscript.ld | 188 ----------- .../NUCLEO_L152RE/variant_NUCLEO_L152RE.cpp | 171 ---------- .../NUCLEO_L152RE/variant_NUCLEO_L152RE.h | 142 -------- .../STM32L1xx/RAK811_TRACKER/PeripheralPins.c | 227 ------------- .../STM32L1xx/RAK811_TRACKER/PinNamesVar.h | 30 -- variants/STM32L1xx/RAK811_TRACKER/ldscript.ld | 188 ----------- 20 files changed, 1330 insertions(+), 1353 deletions(-) create mode 100644 variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/PeripheralPins_RAK811_TRACKER.c create mode 100644 variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/ldscript.ld rename variants/STM32L1xx/{RAK811_TRACKER => L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)}/variant_RAK811_TRACKER.cpp (63%) rename variants/STM32L1xx/{RAK811_TRACKER => L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)}/variant_RAK811_TRACKER.h (52%) create mode 100644 variants/STM32L1xx/L151RET_L152RET_L162RET/ldscript.ld create mode 100644 variants/STM32L1xx/L151RET_L152RET_L162RET/variant_NUCLEO_L152RE.cpp create mode 100644 variants/STM32L1xx/L151RET_L152RET_L162RET/variant_NUCLEO_L152RE.h delete mode 100644 variants/STM32L1xx/NUCLEO_L152RE/PeripheralPins.c delete mode 100644 variants/STM32L1xx/NUCLEO_L152RE/PinNamesVar.h delete mode 100644 variants/STM32L1xx/NUCLEO_L152RE/ldscript.ld delete mode 100644 variants/STM32L1xx/NUCLEO_L152RE/variant_NUCLEO_L152RE.cpp delete mode 100644 variants/STM32L1xx/NUCLEO_L152RE/variant_NUCLEO_L152RE.h delete mode 100644 variants/STM32L1xx/RAK811_TRACKER/PeripheralPins.c delete mode 100644 variants/STM32L1xx/RAK811_TRACKER/PinNamesVar.h delete mode 100644 variants/STM32L1xx/RAK811_TRACKER/ldscript.ld diff --git a/README.md b/README.md index a8b5d87811..e98eb33dfc 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d - [Generic STM32G4 boards](#generic-stm32g4-boards) - [Generic STM32H7 boards](#generic-stm32h7-boards) - [Generic STM32L0 boards](#generic-stm32l0-boards) + - [Generic STM32L1 boards](#generic-stm32l1-boards) - [Generic STM32L4 boards](#generic-stm32l4-boards) - [Generic STM32L5 boards](#generic-stm32l5-boards) - [Generic STM32WB boards](#generic-stm32wb-boards) @@ -273,6 +274,19 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d | :green_heart: | STM32L072RB | [PX-HER0](https://piconomix.com/fwlib/_p_i_c_o_n_o_m_i_x__s_t_m32__h_e_r_o__b_o_a_r_d.html) | *1.8.0* | | | :green_heart: | STM32L072KZ | [ThunderPack v1.0](https://github.com/jgillick/ThunderPack) | *1.8.0* | | +### Generic STM32L1 boards + +| Status | Device(s) | Name | Release | Notes | +| :----: | :-------: | ---- | :-----: | :---- | +| :yellow_heart: | STM32L100C6
STM32L100C6-A | Generic Board | **2.0.0** | | +| :yellow_heart: | STM32L151C6
STM32L151C8
STM32L151CB | Generic Board | **2.0.0** | | +| :yellow_heart: | STM32L151C6-A
STM32L151C8-A
STM32L151CB-A | Generic Board | **2.0.0** | | +| :yellow_heart: | STM32L152C6
STM32L152C8
STM32L152CB | Generic Board | **2.0.0** | | +| :yellow_heart: | STM32L152C6-A
STM32L152C8-A
STM32L152CB-A | Generic Board | **2.0.0** | | +| :yellow_heart: | STM32L151RE | Generic Board | **2.0.0** | | +| :yellow_heart: | STM32L152RE | Generic Board | **2.0.0** | | +| :yellow_heart: | STM32L162RE | Generic Board | **2.0.0** | | + ### Generic STM32L4 boards | Status | Device(s) | Name | Release | Notes | @@ -338,7 +352,7 @@ User can add a STM32 based board following this [wiki](https://github.com/stm32d | Status | Device(s) | Name | Release | Notes | | :----: | :-------: | ---- | :-----: | :---- | | :green_heart: | STM32F072C8
STM32F072CB | [Elektor LoRa Node](https://github.com/ElektorLabs/180516-Elektor_LoRa_Node) | *1.8.0* | [More info](https://www.elektormagazine.com/labs/lorawan-node-experimental-platform) | -| :green_heart: | STM32L151RB | [RAK811 LoRa Tracker](https://www.rakwireless.com/en/) | *1.4.0* | [Wiki](https://github.com/stm32duino/wiki/wiki/Connectivities#lora) | +| :green_heart: | STM32L151CB | [RAK811 LoRa Tracker](https://www.rakwireless.com/en/) | *1.4.0* | [Wiki](https://github.com/stm32duino/wiki/wiki/Connectivities#lora) | | :green_heart: | STM32L051C8 | [RHF76-052](https://www.ai-thinker.com/) | *1.7.0* | Basic support | ### Electronic Speed Controller boards diff --git a/boards.txt b/boards.txt index f4d60b461b..299348ffe4 100644 --- a/boards.txt +++ b/boards.txt @@ -411,7 +411,7 @@ Nucleo_64.menu.pnum.NUCLEO_L152RE.build.mcu=cortex-m3 Nucleo_64.menu.pnum.NUCLEO_L152RE.build.board=NUCLEO_L152RE Nucleo_64.menu.pnum.NUCLEO_L152RE.build.series=STM32L1xx Nucleo_64.menu.pnum.NUCLEO_L152RE.build.product_line=STM32L152xE -Nucleo_64.menu.pnum.NUCLEO_L152RE.build.variant=STM32L1xx/NUCLEO_L152RE +Nucleo_64.menu.pnum.NUCLEO_L152RE.build.variant=STM32L1xx/L151RET_L152RET_L162RET Nucleo_64.menu.pnum.NUCLEO_L152RE.build.cmsis_lib_gcc=arm_cortexM3l_math # NUCLEO_L433RC_P board @@ -2537,6 +2537,265 @@ GenL0.menu.upload_method.bmpMethod=BMP (Black Magic Probe) GenL0.menu.upload_method.bmpMethod.upload.protocol=gdb_bmp GenL0.menu.upload_method.bmpMethod.upload.tool=bmp_upload +################################################################################ +# Generic L1 +GenL1.name=Generic STM32L1 series + +GenL1.build.core=arduino +GenL1.build.board=GenL1 +GenL1.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} +GenL1.build.mcu=cortex-m3 +GenL1.build.series=STM32L1xx +GenL1.build.cmsis_lib_gcc=arm_cortexM3l_math + +# Generic L100C6Ux +GenL1.menu.pnum.GENERIC_L100C6UX=Generic L100C6Ux +GenL1.menu.pnum.GENERIC_L100C6UX.upload.maximum_size=32768 +GenL1.menu.pnum.GENERIC_L100C6UX.upload.maximum_data_size=4096 +GenL1.menu.pnum.GENERIC_L100C6UX.build.board=GENERIC_L100C6UX +GenL1.menu.pnum.GENERIC_L100C6UX.build.product_line=STM32L100xB +GenL1.menu.pnum.GENERIC_L100C6UX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L100C6UxA +GenL1.menu.pnum.GENERIC_L100C6UXA=Generic L100C6UxA +GenL1.menu.pnum.GENERIC_L100C6UXA.upload.maximum_size=32768 +GenL1.menu.pnum.GENERIC_L100C6UXA.upload.maximum_data_size=10240 +GenL1.menu.pnum.GENERIC_L100C6UXA.build.board=GENERIC_L100C6UXA +GenL1.menu.pnum.GENERIC_L100C6UXA.build.product_line=STM32L100xB +GenL1.menu.pnum.GENERIC_L100C6UXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151C6Tx +GenL1.menu.pnum.GENERIC_L151C6TX=Generic L151C6Tx +GenL1.menu.pnum.GENERIC_L151C6TX.upload.maximum_size=32768 +GenL1.menu.pnum.GENERIC_L151C6TX.upload.maximum_data_size=10240 +GenL1.menu.pnum.GENERIC_L151C6TX.build.board=GENERIC_L151C6TX +GenL1.menu.pnum.GENERIC_L151C6TX.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151C6TX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151C8Tx +GenL1.menu.pnum.GENERIC_L151C8TX=Generic L151C8Tx +GenL1.menu.pnum.GENERIC_L151C8TX.upload.maximum_size=65536 +GenL1.menu.pnum.GENERIC_L151C8TX.upload.maximum_data_size=10240 +GenL1.menu.pnum.GENERIC_L151C8TX.build.board=GENERIC_L151C8TX +GenL1.menu.pnum.GENERIC_L151C8TX.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151C8TX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151CBTx +GenL1.menu.pnum.GENERIC_L151CBTX=Generic L151CBTx +GenL1.menu.pnum.GENERIC_L151CBTX.upload.maximum_size=131072 +GenL1.menu.pnum.GENERIC_L151CBTX.upload.maximum_data_size=16384 +GenL1.menu.pnum.GENERIC_L151CBTX.build.board=GENERIC_L151CBTX +GenL1.menu.pnum.GENERIC_L151CBTX.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151CBTX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151C6TxA +GenL1.menu.pnum.GENERIC_L151C6TXA=Generic L151C6TxA +GenL1.menu.pnum.GENERIC_L151C6TXA.upload.maximum_size=32768 +GenL1.menu.pnum.GENERIC_L151C6TXA.upload.maximum_data_size=16384 +GenL1.menu.pnum.GENERIC_L151C6TXA.build.board=GENERIC_L151C6TXA +GenL1.menu.pnum.GENERIC_L151C6TXA.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151C6TXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151C8TxA +GenL1.menu.pnum.GENERIC_L151C8TXA=Generic L151C8TxA +GenL1.menu.pnum.GENERIC_L151C8TXA.upload.maximum_size=65536 +GenL1.menu.pnum.GENERIC_L151C8TXA.upload.maximum_data_size=32768 +GenL1.menu.pnum.GENERIC_L151C8TXA.build.board=GENERIC_L151C8TXA +GenL1.menu.pnum.GENERIC_L151C8TXA.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151C8TXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151CBTxA +GenL1.menu.pnum.GENERIC_L151CBTXA=Generic L151CBTxA +GenL1.menu.pnum.GENERIC_L151CBTXA.upload.maximum_size=131072 +GenL1.menu.pnum.GENERIC_L151CBTXA.upload.maximum_data_size=32768 +GenL1.menu.pnum.GENERIC_L151CBTXA.build.board=GENERIC_L151CBTXA +GenL1.menu.pnum.GENERIC_L151CBTXA.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151CBTXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151C6Ux +GenL1.menu.pnum.GENERIC_L151C6UX=Generic L151C6Ux +GenL1.menu.pnum.GENERIC_L151C6UX.upload.maximum_size=32768 +GenL1.menu.pnum.GENERIC_L151C6UX.upload.maximum_data_size=10240 +GenL1.menu.pnum.GENERIC_L151C6UX.build.board=GENERIC_L151C6UX +GenL1.menu.pnum.GENERIC_L151C6UX.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151C6UX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151C8Ux +GenL1.menu.pnum.GENERIC_L151C8UX=Generic L151C8Ux +GenL1.menu.pnum.GENERIC_L151C8UX.upload.maximum_size=65536 +GenL1.menu.pnum.GENERIC_L151C8UX.upload.maximum_data_size=10240 +GenL1.menu.pnum.GENERIC_L151C8UX.build.board=GENERIC_L151C8UX +GenL1.menu.pnum.GENERIC_L151C8UX.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151C8UX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151CBUx +GenL1.menu.pnum.GENERIC_L151CBUX=Generic L151CBUx +GenL1.menu.pnum.GENERIC_L151CBUX.upload.maximum_size=131072 +GenL1.menu.pnum.GENERIC_L151CBUX.upload.maximum_data_size=16384 +GenL1.menu.pnum.GENERIC_L151CBUX.build.board=GENERIC_L151CBUX +GenL1.menu.pnum.GENERIC_L151CBUX.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151CBUX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151C6UxA +GenL1.menu.pnum.GENERIC_L151C6UXA=Generic L151C6UxA +GenL1.menu.pnum.GENERIC_L151C6UXA.upload.maximum_size=32768 +GenL1.menu.pnum.GENERIC_L151C6UXA.upload.maximum_data_size=16384 +GenL1.menu.pnum.GENERIC_L151C6UXA.build.board=GENERIC_L151C6UXA +GenL1.menu.pnum.GENERIC_L151C6UXA.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151C6UXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151C8UxA +GenL1.menu.pnum.GENERIC_L151C8UXA=Generic L151C8UxA +GenL1.menu.pnum.GENERIC_L151C8UXA.upload.maximum_size=65536 +GenL1.menu.pnum.GENERIC_L151C8UXA.upload.maximum_data_size=32768 +GenL1.menu.pnum.GENERIC_L151C8UXA.build.board=GENERIC_L151C8UXA +GenL1.menu.pnum.GENERIC_L151C8UXA.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151C8UXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151CBUxA +GenL1.menu.pnum.GENERIC_L151CBUXA=Generic L151CBUxA +GenL1.menu.pnum.GENERIC_L151CBUXA.upload.maximum_size=131072 +GenL1.menu.pnum.GENERIC_L151CBUXA.upload.maximum_data_size=32768 +GenL1.menu.pnum.GENERIC_L151CBUXA.build.board=GENERIC_L151CBUXA +GenL1.menu.pnum.GENERIC_L151CBUXA.build.product_line=STM32L151xB +GenL1.menu.pnum.GENERIC_L151CBUXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152C6Tx +GenL1.menu.pnum.GENERIC_L152C6TX=Generic L152C6Tx +GenL1.menu.pnum.GENERIC_L152C6TX.upload.maximum_size=32768 +GenL1.menu.pnum.GENERIC_L152C6TX.upload.maximum_data_size=10240 +GenL1.menu.pnum.GENERIC_L152C6TX.build.board=GENERIC_L152C6TX +GenL1.menu.pnum.GENERIC_L152C6TX.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152C6TX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152C8Tx +GenL1.menu.pnum.GENERIC_L152C8TX=Generic L152C8Tx +GenL1.menu.pnum.GENERIC_L152C8TX.upload.maximum_size=65536 +GenL1.menu.pnum.GENERIC_L152C8TX.upload.maximum_data_size=10240 +GenL1.menu.pnum.GENERIC_L152C8TX.build.board=GENERIC_L152C8TX +GenL1.menu.pnum.GENERIC_L152C8TX.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152C8TX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152CBTx +GenL1.menu.pnum.GENERIC_L152CBTX=Generic L152CBTx +GenL1.menu.pnum.GENERIC_L152CBTX.upload.maximum_size=131072 +GenL1.menu.pnum.GENERIC_L152CBTX.upload.maximum_data_size=16384 +GenL1.menu.pnum.GENERIC_L152CBTX.build.board=GENERIC_L152CBTX +GenL1.menu.pnum.GENERIC_L152CBTX.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152CBTX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152C6TxA +GenL1.menu.pnum.GENERIC_L152C6TXA=Generic L152C6TxA +GenL1.menu.pnum.GENERIC_L152C6TXA.upload.maximum_size=32768 +GenL1.menu.pnum.GENERIC_L152C6TXA.upload.maximum_data_size=16384 +GenL1.menu.pnum.GENERIC_L152C6TXA.build.board=GENERIC_L152C6TXA +GenL1.menu.pnum.GENERIC_L152C6TXA.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152C6TXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152C8TxA +GenL1.menu.pnum.GENERIC_L152C8TXA=Generic L152C8TxA +GenL1.menu.pnum.GENERIC_L152C8TXA.upload.maximum_size=65536 +GenL1.menu.pnum.GENERIC_L152C8TXA.upload.maximum_data_size=32768 +GenL1.menu.pnum.GENERIC_L152C8TXA.build.board=GENERIC_L152C8TXA +GenL1.menu.pnum.GENERIC_L152C8TXA.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152C8TXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152CBTxA +GenL1.menu.pnum.GENERIC_L152CBTXA=Generic L152CBTxA +GenL1.menu.pnum.GENERIC_L152CBTXA.upload.maximum_size=131072 +GenL1.menu.pnum.GENERIC_L152CBTXA.upload.maximum_data_size=32768 +GenL1.menu.pnum.GENERIC_L152CBTXA.build.board=GENERIC_L152CBTXA +GenL1.menu.pnum.GENERIC_L152CBTXA.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152CBTXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152C6Ux +GenL1.menu.pnum.GENERIC_L152C6UX=Generic L152C6Ux +GenL1.menu.pnum.GENERIC_L152C6UX.upload.maximum_size=32768 +GenL1.menu.pnum.GENERIC_L152C6UX.upload.maximum_data_size=10240 +GenL1.menu.pnum.GENERIC_L152C6UX.build.board=GENERIC_L152C6UX +GenL1.menu.pnum.GENERIC_L152C6UX.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152C6UX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152C8Ux +GenL1.menu.pnum.GENERIC_L152C8UX=Generic L152C8Ux +GenL1.menu.pnum.GENERIC_L152C8UX.upload.maximum_size=65536 +GenL1.menu.pnum.GENERIC_L152C8UX.upload.maximum_data_size=10240 +GenL1.menu.pnum.GENERIC_L152C8UX.build.board=GENERIC_L152C8UX +GenL1.menu.pnum.GENERIC_L152C8UX.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152C8UX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152CBUx +GenL1.menu.pnum.GENERIC_L152CBUX=Generic L152CBUx +GenL1.menu.pnum.GENERIC_L152CBUX.upload.maximum_size=131072 +GenL1.menu.pnum.GENERIC_L152CBUX.upload.maximum_data_size=16384 +GenL1.menu.pnum.GENERIC_L152CBUX.build.board=GENERIC_L152CBUX +GenL1.menu.pnum.GENERIC_L152CBUX.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152CBUX.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152C6UxA +GenL1.menu.pnum.GENERIC_L152C6UXA=Generic L152C6UxA +GenL1.menu.pnum.GENERIC_L152C6UXA.upload.maximum_size=32768 +GenL1.menu.pnum.GENERIC_L152C6UXA.upload.maximum_data_size=16384 +GenL1.menu.pnum.GENERIC_L152C6UXA.build.board=GENERIC_L152C6UXA +GenL1.menu.pnum.GENERIC_L152C6UXA.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152C6UXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152C8UxA +GenL1.menu.pnum.GENERIC_L152C8UXA=Generic L152C8UxA +GenL1.menu.pnum.GENERIC_L152C8UXA.upload.maximum_size=65536 +GenL1.menu.pnum.GENERIC_L152C8UXA.upload.maximum_data_size=32768 +GenL1.menu.pnum.GENERIC_L152C8UXA.build.board=GENERIC_L152C8UXA +GenL1.menu.pnum.GENERIC_L152C8UXA.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152C8UXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L152CBUxA +GenL1.menu.pnum.GENERIC_L152CBUXA=Generic L152CBUxA +GenL1.menu.pnum.GENERIC_L152CBUXA.upload.maximum_size=131072 +GenL1.menu.pnum.GENERIC_L152CBUXA.upload.maximum_data_size=32768 +GenL1.menu.pnum.GENERIC_L152CBUXA.build.board=GENERIC_L152CBUXA +GenL1.menu.pnum.GENERIC_L152CBUXA.build.product_line=STM32L152xB +GenL1.menu.pnum.GENERIC_L152CBUXA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) + +# Generic L151RETx +GenL1.menu.pnum.GENERIC_L151RETX=Generic L151RETx +GenL1.menu.pnum.GENERIC_L151RETX.upload.maximum_size=524288 +GenL1.menu.pnum.GENERIC_L151RETX.upload.maximum_data_size=81920 +GenL1.menu.pnum.GENERIC_L151RETX.build.board=GENERIC_L151RETX +GenL1.menu.pnum.GENERIC_L151RETX.build.product_line=STM32L151xE +GenL1.menu.pnum.GENERIC_L151RETX.build.variant=STM32L1xx/L151RET_L152RET_L162RET + +# Generic L152RETx +GenL1.menu.pnum.GENERIC_L152RETX=Generic L152RETx +GenL1.menu.pnum.GENERIC_L152RETX.upload.maximum_size=524288 +GenL1.menu.pnum.GENERIC_L152RETX.upload.maximum_data_size=81920 +GenL1.menu.pnum.GENERIC_L152RETX.build.board=GENERIC_L152RETX +GenL1.menu.pnum.GENERIC_L152RETX.build.product_line=STM32L152xE +GenL1.menu.pnum.GENERIC_L152RETX.build.variant=STM32L1xx/L151RET_L152RET_L162RET + +# Generic L162RETx +GenL1.menu.pnum.GENERIC_L162RETX=Generic L162RETx +GenL1.menu.pnum.GENERIC_L162RETX.upload.maximum_size=524288 +GenL1.menu.pnum.GENERIC_L162RETX.upload.maximum_data_size=81920 +GenL1.menu.pnum.GENERIC_L162RETX.build.board=GENERIC_L162RETX +GenL1.menu.pnum.GENERIC_L162RETX.build.product_line=STM32L162xE +GenL1.menu.pnum.GENERIC_L162RETX.build.variant=STM32L1xx/L151RET_L152RET_L162RET + +# Upload menu +GenL1.menu.upload_method.swdMethod=STM32CubeProgrammer (SWD) +GenL1.menu.upload_method.swdMethod.upload.protocol=0 +GenL1.menu.upload_method.swdMethod.upload.options=-g +GenL1.menu.upload_method.swdMethod.upload.tool=stm32CubeProg + +GenL1.menu.upload_method.serialMethod=STM32CubeProgrammer (Serial) +GenL1.menu.upload_method.serialMethod.upload.protocol=1 +GenL1.menu.upload_method.serialMethod.upload.options={serial.port.file} -s +GenL1.menu.upload_method.serialMethod.upload.tool=stm32CubeProg + +GenL1.menu.upload_method.dfuMethod=STM32CubeProgrammer (DFU) +GenL1.menu.upload_method.dfuMethod.upload.protocol=2 +GenL1.menu.upload_method.dfuMethod.upload.options=-g +GenL1.menu.upload_method.dfuMethod.upload.tool=stm32CubeProg + ################################################################################ # Generic L4 GenL4.name=Generic STM32L4 series @@ -3166,24 +3425,26 @@ LoRa.build.extra_flags=-D{build.product_line} {build.enable_usb} {build.xSerial} # RAK811_TRACKER board LoRa.menu.pnum.RAK811_TRACKER=RAK811 LoRa Tracker (16kb RAM) -LoRa.menu.pnum.RAK811_TRACKER.upload.maximum_data_size=16384 LoRa.menu.pnum.RAK811_TRACKER.upload.maximum_size=131072 +LoRa.menu.pnum.RAK811_TRACKER.upload.maximum_data_size=16384 LoRa.menu.pnum.RAK811_TRACKER.build.mcu=cortex-m3 LoRa.menu.pnum.RAK811_TRACKER.build.board=RAK811_TRACKER LoRa.menu.pnum.RAK811_TRACKER.build.series=STM32L1xx LoRa.menu.pnum.RAK811_TRACKER.build.product_line=STM32L151xB -LoRa.menu.pnum.RAK811_TRACKER.build.variant=STM32L1xx/RAK811_TRACKER +LoRa.menu.pnum.RAK811_TRACKER.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) +LoRa.menu.pnum.RAK811_TRACKER.build.peripheral_pins=-DCUSTOM_PERIPHERAL_PINS LoRa.menu.pnum.RAK811_TRACKER.build.cmsis_lib_gcc=arm_cortexM3l_math LoRa.menu.pnum.RAK811_TRACKERA=RAK811 LoRa Tracker (32kb RAM) -LoRa.menu.pnum.RAK811_TRACKERA.upload.maximum_data_size=32768 LoRa.menu.pnum.RAK811_TRACKERA.upload.maximum_size=131072 +LoRa.menu.pnum.RAK811_TRACKERA.upload.maximum_data_size=32768 LoRa.menu.pnum.RAK811_TRACKERA.build.mcu=cortex-m3 LoRa.menu.pnum.RAK811_TRACKERA.build.board=RAK811_TRACKERA LoRa.menu.pnum.RAK811_TRACKERA.build.series=STM32L1xx LoRa.menu.pnum.RAK811_TRACKERA.build.product_line=STM32L151xBA -LoRa.menu.pnum.RAK811_TRACKERA.build.variant=STM32L1xx/RAK811_TRACKER +LoRa.menu.pnum.RAK811_TRACKERA.build.variant=STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A) LoRa.menu.pnum.RAK811_TRACKERA.build.variant_h=variant_RAK811_TRACKER.h +LoRa.menu.pnum.RAK811_TRACKERA.build.peripheral_pins=-DCUSTOM_PERIPHERAL_PINS LoRa.menu.pnum.RAK811_TRACKERA.build.cmsis_lib_gcc=arm_cortexM3l_math # RHF76_052 board @@ -3722,6 +3983,12 @@ GenL0.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE GenL0.menu.xserial.disabled=Disabled (no Serial support) GenL0.menu.xserial.disabled.build.xSerial= +GenL1.menu.xserial.generic=Enabled (generic 'Serial') +GenL1.menu.xserial.none=Enabled (no generic 'Serial') +GenL1.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE +GenL1.menu.xserial.disabled=Disabled (no Serial support) +GenL1.menu.xserial.disabled.build.xSerial= + GenL4.menu.xserial.generic=Enabled (generic 'Serial') GenL4.menu.xserial.none=Enabled (no generic 'Serial') GenL4.menu.xserial.none.build.xSerial=-DHAL_UART_MODULE_ENABLED -DHWSERIAL_NONE @@ -3934,6 +4201,14 @@ GenL0.menu.usb.CDC.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC -DDISABLE_G GenL0.menu.usb.HID=HID (keyboard and mouse) GenL0.menu.usb.HID.build.enable_usb={build.usb_flags} -DUSBD_USE_HID_COMPOSITE +GenL1.menu.usb.none=None +GenL1.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART) +GenL1.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC +GenL1.menu.usb.CDC=CDC (no generic 'Serial') +GenL1.menu.usb.CDC.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC -DDISABLE_GENERIC_SERIALUSB +GenL1.menu.usb.HID=HID (keyboard and mouse) +GenL1.menu.usb.HID.build.enable_usb={build.usb_flags} -DUSBD_USE_HID_COMPOSITE + GenL4.menu.usb.none=None GenL4.menu.usb.CDCgen=CDC (generic 'Serial' supersede U(S)ART) GenL4.menu.usb.CDCgen.build.enable_usb={build.usb_flags} -DUSBD_USE_CDC @@ -4292,6 +4567,25 @@ GenL0.menu.opt.o3lto.build.flags.optimize=-O3 -flto GenL0.menu.opt.ogstd=Debug (-g) GenL0.menu.opt.ogstd.build.flags.optimize=-g -Og +GenL1.menu.opt.osstd=Smallest (-Os default) +GenL1.menu.opt.osstd.build.flags.optimize=-Os +GenL1.menu.opt.oslto=Smallest (-Os) with LTO +GenL1.menu.opt.oslto.build.flags.optimize=-Os -flto +GenL1.menu.opt.o1std=Fast (-O1) +GenL1.menu.opt.o1std.build.flags.optimize=-O1 +GenL1.menu.opt.o1lto=Fast (-O1) with LTO +GenL1.menu.opt.o1lto.build.flags.optimize=-O1 -flto +GenL1.menu.opt.o2std=Faster (-O2) +GenL1.menu.opt.o2std.build.flags.optimize=-O2 +GenL1.menu.opt.o2lto=Faster (-O2) with LTO +GenL1.menu.opt.o2lto.build.flags.optimize=-O2 -flto +GenL1.menu.opt.o3std=Fastest (-O3) +GenL1.menu.opt.o3std.build.flags.optimize=-O3 +GenL1.menu.opt.o3lto=Fastest (-O3) with LTO +GenL1.menu.opt.o3lto.build.flags.optimize=-O3 -flto +GenL1.menu.opt.ogstd=Debug (-g) +GenL1.menu.opt.ogstd.build.flags.optimize=-g -Og + GenL4.menu.opt.osstd=Smallest (-Os default) GenL4.menu.opt.osstd.build.flags.optimize=-Os GenL4.menu.opt.oslto=Smallest (-Os) with LTO @@ -4608,6 +4902,16 @@ GenL0.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float GenL0.menu.rtlib.full=Newlib Standard GenL0.menu.rtlib.full.build.flags.ldspecs= +GenL1.menu.rtlib.nano=Newlib Nano (default) +GenL1.menu.rtlib.nanofp=Newlib Nano + Float Printf +GenL1.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float +GenL1.menu.rtlib.nanofs=Newlib Nano + Float Scanf +GenL1.menu.rtlib.nanofs.build.flags.ldspecs=--specs=nano.specs -u _scanf_float +GenL1.menu.rtlib.nanofps=Newlib Nano + Float Printf/Scanf +GenL1.menu.rtlib.nanofps.build.flags.ldspecs=--specs=nano.specs -u _printf_float -u _scanf_float +GenL1.menu.rtlib.full=Newlib Standard +GenL1.menu.rtlib.full.build.flags.ldspecs= + GenL4.menu.rtlib.nano=Newlib Nano (default) GenL4.menu.rtlib.nanofp=Newlib Nano + Float Printf GenL4.menu.rtlib.nanofp.build.flags.ldspecs=--specs=nano.specs -u _printf_float diff --git a/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/PeripheralPins_RAK811_TRACKER.c b/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/PeripheralPins_RAK811_TRACKER.c new file mode 100644 index 0000000000..90158a2762 --- /dev/null +++ b/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/PeripheralPins_RAK811_TRACKER.c @@ -0,0 +1,218 @@ +/* + ******************************************************************************* + * Copyright (c) 2021, 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 + * + ******************************************************************************* + */ +/* + * Automatically generated from STM32L151C(6-8-B)Tx.xml + * CubeMX DB release 6.0.10 + */ +#if defined(ARDUINO_RAK811_TRACKER) || defined(ARDUINO_RAK811_TRACKERA) +#include "Arduino.h" +#include "PeripheralPins.h" + +/* ===== + * Notes: + * - The pins mentioned Px_y_ALTz are alternative possibilities which use other + * HW peripheral instances. You can use them the same way as any other "normal" + * pin (i.e. analogWrite(PA7_ALT1, 128);). + * + * - Commented lines are alternative possibilities which are not used per default. + * If you change them, you will have to know what you do + * ===== + */ + +//*** ADC *** + +#ifdef HAL_ADC_MODULE_ENABLED +WEAK const PinMap PinMap_ADC[] = { + // {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0 + {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1 + {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2 - ADC_VBAT + // {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3 - RADIO_DIO_2 + // {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4 - RADIO_RF_CTX_PA + // {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5 - RADIO_SCLK + // {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6 - RADIO_MISO + // {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7 - RADIO_MOSI + // {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8 - RADIO_NSS + // {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9 - RADIO_DIO_1 + {PB_12, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC_IN18 + // {PB_13, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC_IN19 - RADIO_RESET + // {PB_14, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 20, 0)}, // ADC_IN20 - LIS3DH_INT1_PIN + // {PB_15, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 21, 0)}, // ADC_IN21 - LIS3DH_INT2_PIN + {NC, NP, 0} +}; +#endif + +//*** DAC *** + +#ifdef HAL_DAC_MODULE_ENABLED +WEAK const PinMap PinMap_DAC[] = { + {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 - RADIO_RF_CTX_PA + {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 - RADIO_SCLK + {NC, NP, 0} +}; +#endif + +//*** I2C *** + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SDA[] = { + // {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // RADIO_RF_CBT_HF + {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + // {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, // GPS_UART_RX + {NC, NP, 0} +}; +#endif + +#ifdef HAL_I2C_MODULE_ENABLED +WEAK const PinMap PinMap_I2C_SCL[] = { + // {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // RADIO_RF_CRX_RX + {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, + // {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, // GPS_UART_TX + {NC, NP, 0} +}; +#endif + +//*** TIM *** + +#ifdef HAL_TIM_MODULE_ENABLED +WEAK const PinMap PinMap_TIM[] = { + {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 + {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + // {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - ADC_VBAT + // {PA_2_ALT1, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 - ADC_VBAT + // {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - RADIO_DIO_2 + // {PA_3_ALT1, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - RADIO_DIO_2 + // {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - RADIO_SCLK + // {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - RADIO_MISO + // {PA_6_ALT1, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1- RADIO_MISO + // {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - RADIO_MOSI + // {PA_7_ALT1, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 - RADIO_MOSI + // {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - GPS_POWER_ON_PIN + // {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 - RADIO_NSS + // {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 - RADIO_DIO_1 + {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 + {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - LED2 + {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 + // {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 - RADIO_RF_CRX_RX + // {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 - RADIO_RF_CBT_HF + {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 + {PB_8_ALT1, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 + {PB_9_ALT1, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 + // {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - GPS_UART_TX + // {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - GPS_UART_RX + {PB_12, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 + // {PB_13, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 - RADIO_RESET + // {PB_14, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - LIS3DH_INT1_PIN + // {PB_15, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 - LIS3DH_INT2_PIN + {NC, NP, 0} +}; +#endif + +//*** UART *** + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_TX[] = { + // {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // ADC_VBAT + {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // UART_TX + // {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // RADIO_RF_CRX_RX + {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // GPS_UART_TX + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RX[] = { + // {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // RADIO_DIO_2 + {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // UART_RX + // {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // RADIO_RF_CBT_HF + {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // GPS_UART_RX + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_RTS[] = { + {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + // {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // LED1 + // {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // LIS3DH_INT1_PIN + {NC, NP, 0} +}; +#endif + +#ifdef HAL_UART_MODULE_ENABLED +WEAK const PinMap PinMap_UART_CTS[] = { + {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, + // {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // RADIO_DIO_0 + // {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // RADIO_RESET + {NC, NP, 0} +}; +#endif + +//*** SPI *** + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MOSI[] = { + {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // RADIO_MOSI + // {PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // LED1 + // {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // LIS3DH_INT2_PIN + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_MISO[] = { + {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // RADIO_MISO + // {PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // RADIO_DIO_0 + // {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // LED2 + // {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // LIS3DH_INT1_PIN + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SCLK[] = { + {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // RADIO_SCLK + // {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, + // {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // RADIO_RESET + {NC, NP, 0} +}; +#endif + +#ifdef HAL_SPI_MODULE_ENABLED +WEAK const PinMap PinMap_SPI_SSEL[] = { + // {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // RADIO_RF_CTX_PA + // {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // GPS_POWER_ON_PIN + {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, + {NC, NP, 0} +}; +#endif + +//*** No CAN *** + +//*** No ETHERNET *** + +//*** No QUADSPI *** + +//*** USB *** + +#if defined(HAL_PCD_MODULE_ENABLED) || defined(HAL_HCD_MODULE_ENABLED) +WEAK const PinMap PinMap_USB[] = { + {PA_11, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF10_USB)}, // USB_DM + {PA_12, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF10_USB)}, // USB_DP + {NC, NP, 0} +}; +#endif + +//*** No SD *** +#endif /* ARDUINO_ */ diff --git a/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/generic_clock.c b/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/generic_clock.c index 247b533616..1279affe0a 100644 --- a/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/generic_clock.c +++ b/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/generic_clock.c @@ -32,8 +32,37 @@ */ WEAK void SystemClock_Config(void) { - /* SystemClock_Config can be generated by STM32CubeMX */ -#warning "SystemClock_Config() is empty. Default clock at reset is used." + 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 RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; + RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6; + RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + Error_Handler(); + } + /** Initializes the CPU, AHB and APB buses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK + | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { + Error_Handler(); + } } #endif /* ARDUINO_GENERIC_* */ diff --git a/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/ldscript.ld b/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/ldscript.ld new file mode 100644 index 0000000000..a5bd696021 --- /dev/null +++ b/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/ldscript.ld @@ -0,0 +1,177 @@ +/** + ****************************************************************************** + * @file LinkerScript.ld + * @author Auto-generated by STM32CubeIDE + * @brief Linker script for STM32L151CBTxA Device from STM32L1 series + * 128Kbytes FLASH + * 32Kbytes RAM + * + * Set heap size, stack size and stack location according + * to application requirements. + * + * Set memory bank area and size if external memory is used + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2020 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 + * + ****************************************************************************** + */ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ + +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Memories definition */ +MEMORY +{ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE + FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET +} + +/* Sections */ +SECTIONS +{ + /* The startup code into "FLASH" Rom type memory */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data into "FLASH" Rom type memory */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data into "FLASH" Rom type memory */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { + . = ALIGN(4); + *(.ARM.extab* .gnu.linkonce.armextab.*) + . = ALIGN(4); + } >FLASH + + .ARM : { + . = ALIGN(4); + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + . = ALIGN(4); + } >FLASH + + .preinit_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + . = ALIGN(4); + } >FLASH + + .init_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + . = ALIGN(4); + } >FLASH + + .fini_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + . = ALIGN(4); + } >FLASH + + /* Used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections into "RAM" Ram type memory */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + *(.RamFunc) /* .RamFunc sections */ + *(.RamFunc*) /* .RamFunc* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + + } >RAM AT> FLASH + + /* Uninitialized data section into "RAM" Ram type memory */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss section */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + /* Remove information from the compiler libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/variants/STM32L1xx/RAK811_TRACKER/variant_RAK811_TRACKER.cpp b/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/variant_RAK811_TRACKER.cpp similarity index 63% rename from variants/STM32L1xx/RAK811_TRACKER/variant_RAK811_TRACKER.cpp rename to variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/variant_RAK811_TRACKER.cpp index 4e2103b8ad..329f0f7637 100644 --- a/variants/STM32L1xx/RAK811_TRACKER/variant_RAK811_TRACKER.cpp +++ b/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/variant_RAK811_TRACKER.cpp @@ -1,39 +1,18 @@ /* ******************************************************************************* - * Copyright (c) 2018, STMicroelectronics + * Copyright (c) 2021, STMicroelectronics * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 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 * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************* */ - +#if defined(ARDUINO_RAK811_TRACKER) || defined(ARDUINO_RAK811_TRACKERA) #include "pins_arduino.h" -#ifdef __cplusplus -extern "C" { -#endif - // Pin number const PinName digitalPin[] = { PA_0, //D0 @@ -80,10 +59,6 @@ const uint32_t analogInputPin[] = { 18 // A2 }; -#ifdef __cplusplus -} -#endif - // ---------------------------------------------------------------------------- #ifdef __cplusplus @@ -114,7 +89,7 @@ WEAK void SystemClock_Config(void) RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL4; RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV2; if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - _Error_Handler(__FILE__, __LINE__); + Error_Handler(); } /* Initializes the CPU, AHB and APB busses clocks */ @@ -126,16 +101,17 @@ WEAK void SystemClock_Config(void) RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { - _Error_Handler(__FILE__, __LINE__); + Error_Handler(); } PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_RTC; PeriphClkInit.RTCClockSelection = RCC_RTCCLKSOURCE_LSE; if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK) { - _Error_Handler(__FILE__, __LINE__); + Error_Handler(); } } #ifdef __cplusplus } #endif +#endif /* ARDUINO_ */ diff --git a/variants/STM32L1xx/RAK811_TRACKER/variant_RAK811_TRACKER.h b/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/variant_RAK811_TRACKER.h similarity index 52% rename from variants/STM32L1xx/RAK811_TRACKER/variant_RAK811_TRACKER.h rename to variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/variant_RAK811_TRACKER.h index a18ae1cc5d..e5795d42f5 100644 --- a/variants/STM32L1xx/RAK811_TRACKER/variant_RAK811_TRACKER.h +++ b/variants/STM32L1xx/L100C6Ux(A)_L151C(6-8-B)(T-U)x(A)_L152C(6-8-B)(T-U)x(A)/variant_RAK811_TRACKER.h @@ -1,83 +1,65 @@ /* ******************************************************************************* - * Copyright (c) 2018, STMicroelectronics + * Copyright (c) 2021, STMicroelectronics * All rights reserved. * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: + * 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 * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ******************************************************************************* */ - -#ifndef _VARIANT_ARDUINO_STM32_ -#define _VARIANT_ARDUINO_STM32_ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus +#pragma once /*---------------------------------------------------------------------------- - * Pins + * STM32 pins number *----------------------------------------------------------------------------*/ +#define PA0 0 // GPS_PPS_PIN +#define PA8 1 +#define PA9 2 // UART_TX +#define PA10 3 // UART_RX +#define PA12 4 // LED1 +#define PA13 5 +#define PA14 6 +#define PA15 7 // GPS_POWER_ON_PIN +#define PB2 8 +#define PB3 9 +#define PB4 10 // LED2 +#define PB5 11 +#define PB8 12 // I2C_SCL +#define PB9 13 // I2C_SDA +#define PB10 14 // GPS_UART_TX +#define PB11 15 // GPS_UART_RX +#define PA1 PIN_A0 +#define PA2 PIN_A1 // ADC_VBAT +#define PB12 PIN_A2 +#define PB14 19 // LIS3DH_INT1_PIN +#define PB15 20 // LIS3DH_INT2_PIN +#define PB13 21 // RADIO_RESET +#define PH1 22 // RADIO_XTAL_EN +#define PA7 23 // RADIO_MOSI +#define PA6 24 // RADIO_MISO +#define PA5 25 // RADIO_SCLK +#define PB0 26 // RADIO_NSS +#define PA11 27 // RADIO_DIO_0 +#define PB1 28 // RADIO_DIO_1 +#define PA3 29 // RADIO_DIO_2 +#define PH0 30 // RADIO_DIO_3 +#define PC13 31 // RADIO_DIO_4 +#define PB6 32 // RADIO_RF_CRX_RX +#define PB7 33 // RADIO_RF_CBT_HF +#define PA4 34 // RADIO_RF_CTX_PA + +// Alternate pins number +#define PA2_ALT1 (PA2 | ALT1) +#define PA3_ALT1 (PA3 | ALT1) +#define PA6_ALT1 (PA6 | ALT1) +#define PA7_ALT1 (PA7 | ALT1) +#define PB8_ALT1 (PB8 | ALT1) +#define PB9_ALT1 (PB9 | ALT1) -#define PA0 0 // GPS_PPS_PIN -#define PA8 1 -#define PA9 2 // UART_TX -#define PA10 3 // UART_RX -#define PA12 4 // LED1 -#define PA13 5 -#define PA14 6 -#define PA15 7 // GPS_POWER_ON_PIN -#define PB2 8 -#define PB3 9 -#define PB4 10 // LED2 -#define PB5 11 -#define PB8 12 // I2C_SCL -#define PB9 13 // I2C_SDA -#define PB10 14 // GPS_UART_TX -#define PB11 15 // GPS_UART_RX -#define PA1 A0 -#define PA2 A1 // ADC_VBAT -#define PB12 A2 -#define PB14 19 // LIS3DH_INT1_PIN -#define PB15 20 // LIS3DH_INT2_PIN -#define PB13 21 // RADIO_RESET -#define PH1 22 // RADIO_XTAL_EN -#define PA7 23 // RADIO_MOSI -#define PA6 24 // RADIO_MISO -#define PA5 25 // RADIO_SCLK -#define PB0 26 // RADIO_NSS -#define PA11 27 // RADIO_DIO_0 -#define PB1 28 // RADIO_DIO_1 -#define PA3 29 // RADIO_DIO_2 -#define PH0 30 // RADIO_DIO_3 -#define PC13 31 // RADIO_DIO_4 -#define PB6 32 // RADIO_RF_CRX_RX -#define PB7 33 // RADIO_RF_CBT_HF -#define PA4 34 // RADIO_RF_CTX_PA - -// This must be a literal #define NUM_DIGITAL_PINS 35 -// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS #define NUM_ANALOG_INPUTS 3 // On-board LED pin number @@ -97,8 +79,12 @@ extern "C" { // Timer Definitions // Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin -#define TIMER_TONE TIM6 -#define TIMER_SERVO TIM7 +#ifndef TIMER_TONE + #define TIMER_TONE TIM6 +#endif +#ifndef TIMER_SERVO + #define TIMER_SERVO TIM7 +#endif // UART Definitions #define SERIAL_UART_INSTANCE 1 @@ -140,9 +126,6 @@ extern "C" { /* HAL configuration */ #define HSE_VALUE 12000000U -#ifdef __cplusplus -} // extern "C" -#endif /*---------------------------------------------------------------------------- * Arduino objects - C++ only *----------------------------------------------------------------------------*/ @@ -166,5 +149,3 @@ extern "C" { #define SERIAL_PORT_MONITOR Serial #define SERIAL_PORT_HARDWARE Serial #endif - -#endif /* _VARIANT_ARDUINO_STM32_ */ diff --git a/variants/STM32L1xx/L151RET_L152RET_L162RET/PeripheralPins.c b/variants/STM32L1xx/L151RET_L152RET_L162RET/PeripheralPins.c index 3ed7642a63..92e84dc362 100644 --- a/variants/STM32L1xx/L151RET_L152RET_L162RET/PeripheralPins.c +++ b/variants/STM32L1xx/L151RET_L152RET_L162RET/PeripheralPins.c @@ -238,8 +238,9 @@ WEAK const PinMap PinMap_SPI_SSEL[] = { #if defined(HAL_PCD_MODULE_ENABLED) || defined(HAL_HCD_MODULE_ENABLED) WEAK const PinMap PinMap_USB[] = { - {PA_11, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_USB)}, // USB_DM - {PA_12, USB, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, GPIO_AF10_USB)}, // USB_DP + // GPIO_AF10_USB defined in the xml file anyway no AF. + {PA_11, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM + {PA_12, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP {NC, NP, 0} }; #endif diff --git a/variants/STM32L1xx/L151RET_L152RET_L162RET/generic_clock.c b/variants/STM32L1xx/L151RET_L152RET_L162RET/generic_clock.c index 41fc506279..8d172a9599 100644 --- a/variants/STM32L1xx/L151RET_L152RET_L162RET/generic_clock.c +++ b/variants/STM32L1xx/L151RET_L152RET_L162RET/generic_clock.c @@ -21,8 +21,37 @@ */ WEAK void SystemClock_Config(void) { - /* SystemClock_Config can be generated by STM32CubeMX */ -#warning "SystemClock_Config() is empty. Default clock at reset is used." + 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 RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSI; + RCC_OscInitStruct.HSIState = RCC_HSI_ON; + RCC_OscInitStruct.HSICalibrationValue = RCC_HSICALIBRATION_DEFAULT; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; + RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL6; + RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + Error_Handler(); + } + /** Initializes the CPU, AHB and APB buses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK + | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { + Error_Handler(); + } } #endif /* ARDUINO_GENERIC_* */ diff --git a/variants/STM32L1xx/L151RET_L152RET_L162RET/ldscript.ld b/variants/STM32L1xx/L151RET_L152RET_L162RET/ldscript.ld new file mode 100644 index 0000000000..ad1d9828de --- /dev/null +++ b/variants/STM32L1xx/L151RET_L152RET_L162RET/ldscript.ld @@ -0,0 +1,177 @@ +/** + ****************************************************************************** + * @file LinkerScript.ld + * @author Auto-generated by STM32CubeIDE + * @brief Linker script for STM32L152RETx Device from STM32L1 series + * 512Kbytes FLASH + * 80Kbytes RAM + * + * Set heap size, stack size and stack location according + * to application requirements. + * + * Set memory bank area and size if external memory is used + ****************************************************************************** + * @attention + * + *

© Copyright (c) 2020 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 + * + ****************************************************************************** + */ + +/* Entry Point */ +ENTRY(Reset_Handler) + +/* Highest address of the user mode stack */ +_estack = ORIGIN(RAM) + LENGTH(RAM); /* end of "RAM" Ram type memory */ + +_Min_Heap_Size = 0x200; /* required amount of heap */ +_Min_Stack_Size = 0x400; /* required amount of stack */ + +/* Memories definition */ +MEMORY +{ + RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE + FLASH (rx) : ORIGIN = 0x8000000 + LD_FLASH_OFFSET, LENGTH = LD_MAX_SIZE - LD_FLASH_OFFSET +} + +/* Sections */ +SECTIONS +{ + /* The startup code into "FLASH" Rom type memory */ + .isr_vector : + { + . = ALIGN(4); + KEEP(*(.isr_vector)) /* Startup code */ + . = ALIGN(4); + } >FLASH + + /* The program code and other data into "FLASH" Rom type memory */ + .text : + { + . = ALIGN(4); + *(.text) /* .text sections (code) */ + *(.text*) /* .text* sections (code) */ + *(.glue_7) /* glue arm to thumb code */ + *(.glue_7t) /* glue thumb to arm code */ + *(.eh_frame) + + KEEP (*(.init)) + KEEP (*(.fini)) + + . = ALIGN(4); + _etext = .; /* define a global symbols at end of code */ + } >FLASH + + /* Constant data into "FLASH" Rom type memory */ + .rodata : + { + . = ALIGN(4); + *(.rodata) /* .rodata sections (constants, strings, etc.) */ + *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ + . = ALIGN(4); + } >FLASH + + .ARM.extab : { + . = ALIGN(4); + *(.ARM.extab* .gnu.linkonce.armextab.*) + . = ALIGN(4); + } >FLASH + + .ARM : { + . = ALIGN(4); + __exidx_start = .; + *(.ARM.exidx*) + __exidx_end = .; + . = ALIGN(4); + } >FLASH + + .preinit_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__preinit_array_start = .); + KEEP (*(.preinit_array*)) + PROVIDE_HIDDEN (__preinit_array_end = .); + . = ALIGN(4); + } >FLASH + + .init_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__init_array_start = .); + KEEP (*(SORT(.init_array.*))) + KEEP (*(.init_array*)) + PROVIDE_HIDDEN (__init_array_end = .); + . = ALIGN(4); + } >FLASH + + .fini_array : + { + . = ALIGN(4); + PROVIDE_HIDDEN (__fini_array_start = .); + KEEP (*(SORT(.fini_array.*))) + KEEP (*(.fini_array*)) + PROVIDE_HIDDEN (__fini_array_end = .); + . = ALIGN(4); + } >FLASH + + /* Used by the startup to initialize data */ + _sidata = LOADADDR(.data); + + /* Initialized data sections into "RAM" Ram type memory */ + .data : + { + . = ALIGN(4); + _sdata = .; /* create a global symbol at data start */ + *(.data) /* .data sections */ + *(.data*) /* .data* sections */ + *(.RamFunc) /* .RamFunc sections */ + *(.RamFunc*) /* .RamFunc* sections */ + + . = ALIGN(4); + _edata = .; /* define a global symbol at data end */ + + } >RAM AT> FLASH + + /* Uninitialized data section into "RAM" Ram type memory */ + . = ALIGN(4); + .bss : + { + /* This is used by the startup in order to initialize the .bss section */ + _sbss = .; /* define a global symbol at bss start */ + __bss_start__ = _sbss; + *(.bss) + *(.bss*) + *(COMMON) + + . = ALIGN(4); + _ebss = .; /* define a global symbol at bss end */ + __bss_end__ = _ebss; + } >RAM + + /* User_heap_stack section, used to check that there is enough "RAM" Ram type memory left */ + ._user_heap_stack : + { + . = ALIGN(8); + PROVIDE ( end = . ); + PROVIDE ( _end = . ); + . = . + _Min_Heap_Size; + . = . + _Min_Stack_Size; + . = ALIGN(8); + } >RAM + + /* Remove information from the compiler libraries */ + /DISCARD/ : + { + libc.a ( * ) + libm.a ( * ) + libgcc.a ( * ) + } + + .ARM.attributes 0 : { *(.ARM.attributes) } +} diff --git a/variants/STM32L1xx/L151RET_L152RET_L162RET/variant_NUCLEO_L152RE.cpp b/variants/STM32L1xx/L151RET_L152RET_L162RET/variant_NUCLEO_L152RE.cpp new file mode 100644 index 0000000000..6c7af811b0 --- /dev/null +++ b/variants/STM32L1xx/L151RET_L152RET_L162RET/variant_NUCLEO_L152RE.cpp @@ -0,0 +1,148 @@ +/* + ******************************************************************************* + * Copyright (c) 2021, 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_NUCLEO_L152RE) +#include "pins_arduino.h" + +// Pin number +const PinName digitalPin[] = { + PA_3, + PA_2, + PA_10, + PB_3, + PB_5, + PB_4, + PB_10, + PA_8, + PA_9, + PC_7, + PB_6, + PA_7, + PA_6, + PA_5, + PB_9, + PB_8, + // ST Morpho + // CN7 Left Side + PC_10, + PC_12, + PA_13, + PA_14, + PA_15, + PB_7, + PC_13, + PC_14, + PC_15, + PH_0, + PH_1, + PC_2, + PC_3, + // CN7 Right Side + PC_11, + PD_2, + // CN10 Left Side + PC_9, + // CN10 Right side + PC_8, + PC_6, + PC_5, + PA_12, + PA_11, + PB_12, + PB_11, + PB_2, + PB_1, + PB_15, + PB_14, + PB_13, + PC_4, + PA_0, + PA_1, + PA_4, + PB_0, + PC_1, + PC_0 +}; + +// Analog (Ax) pin number array +const uint32_t analogInputPin[] = { + 45, //A0 + 46, //A1 + 47, //A2 + 48, //A3 + 49, //A4 + 50, //A5 + 11, //A6 + 12, //A7 + 27, //A8 + 28, //A9 + 34, //A10 + 37, //A11 + 40, //A12 + 41, //A13 + 42, //A14 + 43, //A15 + 44, //A16 + 39, //A17 + 13, //A18 + 1, //A19 + 0 //A20 +}; + +// ---------------------------------------------------------------------------- + +#ifdef __cplusplus +extern "C" { +#endif +/** + * @brief System Clock Configuration + * @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 RCC Oscillators according to the specified parameters + * in the RCC_OscInitTypeDef structure. + */ + RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE; + RCC_OscInitStruct.HSEState = RCC_HSE_BYPASS; + RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; + RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE; + RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL12; + RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV3; + if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { + Error_Handler(); + } + + /**Initializes the CPU, AHB and APB busses clocks + */ + RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK + | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; + RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; + RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; + RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; + RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; + + if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { + Error_Handler(); + } +} +#ifdef __cplusplus +} +#endif +#endif /* ARDUINO_NUCLEO_L152RE */ diff --git a/variants/STM32L1xx/L151RET_L152RET_L162RET/variant_NUCLEO_L152RE.h b/variants/STM32L1xx/L151RET_L152RET_L162RET/variant_NUCLEO_L152RE.h new file mode 100644 index 0000000000..c1c4e79ca6 --- /dev/null +++ b/variants/STM32L1xx/L151RET_L152RET_L162RET/variant_NUCLEO_L152RE.h @@ -0,0 +1,155 @@ +/* + ******************************************************************************* + * Copyright (c) 2021, 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 + * + ******************************************************************************* + */ +#pragma once + +/*---------------------------------------------------------------------------- + * Pins + *----------------------------------------------------------------------------*/ + +#define PA3 PIN_A20 +#define PA2 PIN_A19 +#define PA10 2 +#define PB3 3 +#define PB5 4 +#define PB4 5 +#define PB10 6 +#define PA8 7 +#define PA9 8 +#define PC7 9 +#define PB6 10 +#define PA7 PIN_A6 +#define PA6 PIN_A7 +#define PA5 PIN_A18 +#define PB9 14 +#define PB8 15 +// ST Morpho +// CN7 Left Side +#define PC10 16 +#define PC12 17 +#define PA13 18 // SWD +#define PA14 19 // SWD +#define PA15 20 +#define PB7 21 +#define PC13 22 +#define PC14 23 +#define PC15 24 +#define PH0 25 +#define PH1 26 +#define PC2 PIN_A8 +#define PC3 PIN_A9 +// CN7 Right Side +#define PC11 29 +#define PD2 30 +// CN10 Left Side +#define PC9 31 +// CN10 Right side +#define PC8 32 +#define PC6 33 +#define PC5 PIN_A10 +#define PA12 35 +#define PA11 36 +#define PB12 PIN_A11 +#define PB11 38 +#define PB2 PIN_A17 +#define PB1 PIN_A12 +#define PB15 PIN_A13 +#define PB14 PIN_A14 +#define PB13 PIN_A15 +#define PC4 PIN_A16 +#define PA0 PIN_A0 +#define PA1 PIN_A1 +#define PA4 PIN_A2 +#define PB0 PIN_A3 +#define PC1 PIN_A4 +#define PC0 PIN_A5 + +// Alternate pins number +#define PA0_ALT1 (PA0 | ALT1) +#define PA1_ALT1 (PA1 | ALT1) +#define PA2_ALT1 (PA2 | ALT1) +#define PA2_ALT2 (PA2 | ALT2) +#define PA3_ALT1 (PA3 | ALT1) +#define PA3_ALT2 (PA3 | ALT2) +#define PA4_ALT1 (PA4 | ALT1) +#define PA6_ALT1 (PA6 | ALT1) +#define PA7_ALT1 (PA7 | ALT1) +#define PA15_ALT1 (PA15 | ALT1) +#define PB3_ALT1 (PB3 | ALT1) +#define PB4_ALT1 (PB4 | ALT1) +#define PB5_ALT1 (PB5 | ALT1) +#define PB8_ALT1 (PB8 | ALT1) +#define PB9_ALT1 (PB9 | ALT1) +#define PC10_ALT1 (PC10 | ALT1) +#define PC11_ALT1 (PC11 | ALT1) + +#define NUM_DIGITAL_PINS 51 +#define NUM_ANALOG_INPUTS 21 + +// On-board LED pin number +#define LED_BUILTIN PA5 +#define LED_GREEN LED_BUILTIN + +// On-board user button +#define USER_BTN PC13 + +// Timer Definitions +// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin +#ifndef TIMER_TONE + #define TIMER_TONE TIM6 +#endif +#ifndef TIMER_SERVO + #define TIMER_SERVO TIM7 +#endif + +// UART Definitions +#ifndef SERIAL_UART_INSTANCE + #define SERIAL_UART_INSTANCE 2 //Connected to ST-Link +#endif + +// Default pin used for 'Serial' instance (ex: ST-Link) +// Mandatory for Firmata +#ifndef PIN_SERIAL_RX + #define PIN_SERIAL_RX PA3 +#endif +#ifndef PIN_SERIAL_TX + #define PIN_SERIAL_TX PA2 +#endif + +/* Extra HAL modules */ +#if !defined(HAL_DAC_MODULE_DISABLED) + #define HAL_DAC_MODULE_ENABLED +#endif + +/*---------------------------------------------------------------------------- + * Arduino objects - C++ only + *----------------------------------------------------------------------------*/ + +#ifdef __cplusplus + // These serial port names are intended to allow libraries and architecture-neutral + // sketches to automatically default to the correct port name for a particular type + // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, + // the first hardware serial port whose RX/TX pins are not dedicated to another use. + // + // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor + // + // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial + // + // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library + // + // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. + // + // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX + // pins are NOT connected to anything by default. + #define SERIAL_PORT_MONITOR Serial + #define SERIAL_PORT_HARDWARE Serial +#endif diff --git a/variants/STM32L1xx/NUCLEO_L152RE/PeripheralPins.c b/variants/STM32L1xx/NUCLEO_L152RE/PeripheralPins.c deleted file mode 100644 index c686884963..0000000000 --- a/variants/STM32L1xx/NUCLEO_L152RE/PeripheralPins.c +++ /dev/null @@ -1,256 +0,0 @@ -/* - ******************************************************************************* - * Copyright (c) 2019, STMicroelectronics - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************* - * Automatically generated from STM32L152RETx.xml - */ -#include "Arduino.h" -#include "PeripheralPins.h" - -/* ===== - * Note: Commented lines are alternative possibilities which are not used per default. - * If you change them, you will have to know what you do - * ===== - */ - -//*** ADC *** - -#ifdef HAL_ADC_MODULE_ENABLED -WEAK const PinMap PinMap_ADC[] = { - {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0 - {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1 - // {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2 - STLink Tx - // {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3 - STLink RX - {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4 - // {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5 - LED1 - {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6 - {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7 - {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8 - {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9 - // {PB_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0b, 0)}, // ADC_IN0b - {PB_12, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC_IN18 - {PB_13, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC_IN19 - {PB_14, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 20, 0)}, // ADC_IN20 - {PB_15, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 21, 0)}, // ADC_IN21 - {PC_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 10, 0)}, // ADC_IN10 - {PC_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 11, 0)}, // ADC_IN11 - {PC_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 12, 0)}, // ADC_IN12 - {PC_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 13, 0)}, // ADC_IN13 - {PC_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 14, 0)}, // ADC_IN14 - {PC_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 15, 0)}, // ADC_IN15 - {NC, NP, 0} -}; -#endif - -//*** DAC *** - -#ifdef HAL_DAC_MODULE_ENABLED -WEAK const PinMap PinMap_DAC[] = { - {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 - {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 - LED1 - {NC, NP, 0} -}; -#endif - -//*** I2C *** - -#ifdef HAL_I2C_MODULE_ENABLED -WEAK const PinMap PinMap_I2C_SDA[] = { - {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_I2C_MODULE_ENABLED -WEAK const PinMap PinMap_I2C_SCL[] = { - {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, - {NC, NP, 0} -}; -#endif - -//*** PWM *** - -#ifdef HAL_TIM_MODULE_ENABLED -WEAK const PinMap PinMap_PWM[] = { - {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - // {PA_0, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 1, 0)}, // TIM5_CH1 - {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - // {PA_1, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 2, 0)}, // TIM5_CH2 - // {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - // {PA_2, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 3, 0)}, // TIM5_CH3 - {PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 - // {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - // {PA_3, TIM5, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM5, 4, 0)}, // TIM5_CH4 - {PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - // {PA_6, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 - {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - // {PA_7, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 - {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 - {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 - {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 - {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 - {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 - // {PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 - {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 - // {PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 - {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - {PB_12, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 - {PB_13, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 - {PB_14, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - {PB_15, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 - {PC_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - {PC_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - {PC_8, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 - {PC_9, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 - {NC, NP, 0} -}; -#endif - -//*** SERIAL *** - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_TX[] = { - {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, - {PC_10, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, - // {PC_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, - {PC_12, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_RX[] = { - {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, - {PC_11, UART4, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART4)}, - // {PC_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, - {PD_2, UART5, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF8_UART5)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_RTS[] = { - {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_CTS[] = { - {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, - {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, - {NC, NP, 0} -}; -#endif - -//*** SPI *** - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_MOSI[] = { - {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - // {PB_5, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {PC_12, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_MISO[] = { - {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - // {PB_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {PC_11, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_SCLK[] = { - {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - // {PB_3, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {PC_10, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {NC, NP, 0} -}; -#endif - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_SSEL[] = { - {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PA_4, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - {PA_15, SPI3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF6_SPI3)}, - {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {NC, NP, 0} -}; -#endif - -//*** No CAN *** - -//*** No ETHERNET *** - -//*** No QUADSPI *** - -//*** USB *** - -#ifdef HAL_PCD_MODULE_ENABLED -WEAK const PinMap PinMap_USB[] = { - {PA_11, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DM - {PA_12, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF_NONE)}, // USB_DP - {NC, NP, 0} -}; -#endif - -//*** No USB_OTG_FS *** - -//*** No USB_OTG_HS *** diff --git a/variants/STM32L1xx/NUCLEO_L152RE/PinNamesVar.h b/variants/STM32L1xx/NUCLEO_L152RE/PinNamesVar.h deleted file mode 100644 index 99d2aa0832..0000000000 --- a/variants/STM32L1xx/NUCLEO_L152RE/PinNamesVar.h +++ /dev/null @@ -1,30 +0,0 @@ -/* SYS_WKUP */ -#ifdef PWR_WAKEUP_PIN1 - SYS_WKUP1 = PA_0, -#endif -#ifdef PWR_WAKEUP_PIN2 - SYS_WKUP2 = PC_13, -#endif -#ifdef PWR_WAKEUP_PIN3 - SYS_WKUP3 = NC, -#endif -#ifdef PWR_WAKEUP_PIN4 - SYS_WKUP4 = NC, -#endif -#ifdef PWR_WAKEUP_PIN5 - SYS_WKUP5 = NC, -#endif -#ifdef PWR_WAKEUP_PIN6 - SYS_WKUP6 = NC, -#endif -#ifdef PWR_WAKEUP_PIN7 - SYS_WKUP7 = NC, -#endif -#ifdef PWR_WAKEUP_PIN8 - SYS_WKUP8 = NC, -#endif -/* USB */ -#ifdef USBCON - USB_DM = PA_11, - USB_DP = PA_12, -#endif diff --git a/variants/STM32L1xx/NUCLEO_L152RE/ldscript.ld b/variants/STM32L1xx/NUCLEO_L152RE/ldscript.ld deleted file mode 100644 index cb7b689157..0000000000 --- a/variants/STM32L1xx/NUCLEO_L152RE/ldscript.ld +++ /dev/null @@ -1,188 +0,0 @@ -/* -***************************************************************************** -** - -** File : LinkerScript.ld -** -** Abstract : Linker script for STM32L152RETx Device with -** 512KByte FLASH, 80KByte RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used. -** -** Target : STMicroelectronics STM32 -** -** -** Distribution: The file is distributed as is, without any warranty -** of any kind. -** -***************************************************************************** -** @attention -** -**

© COPYRIGHT(c) 2014 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20014000; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -RAM (xrw) : ORIGIN = 0x20000000, LENGTH = 80K -FLASH (rx) : ORIGIN = 0x8000000, LENGTH = 512K -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text ALIGN(4): - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata : - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - - diff --git a/variants/STM32L1xx/NUCLEO_L152RE/variant_NUCLEO_L152RE.cpp b/variants/STM32L1xx/NUCLEO_L152RE/variant_NUCLEO_L152RE.cpp deleted file mode 100644 index 90899cb2f5..0000000000 --- a/variants/STM32L1xx/NUCLEO_L152RE/variant_NUCLEO_L152RE.cpp +++ /dev/null @@ -1,171 +0,0 @@ -/* - Copyright (c) 2011 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#include "pins_arduino.h" - -#ifdef __cplusplus -extern "C" { -#endif - -// Pin number -const PinName digitalPin[] = { - PA_3, //D0 - PA_2, //D1 - PA_10, //D2 - PB_3, //D3 - PB_5, //D4 - PB_4, //D5 - PB_10, //D6 - PA_8, //D7 - PA_9, //D8 - PC_7, //D9 - PB_6, //D10 - PA_7, //D11 - PA_6, //D12 - PA_5, //D13 - PB_9, //D14 - PB_8, //D15 - // ST Morpho - // CN7 Left Side - PC_10, //D16 - PC_12, //D17 - NC, //D18 - BOOT0 - PA_13, //D19 - SWD - PA_14, //D20 - SWD - PA_15, //D21 - PB_7, //D22 - PC_13, //D23 - PC_14, //D24 - PC_15, //D25 - PH_0, //D26 - PH_1, //D27 - PC_2, //D28 - PC_3, //D29 - // CN7 Right Side - PC_11, //D30 - PD_2, //D31 - // CN10 Left Side - PC_9, //D32 - // CN10 Right side - PC_8, //D33 - PC_6, //D34 - PC_5, //D35 - PA_12, //D36 - PA_11, //D37 - PB_12, //D38 - PB_11, //D39 - PB_2, //D40 - PB_1, //D41 - PB_15, //D42 - PB_14, //D43 - PB_13, //D44 - PC_4, //D45 - PA_0, //D46/A0 - PA_1, //D47/A1 - PA_4, //D48/A2 - PB_0, //D49/A3 - PC_1, //D50/A4 - PC_0 //D51/A5 -}; - -// Analog (Ax) pin number array -const uint32_t analogInputPin[] = { - 46, //A0 - 47, //A1 - 48, //A2 - 49, //A3 - 50, //A4 - 51, //A5 - 11, //A6 - 12, //A7 - 28, //A8 - 29, //A9 - 35, //A10 - 38, //A11 - 41, //A12 - 42, //A13 - 43, //A14 - 44, //A15 - 45 //A16 -}; - -#ifdef __cplusplus -} -#endif - -// ---------------------------------------------------------------------------- - -#ifdef __cplusplus -extern "C" { -#endif -/** - * @brief System Clock Configuration - * The system Clock is configured as follow : - * System Clock source = PLL (HSI) - * SYSCLK(Hz) = 32000000 - * HCLK(Hz) = 32000000 - * AHB Prescaler = 1 - * APB1 Prescaler = 1 - * APB2 Prescaler = 1 - * HSE Frequency(Hz) = 8000000 - * HSI Frequency(Hz) = 16000000 - * PLLMUL = 8 - * PLLDIV = 2 - * Flash Latency(WS) = 1 - * @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_HSI; - RCC_OscInitStruct.HSIState = RCC_HSI_ON; - RCC_OscInitStruct.HSICalibrationValue = 16; - RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON; - RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSI; - RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL4; - RCC_OscInitStruct.PLL.PLLDIV = RCC_PLL_DIV2; - if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK) { - /* Initialization Error */ - while (1); - } - - /**Initializes the CPU, AHB and APB busses clocks - */ - RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK | RCC_CLOCKTYPE_SYSCLK - | RCC_CLOCKTYPE_PCLK1 | RCC_CLOCKTYPE_PCLK2; - RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK; - RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1; - RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV1; - RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1; - - if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_1) != HAL_OK) { - /* Initialization Error */ - while (1); - } -} -#ifdef __cplusplus -} -#endif diff --git a/variants/STM32L1xx/NUCLEO_L152RE/variant_NUCLEO_L152RE.h b/variants/STM32L1xx/NUCLEO_L152RE/variant_NUCLEO_L152RE.h deleted file mode 100644 index 786399ffb5..0000000000 --- a/variants/STM32L1xx/NUCLEO_L152RE/variant_NUCLEO_L152RE.h +++ /dev/null @@ -1,142 +0,0 @@ -/* - Copyright (c) 2011 Arduino. All right reserved. - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -*/ - -#ifndef _VARIANT_ARDUINO_STM32_ -#define _VARIANT_ARDUINO_STM32_ - -#ifdef __cplusplus -extern "C" { -#endif // __cplusplus - -/*---------------------------------------------------------------------------- - * Pins - *----------------------------------------------------------------------------*/ - -#define PA3 0 -#define PA2 1 -#define PA10 2 -#define PB3 3 -#define PB5 4 -#define PB4 5 -#define PB10 6 -#define PA8 7 -#define PA9 8 -#define PC7 9 -#define PB6 10 -#define PA7 A6 -#define PA6 A7 -#define PA5 13 -#define PB9 14 -#define PB8 15 -// ST Morpho -// CN7 Left Side -#define PC10 16 -#define PC12 17 -// 18 is NC - BOOT0 -#define PA13 19 // SWD -#define PA14 20 // SWD -#define PA15 21 -#define PB7 22 -#define PC13 23 -#define PC14 24 -#define PC15 25 -#define PH0 26 -#define PH1 27 -#define PC2 A8 -#define PC3 A9 -// CN7 Right Side -#define PC11 30 -#define PD2 31 -// CN10 Left Side -#define PC9 32 -// CN10 Right side -#define PC8 33 -#define PC6 34 -#define PC5 A10 -#define PA12 36 -#define PA11 37 -#define PB12 A11 -#define PB11 39 -#define PB2 40 -#define PB1 A12 -#define PB15 A13 -#define PB14 A14 -#define PB13 A15 -#define PC4 A16 -#define PA0 A0 -#define PA1 A1 -#define PA4 A2 -#define PB0 A3 -#define PC1 A4 -#define PC0 A5 - -// This must be a literal -#define NUM_DIGITAL_PINS 52 -// This must be a literal with a value less than or equal to to MAX_ANALOG_INPUTS -#define NUM_ANALOG_INPUTS 17 - -// On-board LED pin number -#define LED_BUILTIN 13 -#define LED_GREEN LED_BUILTIN - -// On-board user button -#define USER_BTN PC13 - -// Timer Definitions -// Use TIM6/TIM7 when possible as servo and tone don't need GPIO output pin -#define TIMER_TONE TIM6 -#define TIMER_SERVO TIM7 - -// UART Definitions -#define SERIAL_UART_INSTANCE 2 //Connected to ST-Link -// Default pin used for 'Serial' instance (ex: ST-Link) -// Mandatory for Firmata -#define PIN_SERIAL_RX 0 -#define PIN_SERIAL_TX 1 - -/* Extra HAL modules */ -#define HAL_DAC_MODULE_ENABLED - -#ifdef __cplusplus -} // extern "C" -#endif -/*---------------------------------------------------------------------------- - * Arduino objects - C++ only - *----------------------------------------------------------------------------*/ - -#ifdef __cplusplus - // These serial port names are intended to allow libraries and architecture-neutral - // sketches to automatically default to the correct port name for a particular type - // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, - // the first hardware serial port whose RX/TX pins are not dedicated to another use. - // - // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor - // - // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial - // - // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library - // - // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. - // - // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX - // pins are NOT connected to anything by default. - #define SERIAL_PORT_MONITOR Serial - #define SERIAL_PORT_HARDWARE Serial -#endif - -#endif /* _VARIANT_ARDUINO_STM32_ */ diff --git a/variants/STM32L1xx/RAK811_TRACKER/PeripheralPins.c b/variants/STM32L1xx/RAK811_TRACKER/PeripheralPins.c deleted file mode 100644 index 0367e680a2..0000000000 --- a/variants/STM32L1xx/RAK811_TRACKER/PeripheralPins.c +++ /dev/null @@ -1,227 +0,0 @@ -/* - ******************************************************************************* - * Copyright (c) 2019, STMicroelectronics - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are met: - * - * 1. Redistributions of source code must retain the above copyright notice, - * this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright notice, - * this list of conditions and the following disclaimer in the documentation - * and/or other materials provided with the distribution. - * 3. Neither the name of STMicroelectronics nor the names of its contributors - * may be used to endorse or promote products derived from this software - * without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE - * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE - * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR - * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER - * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, - * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - ******************************************************************************* - * Automatically generated from STM32L151C(6-8-B)Tx(A).xml - */ -#include "Arduino.h" -#include "PeripheralPins.h" - -/* ===== - * Note: Commented lines are alternative possibilities which are not used per default. - * If you change them, you will have to know what you do - * ===== - */ - -//*** ADC *** - -#ifdef HAL_ADC_MODULE_ENABLED -WEAK const PinMap PinMap_ADC[] = { - // {PA_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 0, 0)}, // ADC_IN0 - {PA_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // ADC_IN1 - {PA_2, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // ADC_IN2 - ADC_VBAT - // {PA_3, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 3, 0)}, // ADC_IN3 - RADIO_DIO_2 - // {PA_4, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 4, 0)}, // ADC_IN4 - RADIO_RF_CTX_PA - // {PA_5, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 5, 0)}, // ADC_IN5 - RADIO_SCLK - // {PA_6, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 6, 0)}, // ADC_IN6 - RADIO_MISO - // {PA_7, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 7, 0)}, // ADC_IN7 - RADIO_MOSI - // {PB_0, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 8, 0)}, // ADC_IN8 - RADIO_NSS - // {PB_1, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 9, 0)}, // ADC_IN9 - RADIO_DIO_1 - {PB_12, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 18, 0)}, // ADC_IN18 - // {PB_13, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 19, 0)}, // ADC_IN19 - RADIO_RESET - // {PB_14, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 20, 0)}, // ADC_IN20 - LIS3DH_INT1_PIN - // {PB_15, ADC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 21, 0)}, // ADC_IN21 - LIS3DH_INT2_PIN - {NC, NP, 0} -}; -#endif - -//*** DAC *** - -#ifdef HAL_DAC_MODULE_ENABLED -WEAK const PinMap PinMap_DAC[] = { - // {PA_4, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 1, 0)}, // DAC_OUT1 - RADIO_RF_CTX_PA - // {PA_5, DAC1, STM_PIN_DATA_EXT(STM_MODE_ANALOG, GPIO_NOPULL, 0, 2, 0)}, // DAC_OUT2 - RADIO_SCLK - {NC, NP, 0} -}; -#endif - -//*** I2C *** - -#ifdef HAL_I2C_MODULE_ENABLED -WEAK const PinMap PinMap_I2C_SDA[] = { - // {PB_7, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // RADIO_RF_CBT_HF - {PB_9, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - // {PB_11, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, // GPS_UART_RX - {NC, NP, 0} -}; -#endif - -#ifdef HAL_I2C_MODULE_ENABLED -WEAK const PinMap PinMap_I2C_SCL[] = { - // {PB_6, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, // RADIO_RF_CRX_RX - {PB_8, I2C1, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C1)}, - // {PB_10, I2C2, STM_PIN_DATA(STM_MODE_AF_OD, GPIO_NOPULL, GPIO_AF4_I2C2)}, // GPS_UART_TX - {NC, NP, 0} -}; -#endif - -//*** PWM *** - -#ifdef HAL_TIM_MODULE_ENABLED -WEAK const PinMap PinMap_PWM[] = { - {PA_0, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - {PA_1, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - // {PA_2, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - ADC_VBAT - // {PA_2, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 - ADC_VBAT - // {PA_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - RADIO_DIO_2 - // {PA_3, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - RADIO_DIO_2 - // {PA_5, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - RADIO_SCLK - // {PA_6, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - RADIO_MISO - // {PA_6, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 - RADIO_MISO - // {PA_7, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - RADIO_MOSI - // {PA_7, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 - RADIO_MOSI - // {PA_15, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 1, 0)}, // TIM2_CH1 - GPS_POWER_ON_PIN - // {PB_0, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 3, 0)}, // TIM3_CH3 - RADIO_NSS - // {PB_1, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 4, 0)}, // TIM3_CH4 - RADIO_DIO_1 - {PB_3, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 2, 0)}, // TIM2_CH2 - {PB_4, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 1, 0)}, // TIM3_CH1 - LED2 - {PB_5, TIM3, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM3, 2, 0)}, // TIM3_CH2 - // {PB_6, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 1, 0)}, // TIM4_CH1 - RADIO_RF_CRX_RX - // {PB_7, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 2, 0)}, // TIM4_CH2 - RADIO_RF_CBT_HF - {PB_8, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 3, 0)}, // TIM4_CH3 - // {PB_8, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 - // {PB_9, TIM4, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF2_TIM4, 4, 0)}, // TIM4_CH4 - {PB_9, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 - // {PB_10, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 3, 0)}, // TIM2_CH3 - GPS_UART_TX - // {PB_11, TIM2, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF1_TIM2, 4, 0)}, // TIM2_CH4 - GPS_UART_RX - {PB_12, TIM10, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM10, 1, 0)}, // TIM10_CH1 - // {PB_13, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 1, 0)}, // TIM9_CH1 - RADIO_RESET - // {PB_14, TIM9, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM9, 2, 0)}, // TIM9_CH2 - LIS3DH_INT1_PIN - // {PB_15, TIM11, STM_PIN_DATA_EXT(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF3_TIM11, 1, 0)}, // TIM11_CH1 - LIS3DH_INT2_PIN - {NC, NP, 0} -}; -#endif - -//*** SERIAL *** - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_TX[] = { - // {PA_2, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // ADC_VBAT - {PA_9, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // UART_TX - // {PB_6, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // RADIO_RF_CRX_RX - {PB_10, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // GPS_UART_TX - {NC, NP, 0} -}; -#endif - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_RX[] = { - // {PA_3, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, // RADIO_DIO_2 - {PA_10, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // UART_RX - // {PB_7, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // RADIO_RF_CBT_HF - {PB_11, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // GPS_UART_RX - {NC, NP, 0} -}; -#endif - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_RTS[] = { - {PA_1, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - // {PA_12, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // LED1 - // {PB_14, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // LIS3DH_INT1_PIN - {NC, NP, 0} -}; -#endif - -#ifdef HAL_UART_MODULE_ENABLED -WEAK const PinMap PinMap_UART_CTS[] = { - {PA_0, USART2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART2)}, - // {PA_11, USART1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART1)}, // RADIO_DIO_0 - // {PB_13, USART3, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF7_USART3)}, // RADIO_RESET - {NC, NP, 0} -}; -#endif - -//*** SPI *** - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_MOSI[] = { - {PA_7, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // RADIO_MOSI - // {PA_12, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // LED1 - // {PB_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - // {PB_15, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // LIS3DH_INT2_PIN - {NC, NP, 0} -}; -#endif - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_MISO[] = { - {PA_6, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // RADIO_MISO - // {PA_11, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // RADIO_DIO_0 - // {PB_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // LED2 - // {PB_14, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // LIS3DH_INT1_PIN - {NC, NP, 0} -}; -#endif - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_SCLK[] = { - {PA_5, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // RADIO_SCLK - // {PB_3, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, - // {PB_13, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, // RADIO_RESET - {NC, NP, 0} -}; -#endif - -#ifdef HAL_SPI_MODULE_ENABLED -WEAK const PinMap PinMap_SPI_SSEL[] = { - // {PA_4, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // RADIO_RF_CTX_PA - // {PA_15, SPI1, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI1)}, // GPS_POWER_ON_PIN - {PB_12, SPI2, STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, GPIO_AF5_SPI2)}, - {NC, NP, 0} -}; -#endif - -//*** No CAN *** - -//*** No ETHERNET *** - -//*** No QUADSPI *** - -//*** USB *** - -#ifdef HAL_PCD_MODULE_ENABLED -WEAK const PinMap PinMap_USB[] = { - {PA_11, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF10_USB)}, // USB_DM - {PA_12, USB, STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, GPIO_AF10_USB)}, // USB_DP - {NC, NP, 0} -}; -#endif - -//*** No USB_OTG_FS *** - -//*** No USB_OTG_HS *** diff --git a/variants/STM32L1xx/RAK811_TRACKER/PinNamesVar.h b/variants/STM32L1xx/RAK811_TRACKER/PinNamesVar.h deleted file mode 100644 index 99d2aa0832..0000000000 --- a/variants/STM32L1xx/RAK811_TRACKER/PinNamesVar.h +++ /dev/null @@ -1,30 +0,0 @@ -/* SYS_WKUP */ -#ifdef PWR_WAKEUP_PIN1 - SYS_WKUP1 = PA_0, -#endif -#ifdef PWR_WAKEUP_PIN2 - SYS_WKUP2 = PC_13, -#endif -#ifdef PWR_WAKEUP_PIN3 - SYS_WKUP3 = NC, -#endif -#ifdef PWR_WAKEUP_PIN4 - SYS_WKUP4 = NC, -#endif -#ifdef PWR_WAKEUP_PIN5 - SYS_WKUP5 = NC, -#endif -#ifdef PWR_WAKEUP_PIN6 - SYS_WKUP6 = NC, -#endif -#ifdef PWR_WAKEUP_PIN7 - SYS_WKUP7 = NC, -#endif -#ifdef PWR_WAKEUP_PIN8 - SYS_WKUP8 = NC, -#endif -/* USB */ -#ifdef USBCON - USB_DM = PA_11, - USB_DP = PA_12, -#endif diff --git a/variants/STM32L1xx/RAK811_TRACKER/ldscript.ld b/variants/STM32L1xx/RAK811_TRACKER/ldscript.ld deleted file mode 100644 index 0310930298..0000000000 --- a/variants/STM32L1xx/RAK811_TRACKER/ldscript.ld +++ /dev/null @@ -1,188 +0,0 @@ -/* -***************************************************************************** -** - -** File : LinkerScript.ld -** -** Abstract : Linker script for STM32L151CBTx(A) Device with -** 128KByte FLASH, 16/32KByte RAM -** -** Set heap size, stack size and stack location according -** to application requirements. -** -** Set memory bank area and size if external memory is used. -** -** Target : STMicroelectronics STM32 -** -** -** Distribution: The file is distributed as is, without any warranty -** of any kind. -** -***************************************************************************** -** @attention -** -**

© COPYRIGHT(c) 2014 Ac6

-** -** Redistribution and use in source and binary forms, with or without modification, -** are permitted provided that the following conditions are met: -** 1. Redistributions of source code must retain the above copyright notice, -** this list of conditions and the following disclaimer. -** 2. Redistributions in binary form must reproduce the above copyright notice, -** this list of conditions and the following disclaimer in the documentation -** and/or other materials provided with the distribution. -** 3. Neither the name of Ac6 nor the names of its contributors -** may be used to endorse or promote products derived from this software -** without specific prior written permission. -** -** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -** AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -** IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -** DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE -** FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -** DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR -** SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER -** CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, -** OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -** -***************************************************************************** -*/ - -/* Entry Point */ -ENTRY(Reset_Handler) - -/* Highest address of the user mode stack */ -_estack = 0x20000000 + LD_MAX_DATA_SIZE; /* end of RAM */ -/* Generate a link error if heap and stack don't fit into RAM */ -_Min_Heap_Size = 0x200; /* required amount of heap */ -_Min_Stack_Size = 0x400; /* required amount of stack */ - -/* Specify the memory areas */ -MEMORY -{ -RAM (xrw) : ORIGIN = 0x20000000, LENGTH = LD_MAX_DATA_SIZE -FLASH (rx) : ORIGIN = 0x8000000, LENGTH = LD_MAX_SIZE -} - -/* Define output sections */ -SECTIONS -{ - /* The startup code goes first into FLASH */ - .isr_vector : - { - . = ALIGN(4); - KEEP(*(.isr_vector)) /* Startup code */ - . = ALIGN(4); - } >FLASH - - /* The program code and other data goes into FLASH */ - .text ALIGN(4): - { - . = ALIGN(4); - *(.text) /* .text sections (code) */ - *(.text*) /* .text* sections (code) */ - *(.glue_7) /* glue arm to thumb code */ - *(.glue_7t) /* glue thumb to arm code */ - *(.eh_frame) - - KEEP (*(.init)) - KEEP (*(.fini)) - - . = ALIGN(4); - _etext = .; /* define a global symbols at end of code */ - } >FLASH - - /* Constant data goes into FLASH */ - .rodata ALIGN(4): - { - . = ALIGN(4); - *(.rodata) /* .rodata sections (constants, strings, etc.) */ - *(.rodata*) /* .rodata* sections (constants, strings, etc.) */ - . = ALIGN(4); - } >FLASH - - .ARM.extab : { *(.ARM.extab* .gnu.linkonce.armextab.*) } >FLASH - .ARM : { - __exidx_start = .; - *(.ARM.exidx*) - __exidx_end = .; - } >FLASH - - .preinit_array : - { - PROVIDE_HIDDEN (__preinit_array_start = .); - KEEP (*(.preinit_array*)) - PROVIDE_HIDDEN (__preinit_array_end = .); - } >FLASH - .init_array : - { - PROVIDE_HIDDEN (__init_array_start = .); - KEEP (*(SORT(.init_array.*))) - KEEP (*(.init_array*)) - PROVIDE_HIDDEN (__init_array_end = .); - } >FLASH - .fini_array : - { - PROVIDE_HIDDEN (__fini_array_start = .); - KEEP (*(SORT(.fini_array.*))) - KEEP (*(.fini_array*)) - PROVIDE_HIDDEN (__fini_array_end = .); - } >FLASH - - /* used by the startup to initialize data */ - _sidata = LOADADDR(.data); - - /* Initialized data sections goes into RAM, load LMA copy after code */ - .data : - { - . = ALIGN(4); - _sdata = .; /* create a global symbol at data start */ - *(.data) /* .data sections */ - *(.data*) /* .data* sections */ - - . = ALIGN(4); - _edata = .; /* define a global symbol at data end */ - } >RAM AT> FLASH - - - /* Uninitialized data section */ - . = ALIGN(4); - .bss : - { - /* This is used by the startup in order to initialize the .bss secion */ - _sbss = .; /* define a global symbol at bss start */ - __bss_start__ = _sbss; - *(.bss) - *(.bss*) - *(COMMON) - - . = ALIGN(4); - _ebss = .; /* define a global symbol at bss end */ - __bss_end__ = _ebss; - } >RAM - - /* User_heap_stack section, used to check that there is enough RAM left */ - ._user_heap_stack : - { - . = ALIGN(8); - PROVIDE ( end = . ); - PROVIDE ( _end = . ); - . = . + _Min_Heap_Size; - . = . + _Min_Stack_Size; - . = ALIGN(8); - } >RAM - - - - /* Remove information from the standard libraries */ - /DISCARD/ : - { - libc.a ( * ) - libm.a ( * ) - libgcc.a ( * ) - } - - .ARM.attributes 0 : { *(.ARM.attributes) } -} - -