Skip to content

RAK3172 "WLE5CCU6" #7

Closed
Closed

Description

@Lizethgm

Hi,
I managed to run your library with rak3172
For this I modified these parts:

In STM32LoRaWAN-main\src\BSP\radio_board_if.c

// Is a TCXO present on the board?
#if !defined(LORAWAN_BOARD_HAS_TCXO)
  #define LORAWAN_BOARD_HAS_TCXO 0U
#endif

  #if !defined(LORAWAN_RFSWITCH_PINS)
  #define LORAWAN_RFSWITCH_PINS PB8,PC13
  #define LORAWAN_RFSWITCH_PIN_COUNT 2
  #define LORAWAN_RFSWITCH_OFF_VALUES LOW,LOW
  #define LORAWAN_RFSWITCH_RX_VALUES HIGH,LOW
  #define LORAWAN_RFSWITCH_RFO_LP_VALUES LOW,HIGH
  #define LORAWAN_RFSWITCH_RFO_HP_VALUES LOW,HIGH

In STM32LoRaWAN-main\src\BSP\rtc.c

 hrtc.Instance = RTC;
  hrtc.Init.AsynchPrediv = 127;
  hrtc.Init.SynchPrediv = 255;
  hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
  hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE;
  hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
  hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
  hrtc.Init.OutPutPullUp = RTC_OUTPUT_PULLUP_NONE;
  hrtc.Init.BinMode = RTC_BINARY_ONLY;

How could I add this to your library without having to modify it, which is what I had to do?

Also I tested your library as you had it in the beginning for the NUCLEO-WLE55JC1 board and everything worked correctly, I also tested it with the US915 and it still worked fine.

Activity

  1. fpistm commented on Dec 22, 2022

    @fpistm
    Member

    Hi,

    I guess the simpliest way would be in the src\BSP\radio_board_if.c to define config between board definition:

    #if !defined(LORAWAN_BOARD_HAS_TCXO)
    #if defined(NUCLEO_WL55JC1)
      #define LORAWAN_BOARD_HAS_TCXO 1U
    #elif defined(GENERIC_WL55CCUX) /* <-- or defined the RAK3172 variant in the core? */
      #define LORAWAN_BOARD_HAS_TCXO 0U
    #endif
    #endif
    

    For RTC, default config is not correct?

  2. Lizethgm commented on Dec 23, 2022

    @Lizethgm
    Author

    Oh, thanks, I will try to do that

    No, the rtc of the RAK3172 has two distinct things which are:
    hrtc.Init.AsynchPrediv = 127;
    hrtc.Init.SynchPrediv = 255;

  3. added
    enhancement
    on Jan 3, 2023
  4. added this to the 0.1.1/0.2.0 milestone on Jan 5, 2023
  5. Lizethgm commented on Jan 6, 2023

    @Lizethgm
    Author

    Hi
    Yes it worked, I put it this way to make it work:
    In STM32LoRaWAN-main\src\BSP\radio_board_if.c

    #if !defined(LORAWAN_BOARD_HAS_TCXO)
     #if defined(ARDUINO_NUCLEO_WL55JC1)  
      #define LORAWAN_BOARD_HAS_TCXO 1U
    
    #elif defined(ARDUINO_GENERIC_WLE5CCUX) 
      #define LORAWAN_BOARD_HAS_TCXO 0U
    #endif
    #endif
    
    
    #if !defined(LORAWAN_RFSWITCH_PINS)
      #if defined(ARDUINO_NUCLEO_WL55JC1)
      #define LORAWAN_RFSWITCH_PINS PC3,PC4,PC5
      #define LORAWAN_RFSWITCH_PIN_COUNT 3
      #define LORAWAN_RFSWITCH_OFF_VALUES LOW,LOW,LOW
      #define LORAWAN_RFSWITCH_RX_VALUES HIGH,HIGH,LOW
      #define LORAWAN_RFSWITCH_RFO_LP_VALUES HIGH,HIGH,HIGH
      #define LORAWAN_RFSWITCH_RFO_HP_VALUES HIGH,LOW,HIGH
    
    #elif defined(ARDUINO_GENERIC_WLE5CCUX) 
      #define LORAWAN_RFSWITCH_PINS PB8,PC13
      #define LORAWAN_RFSWITCH_PIN_COUNT 2
      #define LORAWAN_RFSWITCH_OFF_VALUES LOW,LOW
      #define LORAWAN_RFSWITCH_RX_VALUES HIGH,LOW
      #define LORAWAN_RFSWITCH_RFO_LP_VALUES LOW,HIGH
      #define LORAWAN_RFSWITCH_RFO_HP_VALUES LOW,HIGH
    #endif
    #endif

    In STM32LoRaWAN-main\src\BSP\rtc.c

    #if defined(ARDUINO_NUCLEO_WL55JC1)
      hrtc.Instance = RTC;
      hrtc.Init.AsynchPrediv = RTC_PREDIV_A;
      hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
      hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE;
      hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
      hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
      hrtc.Init.OutPutPullUp = RTC_OUTPUT_PULLUP_NONE;
      hrtc.Init.BinMode = RTC_BINARY_ONLY;
    
    #elif defined(ARDUINO_GENERIC_WLE5CCUX) 
      hrtc.Instance = RTC;
      hrtc.Init.AsynchPrediv = 127;
      hrtc.Init.SynchPrediv = 255;
      hrtc.Init.OutPut = RTC_OUTPUT_DISABLE;
      hrtc.Init.OutPutRemap = RTC_OUTPUT_REMAP_NONE;
      hrtc.Init.OutPutPolarity = RTC_OUTPUT_POLARITY_HIGH;
      hrtc.Init.OutPutType = RTC_OUTPUT_TYPE_OPENDRAIN;
      hrtc.Init.OutPutPullUp = RTC_OUTPUT_PULLUP_NONE;
      hrtc.Init.BinMode = RTC_BINARY_ONLY;
      #endif
  6. added a commit that references this issue on Feb 13, 2023
    5b40838
  7. tcpipchip commented on Feb 18, 2023

    @tcpipchip
    Contributor

    @Lizethgm
    I am tryng to execute the AT/Arduino of RAK (RUI) on STM32WL55JC, but i am getting always JOIN TXD TIMEOUT...looks that the problem is some wrong RF SWITCH GPIO selected by me...
    Can you give a tip ?
    @fpistm
    Congratulations! I will test in our South Korean LoRaWAN module :)

  8. tcpipchip commented on Feb 21, 2023

    @tcpipchip
    Contributor
  9. fpistm commented on Mar 23, 2023

    @fpistm
    Member

    Hi @Lizethgm
    the good way to support the RAK3172 is to add the variant to the core.
    It seems there is 3 variants:

  10. tcpipchip commented on Mar 23, 2023

    @tcpipchip
    Contributor

    And implement low power mode

  11. fpistm commented on Mar 23, 2023

    @fpistm
    Member

    Part of another issue #9

  12. fpistm commented on Mar 24, 2023

    @fpistm
    Member

    @Lizethgm , @tcpipchip
    which RAK3172 you got?

  13. removed this from the 0.1.1/0.2.0 milestone on Mar 24, 2023
  14. tcpipchip commented on Mar 24, 2023

    @tcpipchip
    Contributor

    I dont have the RAK, i have the WISOL module...
    I ported the RAK Arduino Code to run on WISOL.
    But...it´s compatible,

  15. Oliv4945 commented on Mar 24, 2023

    @Oliv4945

    Note that RAK provides Arduino support: https://github.com/RAKWireless/RAKwireless-Arduino-BSP-Index

    Actually the RAK3172 Arduino support provided by RAK is only for RUI3 (RAK UI), which mean using a closed source library blob from RAK, it is not "low level" like what stm32duino is doing.

    As per my understanding:

    • RAK3172 Evaluation Board is a breakout board of the module
    • RAK3172 Module is based on the STM32WLE5CC, only the RFO_HP is wired to the antenna
    • RAK3172-SIP is based on the STM32WLE5JC, only the RFO_HP is wired to the antenna
    • RAK3172LP-SIP is based on the STM32WLE5JC, only the RFO_LP is wired to the antenna

    So what is your advice on the integration @fpistm ? Add custom code under ARDUINO_RAK3172_MODULE, ARDUINO_RAK3172_SIP and ARDUINO_RAK3172LP_SIP ?
    Or add common definition under ARDUINO_RAK3172 and only the RF switch config under dedicated defines?

    Thanks

  16. fpistm commented on Mar 25, 2023

    @fpistm
    Member

    I guess adding ARDUINO_RAK3172 is the simpliest way and define correct RF definition for each sub-variant.

  17. tcpipchip commented on Mar 25, 2023

    @tcpipchip
    Contributor

    add too the LSM110A :)
    i use this parameters to work with him
    image

  18. fpistm commented on Mar 27, 2023

    @fpistm
    Member

    Added to the new variant request list: stm32duino/Arduino_Core_STM32#722
    I close this one as when variants added to the core with dedicated RF definitions, they will be supported.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions