RAK4630 NRF52 functionalities on Custom Board over Android BSP (lpcomp, saadc)

Hello everyone,

I am currently in the process of designing a custom board that utilizes the RAK4630 module. My journey began with evaluating the RAK4631 starter kit, through which I aimed to test the integration of my LoRa infrastructure using RUI, as well as basic programming using Arduino via PlatformIO. My experiences so far have been positive, and I’ve managed to successfully navigate through these initial stages.

In my search for the best approach to develop this custom board, I’ve come across several recommended options based on the documentation and discussions within this forum:

  1. Utilizing a Custom Bootloader with the Nordic SDK: This route suggests native development with NRF SDK and requires looking into a Semtech library for LoRa communication. Nordic SDK Documentation.
    Programming over SWD and nordic or Segger ide. → the conventional way
  2. Bootloader via Zephyr: By adopting Zephyr, I’d be able to adjust the device tree to suit my custom PCB. This method provides a level of abstraction and has proven communication capabilities with LoRa. Zephyr Documentation for RAK4631
    Programming over SWD and vscode → suggestion of nordic
  3. Arduino BSP Integration: Your suggestions have pointed me towards using the Arduino BSP. However, I’m unclear on how to access basic NRF features like SAADC and LPCOMP, which are crucial for tasks like waking up the board through an analog signal and preprocessing it.

For the third option, which seems promising due to the support available, I find myself needing more information. Specifically, I’m looking for documentation or resources that could help me understand how to leverage basic NRF features within the Arduino BSP context. I’ve stumbled upon some libraries on GitHub, but I’m seeking a more structured overview or any links that could provide in-depth knowledge on this topic.

Could anyone provide guidance or share resources on how to access and utilize these NRF features, particularly focusing on SAADC and LPCOMP functionalities within the Arduino BSP framework?

Thank you for your support and looking forward to your insightful responses.

lpcomp and saadc are not available on API level. Functions are in the BSP’s in the drivers levels, but not exposed.

If you know what you are doing, you can have a look into
nrf_lcomp.h
(RUI3)
rak_rui\hardware\nrf52\4.1.1\cores\nRF5\external\nRF5_SDK\nRF5_SDK_17.0.2_d674dde\modules\nrfx\drivers\include\nrf_lcomp.h
(Arduino BSP)
rakwireless\hardware\nrf52\1.3.3\cores\nRF5\nordic\nrfx\drivers\include\nrf_lcomp.h

nrfx_saadc.h
(RUI3):
rak_rui\hardware\nrf52\4.1.1\cores\nRF5\external\nRF5_SDK\nRF5_SDK_17.0.2_d674dde\modules\nrfx\drivers\src\nrfx_saadc.h
(Arduino BSP)
rakwireless\hardware\nrf52\1.3.3\cores\nRF5\nordic\nrfx\drivers\include\nrfx_saadc.h

Thank you. I managed to get it working with zephyr and use the nrfx functions direkt.
Use the Nordic DK for programming over SWD. First tries with the lora lib from zephyr works great.