[M467 | M487] PC Controls RYLR998 via NuMaker Board running pass-through firmware

Post Reply
morgandu
Posts: 45
Joined: 28 Apr 2017, 22:47

06 Jun 2023, 17:02

[For further inquiries, please e-mail to shchen2@nuvoton.com]
[Visit https://www.nuvoton.com/iot_startup for more IoT solutions]


566__1.png
566__1.png (40.43 KiB) Viewed 8567 times

Reyax RYLR998 module features the LoRa long range, high interference immunity, and lower power consumption for wireless communication. And it is controlled by AT command. To test it before develop application, you may want to try to control it via AT command. A simply way is to use a NuMaker board running pass-through firmware to connect between PC and RYLR998 module.

Picture1_s.jpg
Picture1_s.jpg (31.61 KiB) Viewed 8567 times

Let's do it step by step. First, connect RYLR998 module to Arduino UNO connector on NuMaker-IoT board

Picture2_s.jpg
Picture2_s.jpg (90.43 KiB) Viewed 8567 times

Next, to build the pass-through firmware. The pass-through source code is written on Mbed OS v6. So you need to install Mbed tool to build the code. If you don't know the Mbed OS, we also provide pre-built firmware for NuMaker-IoT-M487 and NuMaker-IoT-M467, feel free to contact us (SalesSupport@nuvoton.com)

The pass-through source code as follows

Code: Select all

#include "mbed.h"

#define PC_BAUDRATE     115200
#define DEV_BAUDRATE    115200

UnbufferedSerial  pc(USBTX, USBRX);
UnbufferedSerial  dev(D1, D0);

// Low active Reset for RYLR998
DigitalOut dev_rst(D2, 1);

DigitalOut led1(LED1);
DigitalOut led2(LED2);

void dev_recv()
{
    char c;

    led1 = !led1;
    while(dev.readable()) {
        dev.read(&c, 1);
        pc.write(&c, 1);
    }
}

void pc_recv()
{
    char c;

    led2 = !led2;
    while(pc.readable()) {
        pc.read(&c, 1);
        dev.write(&c, 1);
    }
}

int main()
{
    pc.baud(PC_BAUDRATE);
    dev.baud(DEV_BAUDRATE);

    printf("Starting pass-through firmware...\r\n");
    pc.attach(&pc_recv, SerialBase::RxIrq);
    dev.attach(&dev_recv, SerialBase::RxIrq);

    while(1)
        sleep();
}
You can import the source code from https://github.com/morgan-du/Serial-Passthrough to your Mbed development tool (Mbed Studio, Mbed CLI, or Keil Studio Cloud). Or you can download the prebuilt firmware in https://github.com/morgan-du/Serial-Pas ... r/firmware for NuMaker-IoT-M467 and NuMaker-IoT-M487 boards.

Next, program the firmware to NuMaker board.

There are many terminal tools on PC, the "Termite" is recommended. When Nu-Link USB on NuMaker board connects to PC, launch Termite and open the Nu-Link VCOM with following configuration. COM port depends on your system assigned.

Picture3_s.png
Picture3_s.png (27.6 KiB) Viewed 8567 times

Now, you can issue AT+RESET to reset module, or AT+VER? to get module version number. Please refer RYLR998 manual for other AT commands.

If you have any problems, please feel free to contact us SalesSupport@nuvoton.com

For Nuvoton IoT platform information, please refer https://www.nuvoton.com/iot_startup

Post Reply
  • Information
  • Who is online

    Users browsing this forum: No registered users and 3 guests