Thunderpack STM32L072xx

razvitm
Posts: 38
Joined: Sat Apr 11, 2020 12:35 pm

Thunderpack STM32L072xx

Post by razvitm »

Hello everyone,

I saw that there is a small development board that uses the MCU mentioned in the title, it can be found at the following link:
https://hackaday.io/project/161054-thunder-pack

Now on the webpage it says that it is supported by the STM32duino core.

Could that mean that I could use a STM32L072RZT6 on the STM32duino official core on a custom PCB?
fpiSTM
Posts: 1838
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 102
Location: Le Mans
Contact:

Re: Thunderpack STM32L072xx

Post by fpiSTM »

You can try but no support will be provided if this not work ;)
This variant use the HSI so, I guess it should work anyway.
razvitm
Posts: 38
Joined: Sat Apr 11, 2020 12:35 pm

Re: Thunderpack STM32L072xx

Post by razvitm »

So I went ahead and soldered a STM32L072 on a breakout PCB.
I can run blinky on any digital pin I choose.
I cannot use all the serial ports.
Serial.begin works and I can Serial.println on the serial port I use to program the uC, but all the other 4 ports don't work, even after HardwareSerial Serial2 (USART2) for example.
Any ideas on how to use all 5 serial ports with ThunderPack board in Arduino STM32 official core?
fpiSTM
Posts: 1838
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 102
Location: Le Mans
Contact:

Re: Thunderpack STM32L072xx

Post by fpiSTM »

razvitm wrote: Tue Sep 15, 2020 8:59 am So I went ahead and soldered a STM32L072 on a breakout PCB.
I can run blinky on any digital pin I choose.
I cannot use all the serial ports.
Serial.begin works and I can Serial.println on the serial port I use to program the uC, but all the other 4 ports don't work, even after HardwareSerial Serial2 (USART2) for example.
Any ideas on how to use all 5 serial ports with ThunderPack board in Arduino STM32 official core?
Good news. For USART, well for USART2 it seems there is only USART2 TX available so it can be used in Half Duplex.
See: https://github.com/stm32duino/wiki/wiki ... uplex-mode

You could try with:

Code: Select all

HardwareSerial(USART2, HALF_DUPLEX_ENABLED);
razvitm
Posts: 38
Joined: Sat Apr 11, 2020 12:35 pm

Re: Thunderpack STM32L072xx

Post by razvitm »

After HardwareSerial(USART2, HALF_DUPLEX_ENABLED);
The TX pin is pulled HIGH (measured with oscilloscope) but it just stays HIGH, although in loop there is a println.
No data is coming out through the port.
fpiSTM
Posts: 1838
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 102
Location: Le Mans
Contact:

Re: Thunderpack STM32L072xx

Post by fpiSTM »

Well in that case I suspect a clock issue.
razvitm
Posts: 38
Joined: Sat Apr 11, 2020 12:35 pm

Re: Thunderpack STM32L072xx

Post by razvitm »

Update:
With the core untouched, using the PX-HER0 board selected in Arduino,
I got Serial1 and Serial4 to work, I had to instantiate Serial4,
I can print on both Serial1 and Serial4 but if I enable Serial2, it doesn't work, and in the PX-HER0 board user manual there is a Serial2 on PA2 and PA3 but it just doesn't work in my case.
I am using version 1.9.0 of the core.
What would I have to write in the Arduino Sketch above Setup() to enable the other serial ports?
In the core, there are some files that define which serial ports are enabled on which pins, I don't want to modify the core, instead, I would like to do something similar to setting the clocks from the arduino sketch.
fpiSTM
Posts: 1838
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 102
Location: Le Mans
Contact:

Re: Thunderpack STM32L072xx

Post by fpiSTM »

https://github.com/stm32duino/wiki/wiki ... wareserial

For the PX_HERO this is the LPUART1 on PA2 an PA3 as described in the variant:
https://github.com/stm32duino/Arduino_C ... #L191-L192

Code: Select all

#define PIN_SERIALLP1_TX        PA2
#define PIN_SERIALLP1_RX        PA3
razvitm
Posts: 38
Joined: Sat Apr 11, 2020 12:35 pm

Re: Thunderpack STM32L072xx

Post by razvitm »

I just found out that the Discovery L072CZ LRWAN1 uses the same MCU, and I tried selecting this board in Arduino and now I have 3 serial ports working. USART1 USART4 and LPUART1.
fpiSTM
Posts: 1838
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 102
Location: Le Mans
Contact:

Re: Thunderpack STM32L072xx

Post by fpiSTM »

Well, I think your best bet is to create your own variant.
Each variant has its own customization and all the peripherals linked to a pins are not available depending of the contributors need.
Even if you can redefine each pinmap array of the PeripheralPins.cpp I think you should create your own one.
Post Reply

Return to “STM32L0 based boards”