RAK11310 - Using Serial1

Hello again! I hope all is well.

For my current project, I’m trying to use the RAK11310 without using lora, and while using Serial1 for another device (AFAIK Serial1 is used for communicating to the lora modem).

Currently, when attempting to send data through Serial1, the following is sent instead by the module instead.

++ MbedOS Fault Handler ++

FaultType: HardFault

Context:
R0   : 20010D04
R1   : 00000001
R2   : 00000005
R3   : E7FDBF30
R4   : 00000005
R5   : 2000CCE4
R6   : 2000BDB8
R7   : 00000064
R8   : 00000000
R9   : 00000000
R10  : 00000000
R11  : 00000000
R12  : 1000B639
SP   : 2000BD38
LR   : 1000C357
PC   : E7FDBF30
xPSR : 00000000
PSP  : 2000BD18
MSP  : 2003FFC0
CPUID: 410CC601
Mode : Thread
Priv : Privileged
Stack: PSP

-- MbedOS Fault Handler --



++ MbedOS Error Info ++
Error Status: 0x80FF013D Code: 317 Module: 255
Error Message: Fault exception
Location: 0xE7FDBF30
Error Value: 0x2000DB58
Current Thread: main Id: 0x2000DD28 Entry: 0x1000FFE9 StackSize: 0x8000 StackMem: 0x20003F30 SP: 0x2000BD38 
For more info, visit: https://mbed.com/s/error?error=0x80FF013D&osver=61200&core=0x410CC601&comp=2&ver=110100&tgt=RASPBERRY_PI...

-- MbedOS Error Info --

My guess is the lora module is the lora module is somehow interrupting me sending msgs over Serial1, but I’m not sure how…

Additionally, I’ve tried holding the internal lora reset pin low (pin 14), which gives the same error.

Any ideas?

Welcome back to the forum @HDT

The RAK11310 uses SPI to communicate with the LoRa transceiver. Serial1 is free to be used.

Are you using the Arduino BSP or the RPi RP2040 SDK?

I’m using PlatformIO - within this google drive link is an MVP for the issue (I’m a new user and can’t attach an actual file, sorry!)

@beegee Some additional information:

  • I’ve tried running the following code using the Arduino IDE and it works as expected:
void setup() {
  // put your setup code here, to run once:
  Serial1.begin(115200);
  Serial1.println("test");
}

void loop() {
  // put your main code here, to run repeatedly:

}
  • I’ve updated my install using the following instructions to no avail: Instructions

Tested and confirm that when compiling with PIO it throws an error.

Difference between Arduino BSP and PIO is
ArduinoBSP - tested and working, provided by us. Based on old V2.3.1 Arduino MBed BSP.
PIO - Arduino MBed package V4.0.2 provided by PIO and patched to add the RAK11310.

Not sure how it could be fixed.

Damn.

Do you know of any PIO based Serial libraries for the module? I’m currently trying to port over the pico sdk’s SerialPIO (even them I’m running into issues, not sure why just yet) - however I would prefer using some out of the box solution if there is any.

Sorry, I am never using the RAK11300, the Arduino support for the RP2040 kind of sucks.
No idea why it has the Serial1 problem or how to get around it.

I’ve got a fix!

It’s not perfect, but I cludged together a HardwareSerial implementation based on pschatzmann’s pico-arduino SoftwareSerial

If anyone else needs it, here it is I can’t post a link to it as I don’t have enough rep :frowning:

@beegee Thank you so much for your help!

@HDT
Send me the link as private message, I will add it here.

Thanks for finding a workaround!

I’m not allowed to PM either haha,

Here’s the link to my solution - it ain’t perfect, but it works
(Had to add a dash in github as I’m not allowed to send it otherwise)

Ok, link is working now.

Thanks again.

1 Like

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

I put the Flamabalistic code into an ArduinoIDE/PIO library.

Not published, waiting for the original author for permission.
In the meantime it can be installed from ZIP file in ArduinoIDE or with github link in platformio.ini

PicoSoftwareSerial