Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LoRaWAN with low power and RTC #9

Closed
Lizethgm opened this issue Jan 16, 2023 · 3 comments · Fixed by #25
Closed

LoRaWAN with low power and RTC #9

Lizethgm opened this issue Jan 16, 2023 · 3 comments · Fixed by #25
Assignees
Labels
enhancement New feature or request
Milestone

Comments

@Lizethgm
Copy link

Hi,
I was trying to use your example of sending data via lorawan and the library "STM32LowPower.h" and I get an error that two functions have multiple definitions.

.: ../../../..\libraries\STM32duino_RTC\rtc.c.o: in function `HAL_RTC_AlarmAEventCallback':
rtc.c:(.text.HAL_RTC_AlarmAEventCallback+0x0): multiple definition of `HAL_RTC_AlarmAEventCallback'; ..\..\..\.\libraries\STM32duino_RTC\rtc.c.o: in function `RTC_Alarm_IRQHandler':
rtc.c:(.text.RTC_Alarm_IRQHandler+0x0): multiple definition of `RTC_Alarm_IRQHandler'; 
..\..\..\.\libraries\STM32LoRaWAN-main\BSP\rtc.c.o:rtc.c:(.text.RTC_Alarm_IRQHandler+0x0): first defined here
collect2.exe: error: ld returned 1 exit status

Is crashing with another library that has the low power that is "STM32RTC.h" it is because they have the same functions.
How can I fix this crash?

@fpistm
Copy link
Member

fpistm commented Jan 17, 2023

Hi @Lizethgm
This is a know restriction.
Currently, STM32LoRaWAN library implements itself its RTC usage.
As the STM32LowPower is dependent of the STM32RTC then you can't use it.
It is planned to use STM32RTC instead of own implementation for the STM32LoRaWan and the STM32LowPower.

@fpistm fpistm added the enhancement New feature or request label Jan 17, 2023
@jpmeijers
Copy link

I also stumbled upon this issue, getting the same error, after trying to follow the documentation on Low Power Applications

Linking .pio/build/STM32WLE5/firmware.elf
/home/jpmeijers/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: .pio/build/STM32WLE5/lib132/libSTM32duinoLoRaWAN.a(timer_if.c.o): in function `HAL_RTC_AlarmAEventCallback':
/home/jpmeijers/Documents/PlatformIO/Projects/LoraE5test/.pio/libdeps/STM32WLE5/STM32duinoLoRaWAN/src/BSP/timer_if.c:383: multiple definition of `HAL_RTC_AlarmAEventCallback'; .pio/build/STM32WLE5/liba52/STM32duino RTC/rtc.c.o:/home/jpmeijers/Documents/PlatformIO/Projects/LoraE5test/.pio/libdeps/STM32WLE5/STM32duino RTC/src/rtc.c:933: first defined here
/home/jpmeijers/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: .pio/build/STM32WLE5/lib132/libSTM32duinoLoRaWAN.a(rtc.c.o): in function `RTC_Alarm_IRQHandler':
/home/jpmeijers/Documents/PlatformIO/Projects/LoraE5test/.pio/libdeps/STM32WLE5/STM32duinoLoRaWAN/src/BSP/rtc.c:148: multiple definition of `RTC_Alarm_IRQHandler'; .pio/build/STM32WLE5/liba52/STM32duino RTC/rtc.c.o:/home/jpmeijers/Documents/PlatformIO/Projects/LoraE5test/.pio/libdeps/STM32WLE5/STM32duino RTC/src/rtc.c:961: first defined here
collect2: error: ld returned 1 exit status
*** [.pio/build/STM32WLE5/firmware.elf] Error 1

@FRASTM
Copy link
Contributor

FRASTM commented May 9, 2023

The RTC of the stm32WL will be configured in MIX mode (RTC_ICSR register BIN = [10])
--> The calendar RTC_TR and RTC_DR are available
--> the RTC SSR subsecond resgister is available on 32 bits clocked by ck_apre

In RTC Mix mode, the RTC_TR and RTC_DR calendar registers contents can be read/written in binary or bcd format (example : minutes expressed on 8 bits from 0-59 or minutes expressed in one minutes-tens value plu one minutes-units value)
The RTC_TR and RTC_DR calendar registers format (BCD or Binary) is not the RTC Mix (RTC_BINARY_MIX) or BCD ( RTC_BINARY_NONE) or Binary-only (RTC_BINARY_ONLY) mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Development

Successfully merging a pull request may close this issue.

4 participants