RAK4630 Custom Firmware

Hello everyone,
We bought some RAK4630 Core and we don’t have any development kits. There are only module connections on the PCB we prepared, and we did not make a connection for the USB pins. We want to develop software on this product. As we understand it, we have 2 options for this. We will either develop an Arduino-based software using RUI or run our own custom software.

  1. If we want to develop a program with Arduino, what should we do? What path should we follow?
  2. If we want to develop our own software independent of Arudino, what should we do? Can we find drivers for SX1262?

Welcome to the forum @yldzmuhammed

If you do not have the USB pins connected, you can flash a new firmware with SWD or Jedec adapter, like our RAKDAP1

If you want to use Arduino (or Visual Studio Code with Arduino Extyension), you can find information in our Documentation Center in the RAK4630 Quick Start Guide

You can develop firmware with any other IDE that supports the Nordic nRF52 MCU, but you have to find a matching library/driver for the SX1262. We do not have a guide where to find it or how to use it in other IDE’s.

You can have a look into LoRaMac-node that is supported by Semtech. But I do not know how difficult it is to use it with the nRF52 MCU.

Thank you for your quick response.
If want to go with Arduino, how can I download the ardiuno app? Is it necessary to have a USB connection?

It is easier with an USB connection, but you can use RAKDAP1 to flash the firmware.

Arduino IDE creates a .hex file during compilation.


You can flash the .hex file with RAKDAP1 as shown in our Documentation

Thank you for your support. I have couple of questions.

  • I erased the entire chip to load my custom app. How can I load Arduino engine? I need step by step guide.
  • I actually do not want to use arduino at all. Instead develop my own software. To do that, I need to know about the pinout the module itself. What is the lora ic connections? Which pins connected to the ic?
  • What is the correct clock configuration for the nrf52? It is very sensitive that way, you know.

Hello @yldzmuhammed

I will send you the RAK4630 schematics in a private post, I cannot attach PDF files here.
There you can see the complete connections between the nRF52 and the SX1262.

For the nRF52 clock configuration, it is set in the bootloader and you can check in the sources of the bootloader which configuration is used. RAK4630 Bootloader.

Thank you for sharing it out.
I am facing with a problem.
I am using https://github.com/FreeRTOS/Lab-Project-FreeRTOS-LoRaWAN library for lorawan stack. As I see, it is ready to use project.
But even I changed the connections (in the iot_gpio_config.h file) to the correct ones, I can not receive any spi data. Code stuck in iot_spi.c file line 599 (while(!pxSpiContext->bTransferDone){}). There is no spi communication between nrf52 and sx1262. Do you have any idea? Can you guide me?

I don’t know that library, so it is quite difficult to give any help.
On a quick look, did you change the assignment of the SPI pins here

I did not see that. Now changed and fixed the spi problem. Now stuck in busy function. Is there any other busy pin def?

Is there a way to work with arduino again? I have to test my hardware and I want to see LoRaWAN end device package on the gateway.
What should I do?

Stuck in Busy
As I said, I do not know that FreeRTOS code, I found the SPI pin definitions by chance. You will have to dig into the source codes to find the Busy pin definitions.

Back to Arduino
Two options
Arduino BSP:
Flash the Arduino Bootloader available on Github
Flash your Arduino application over the USB port of the RAK4630

RUI3 BSP
Flash the latest RUI3 firmware for RAK4630 available in our Download Center RAk4631_latest_final.hex

Using the RUI3 BSP could be faster for testing, because our RUI3 firmware has an AT command interface, so you can test the communication without writing a firmware that does the connection. You might consider as well to use RUI3 API to write your application.

RUI3 AT command manual
RUI3 API documentation

Thank you. As I understand, somehow, your LoRaWAN library is different than others.
I am not sure exactly which part. Do you have a separate library for OEM usage?

For our Arduino based open source version we use the SX126x-Arduino

@beegee you are the best!
I will look into that repo in the near future.
I have another question. My first PCB had some revision needs. One of them is to fix the footprint issues.
The second one is the lack of a USB connector. I am going to add one. But as I see, there are no USB pull-up resistors on your PCB. I have never used USB on the nRF52, so I am not sure if I need to add pull-up resistors or not. Do I need to add them to the PCB?
By the way, I am developing a parked vehicle sensor. Do you have any magnetometer suggestions?

We do not have pull-ups on the USB lines, I don’t think they are required. More important is the ESD protection of the lines:
image

About magnetometer sensors, you want to measure the change in the magnetic field when a car is occupying the parking slot? I don’t think any of our sensors can do that. We have a 9DOF sensor in development that can measure the magnetic field of the earth, but I am not sure if that works for you.

Maybe our RAK12029 Inductive Sensor could be used.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.