I have a RAK4631 core and a RAK19010 base. I’m trying to send a “Hello World” message to the platformio monitor. I am able to use the RAKDAP1 to flash to the RAK4631 but I am unable to receive serial print statements in the platformio monitor. My current code is as follows (ignore the RS485 and modbus library imports those are for future use):
#include <Arduino.h>
#include "Adafruit_TinyUSB.h"
#include <ArduinoRS485.h>
#include <ArduinoModbus.h>
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
Serial1.begin(115200);
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH);
delay(1000);
digitalWrite(LED_BUILTIN, LOW);
delay(1000);
Serial1.println("Hello World");
}
Building the file receives no errors but when I click Upload or Upload and Monitor I get the following log:
Processing MODBUS (board: wiscore_rak4631; platform: nordicnrf52; framework: arduino)
----------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/wiscore_rak4631.html
PLATFORM: Nordic nRF52 (10.4.0) > WisCore RAK4631 Board
HARDWARE: NRF52840 64MHz, 243KB RAM, 796KB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, jlink, stlink)
PACKAGES:
- framework-arduinoadafruitnrf52 @ 1.10600.0 (1.6.0)
- framework-cmsis @ 2.50700.210515 (5.7.0)
- tool-adafruit-nrfutil @ 1.503.0 (5.3)
- tool-bossac-nordicnrf52 @ 1.10901.201022 (1.9.1)
- tool-openocd @ 3.1200.0 (12.0)
- tool-sreccat @ 1.164.0 (1.64)
- toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 15 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoModbus @ 1.0.9
|-- Adafruit TinyUSB Library
|-- ArduinoRS485 @ 1.0.5
Building in release mode
Checking size .pio\build\MODBUS\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 3.0% (used 7480 bytes from 248832 bytes)
Flash: [= ] 5.5% (used 44772 bytes from 815104 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, jlink, nrfjprog, nrfutil, stlink
CURRENT: upload_protocol = cmsis-dap
Uploading .pio\build\MODBUS\firmware.hex
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
[nrf52.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000a80 msp: 0x20000400
** Programming Started **
Warn : Adding extra erase range, 0x00030ee4 .. 0x00030fff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
======================= [SUCCESS] Took 6.37 seconds =======================
* Terminal will be reused by tasks, press any key to close it.
* Executing task in folder RDTM: C:\Users\lukaj\.platformio\penv\Scripts\platformio.exe run --target upload --environment MODBUS
Processing MODBUS (board: wiscore_rak4631; platform: nordicnrf52; framework: arduino)
----------------------------------------------------------------------------
Verbose mode can be enabled via `-v, --verbose` option
CONFIGURATION: https://docs.platformio.org/page/boards/nordicnrf52/wiscore_rak4631.html
PLATFORM: Nordic nRF52 (10.4.0) > WisCore RAK4631 Board
HARDWARE: NRF52840 64MHz, 243KB RAM, 796KB Flash
DEBUG: Current (cmsis-dap) External (cmsis-dap, jlink, stlink)
PACKAGES:
- framework-arduinoadafruitnrf52 @ 1.10600.0 (1.6.0)
- framework-cmsis @ 2.50700.210515 (5.7.0)
- tool-adafruit-nrfutil @ 1.503.0 (5.3)
- tool-bossac-nordicnrf52 @ 1.10901.201022 (1.9.1)
- tool-openocd @ 3.1200.0 (12.0)
- tool-sreccat @ 1.164.0 (1.64)
- toolchain-gccarmnoneeabi @ 1.70201.0 (7.2.1)
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
LDF Modes: Finder ~ chain, Compatibility ~ soft
Found 15 compatible libraries
Scanning dependencies...
Dependency Graph
|-- ArduinoModbus @ 1.0.9
|-- Adafruit TinyUSB Library
|-- ArduinoRS485 @ 1.0.5
Building in release mode
Checking size .pio\build\MODBUS\firmware.elf
Advanced Memory Usage is available via "PlatformIO Home > Project Inspect"
RAM: [ ] 3.1% (used 7820 bytes from 248832 bytes)
Flash: [= ] 5.8% (used 46992 bytes from 815104 bytes)
Configuring upload protocol...
AVAILABLE: cmsis-dap, jlink, nrfjprog, nrfutil, stlink
CURRENT: upload_protocol = cmsis-dap
Uploading .pio\build\MODBUS\firmware.hex
xPack Open On-Chip Debugger 0.12.0-01004-g9ea7f3d64-dirty (2023-01-30-15:04)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
debug_level: 1
[nrf52.cpu] halted due to debug-request, current mode: Thread
xPSR: 0x01000000 pc: 0x00000a80 msp: 0x20000400
** Programming Started **
Warn : Adding extra erase range, 0x00031790 .. 0x00031fff
** Programming Finished **
** Verify Started **
** Verified OK **
** Resetting Target **
shutdown command invoked
======================= [SUCCESS] Took 6.53 seconds =======================
* Terminal will be reused by tasks, press any key to close it.
type or paste code here
I’m not sure if this will point to the issue or not. chasing the "[nrf52.cpu] halted due to debug-request, current mode: Thread " line hasn’t lead to anything beneficial yet.
I have tried all variations of Serial, Serial1, and Serial2. I have the U_TX and U_RX pins of the RAKDAP1 connected to the TX0 and RX0 pins on the board. Swapping the connections doesn’t change anything. I have used a voltmeter and tested continuity between both the soldered TX0 and RX0 pins and the corresponding UART1_TX and UART1_RX pins on the RAK4631. When I accidentally touched the RX pin on the RAKDAP1 to RS485-B pin on my RAK5802 module random symbols appeared on the platformio monitor so I’m assuming that it is possible to achieve what I want, I’m just unsure how. Any pointers would be greatly appreciated.