Skip to content

LoRaWAN with low power and RTC #9

Closed

Description

@Lizethgm

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?

Activity

  1. fpistm commented on Jan 17, 2023

    @fpistm
    Member

    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.

  2. added
    enhancement
    on Jan 17, 2023
  3. jpmeijers commented on Apr 25, 2023

    @jpmeijers

    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
    
  4. FRASTM commented on May 9, 2023

    @FRASTM
    Contributor

    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.

  5. added this to the 0.2.0 milestone on Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancement

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions