You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[New Variant] STM32F103C8T6 with DX-LR30 or DX-LR20 #2777
Board description (please complete the following information):
Name: [e.g. DISCOVERY F769NI]
Link to all relevant information:
Documentations
Schematics
Where this hardware can be purchased
...
I found and ordered some OEM dev boards from a chinese manufacturer on aliexpress.
these have a STM32F1 combined with a LoRa module on one board, which makes them very interesting for long therm low energy LoRaWAN applications.
and i would be happy to donate a board to an interested developer!
you have to set DTR and RTS write to get the board in flash-mode. I made (rather gpt did) a small script for visual studio code. it works dor me, maybe someone finds it useful:
reset.sequence.py:
Import("env")
import serial
import time
import serial.tools.list_ports
def get_upload_port(env):
"""Ermittelt den Upload-Port"""
port = env.subst("$UPLOAD_PORT")
if not port or port == "":
ports = list(serial.tools.list_ports.comports())
if ports:
port = ports[0].device
print(f"Auto-detected port: {port}")
else:
print("⚠️ No COM port found!")
return None
return port
def custom_reset_sequence(source, target, env):
port = get_upload_port(env)
if not port:
return
print(f"🔄 ISP Boot Sequence on {port}...")
try:
ser = serial.Serial(port, 115200, timeout=1)
ser.setDTR(False) # DTR LOW = Reset
ser.setRTS(True) # RTS HIGH = Boot0
time.sleep(0.1)
ser.setDTR(True) # Reset freigeben
time.sleep(0.05)
ser.close()
print("✅ Reset sequence complete!")
except Exception as e:
print(f"❌ Error: {e}")
def reset_after_upload(source, target, env):
port = get_upload_port(env)
if not port:
return
print(f"🔄 Resetting device on {port}...")
try:
ser = serial.Serial(port, 115200, timeout=1)
ser.setDTR(False) # DTR LOW = Reset
ser.setRTS(False) # RTS LOW = Normal Boot
time.sleep(0.1)
ser.setDTR(True) # Reset freigeben
ser.close()
print("✅ Device reset complete!")
except Exception as e:
print(f"❌ Error: {e}")
env.AddPreAction("upload", custom_reset_sequence)
env.AddPostAction("upload", reset_after_upload)
DEBUGGING:
STEP 1) took two identical boards
STEP 2) Flashed blink code on SAMPLE A using following platformio.ini
//____________________________________________________________________________
[env:blink_test]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
; No external LoRa libraries - using custom driver in lib/SX1262_Custom
upload_protocol = serial
upload_speed = 115200
monitor_speed = 115200
; Output Intel HEX format for flashing with MCU ISP tools
board_build.mcu = stm32f103c8t6
board_upload.maximum_size = 65536
build_flags =
-D HAL_UART_MODULE_ENABLED
-D ENABLE_HWSERIAL1
upload_flags =
-i
rts,-dtr,dtr:-rts,-dtr,dtr
//___________________________________________________________________
code uploaded sucessfully.
STEP 3) Repeating step for SAMPLE B
a) issue noted: ls /dev/tty* not showing /dev/ttyUSB0
b) solution: hold down the key1 and the RST button
c) Result: /dev/ttyUSB0 Visible
d) Repeat the upload process
e) Recieved following error msg:-
STEP 5) Hold down the button and release it just before the upload started => Upload Sucessful :)
STEP 6) Plug it back in to see if it appears without holding the buttons. And it Did !!!!!!!!!!!!!!!
Problem Solved!!!!!!!!!!
But the issue still bugged me
So I found the guy who used the board earlier.
enquired about the last code which was uploaded to the board.
Apparently he used Serial.print instead of serial1.print.
Also he had was using the 'SX1262_Custom' from @NeutralSystem and CANbus code from STM32_CAN.
I believe something in that code messed up something. Unfortunately, the code was not available.
DEBUGGING: STEP 1) took two identical boards STEP 2) Flashed blink code on SAMPLE A using following platformio.ini
//____________________________________________________________________________ [env:blink_test] platform = ststm32 board = genericSTM32F103C8 framework = arduino ; No external LoRa libraries - using custom driver in lib/SX1262_Custom upload_protocol = serial upload_speed = 115200 monitor_speed = 115200 ; Output Intel HEX format for flashing with MCU ISP tools board_build.mcu = stm32f103c8t6 board_upload.maximum_size = 65536 build_flags = -D HAL_UART_MODULE_ENABLED -D ENABLE_HWSERIAL1 upload_flags = -i rts,-dtr,dtr:-rts,-dtr,dtr //___________________________________________________________________
code uploaded sucessfully.
Glad it worked for you, good job.
This is my platformio file, with upload flags i figured from the documentation from the supplier of these boards, this just uploads the code to the board without needing to do anything else, ( The same as you ) using platformIO:
i´ d like to create a PR for this board to add support. but this is way more complicated (the instructions are not clear in every step and not fully created) than i thought. do we have a chance to work together on this?
My successful RadioLib LoRaWAN example called LoRaWAN_Starter from the Arduino IDE but using VSCode for uploading and serial monitoring.
platformio.ini
[platformio]
default_envs = genericSTM32F103C8
src_dir = LoRaWAN_Starter # name of the folder where all files are, .ini, .ino. .h, .py
[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
board_build.core = stm32duino
upload_protocol = serial
upload_speed = 115200
extra_scripts = pre:reset_sequence.py
monitor_speed = 115200
monitor_dtr = 0
monitor_rts = 0
board_build.mcu = stm32f103c8t6
build_flags =
-D SERIAL_UART_INSTANCE=1
-D HAL_UART_MODULE_ENABLED
-D ENABLE_HWSERIAL1
upload_flags =
-i
rts,-dtr,dtr:-rts,-dtr,dtr
lib_deps = # libraries used in LoRaWAN_Starter.ino
SPI
jgromes/RadioLib @ ^7.4.0
reset_sequence.py credits to olek87 (see previous posts)
Import("env")
import serial
import time
import serial.tools.list_ports
def get_upload_port(env):
"""Ermittelt den Upload-Port"""
port = env.subst("$UPLOAD_PORT")
if not port or port == "":
ports = list(serial.tools.list_ports.comports())
if ports:
port = ports[0].device
print(f"Auto-detected port: {port}")
else:
print(" No COM port found!")
return None
return port
def custom_reset_sequence(source, target, env):
port = get_upload_port(env)
if not port:
return
print(f" ISP Boot Sequence on {port}...")
try:
ser = serial.Serial(port, 115200, timeout=1)
ser.setDTR(False) # DTR LOW = Reset
ser.setRTS(True) # RTS HIGH = Boot0
time.sleep(0.1)
ser.setDTR(True) # Reset freigeben
time.sleep(0.05)
ser.close()
print(" Reset sequence complete!")
except Exception as e:
print(f" Error: {e}")
def reset_after_upload(source, target, env):
port = get_upload_port(env)
if not port:
return
print(f" Resetting device on {port}...")
try:
ser = serial.Serial(port, 115200, timeout=1)
ser.setDTR(False) # DTR LOW = Reset
ser.setRTS(False) # RTS LOW = Normal Boot
time.sleep(0.1)
ser.setDTR(True) # Reset freigeben
ser.flush() # Ensure RTS stays LOW
ser.close()
print(" Device reset complete!")
except Exception as e:
print(f" Error: {e}")
env.AddPreAction("upload", custom_reset_sequence)
env.AddPostAction("upload", reset_after_upload)
config.h
#ifndef _RADIOLIB_EX_LORAWAN_CONFIG_H
#define _RADIOLIB_EX_LORAWAN_CONFIG_H
#include <RadioLib.h>
// Pin mapping for DX-LR30 board (SX1262, from LR20-SP schematic):
// NSS = PA4 (SPI1 chip select)
// DIO1 = PC15 (radio interrupt — SX1262 uses DIO1, not DIO0)
// RESET = PA3 (radio hardware reset)
// BUSY = PA2 (SX1262 busy indicator)
// SPI1 uses the default STM32F103 pins: PA5=SCK, PA6=MISO, PA7=MOSI
// Module constructor for SX126x: Module(NSS, DIO1, RESET, BUSY)
SX1262 radio = new Module(PA4, PC15, PA3, PA2);
// if you have RadioBoards (https://github.com/radiolib-org/RadioBoards)
// and are using one of the supported boards, you can do the following:
/*
#define RADIO_BOARD_AUTO
#include <RadioBoards.h>
Radio radio = new RadioModule();
*/
// how often to send an uplink - consider legal & FUP constraints - see notes
const uint32_t uplinkIntervalSeconds = 5UL * 60UL; // minutes x seconds
// joinEUI - previous versions of LoRaWAN called this AppEUI
// for development purposes you can use all zeros - see wiki for details. It can be kept as zeros.
#define RADIOLIB_LORAWAN_JOIN_EUI 0x0000000000000000
// the Device EUI & two keys can be generated on the TTN console
#ifndef RADIOLIB_LORAWAN_DEV_EUI // Replace with your Device EUI
#define RADIOLIB_LORAWAN_DEV_EUI 0x0000000000000000
#endif
#ifndef RADIOLIB_LORAWAN_APP_KEY // Replace with your App Key (TTN)
#define RADIOLIB_LORAWAN_APP_KEY 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
#endif
#ifndef RADIOLIB_LORAWAN_NWK_KEY // Put your Nwk Key here (TTN)
#define RADIOLIB_LORAWAN_NWK_KEY 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0
#endif
// for the curious, the #ifndef blocks allow for automated testing &/or you can
// put your EUI & keys in to your platformio.ini - see wiki for more tips
// regional choices: EU868, US915, AU915, AS923, AS923_2, AS923_3, AS923_4, IN865, KR920, CN470
const LoRaWANBand_t Region = EU868;
// subband choice: for US915/AU915 set to 2, for CN470 set to 1, otherwise leave on 0
const uint8_t subBand = 0;
// ============================================================================
// Below is to support the sketch - only make changes if the notes say so ...
// copy over the EUI's & keys in to the something that will not compile if incorrectly formatted
uint64_t joinEUI = RADIOLIB_LORAWAN_JOIN_EUI;
uint64_t devEUI = RADIOLIB_LORAWAN_DEV_EUI;
uint8_t appKey[] = { RADIOLIB_LORAWAN_APP_KEY };
uint8_t nwkKey[] = { RADIOLIB_LORAWAN_NWK_KEY };
// create the LoRaWAN node
LoRaWANNode node(&radio, &Region, subBand);
// result code to text - these are error codes that can be raised when using LoRaWAN
// however, RadioLib has many more - see https://jgromes.github.io/RadioLib/group__status__codes.html for a complete list
String stateDecode(const int16_t result) {
switch (result) {
case RADIOLIB_ERR_NONE:
return "ERR_NONE";
case RADIOLIB_ERR_CHIP_NOT_FOUND:
return "ERR_CHIP_NOT_FOUND";
case RADIOLIB_ERR_PACKET_TOO_LONG:
return "ERR_PACKET_TOO_LONG";
case RADIOLIB_ERR_RX_TIMEOUT:
return "ERR_RX_TIMEOUT";
case RADIOLIB_ERR_MIC_MISMATCH:
return "ERR_MIC_MISMATCH";
case RADIOLIB_ERR_INVALID_BANDWIDTH:
return "ERR_INVALID_BANDWIDTH";
case RADIOLIB_ERR_INVALID_SPREADING_FACTOR:
return "ERR_INVALID_SPREADING_FACTOR";
case RADIOLIB_ERR_INVALID_CODING_RATE:
return "ERR_INVALID_CODING_RATE";
case RADIOLIB_ERR_INVALID_FREQUENCY:
return "ERR_INVALID_FREQUENCY";
case RADIOLIB_ERR_INVALID_OUTPUT_POWER:
return "ERR_INVALID_OUTPUT_POWER";
case RADIOLIB_ERR_NETWORK_NOT_JOINED:
return "RADIOLIB_ERR_NETWORK_NOT_JOINED";
case RADIOLIB_ERR_DOWNLINK_MALFORMED:
return "RADIOLIB_ERR_DOWNLINK_MALFORMED";
case RADIOLIB_ERR_INVALID_REVISION:
return "RADIOLIB_ERR_INVALID_REVISION";
case RADIOLIB_ERR_INVALID_PORT:
return "RADIOLIB_ERR_INVALID_PORT";
case RADIOLIB_ERR_NO_RX_WINDOW:
return "RADIOLIB_ERR_NO_RX_WINDOW";
case RADIOLIB_ERR_INVALID_CID:
return "RADIOLIB_ERR_INVALID_CID";
case RADIOLIB_ERR_UPLINK_UNAVAILABLE:
return "RADIOLIB_ERR_UPLINK_UNAVAILABLE";
case RADIOLIB_ERR_COMMAND_QUEUE_FULL:
return "RADIOLIB_ERR_COMMAND_QUEUE_FULL";
case RADIOLIB_ERR_COMMAND_QUEUE_ITEM_NOT_FOUND:
return "RADIOLIB_ERR_COMMAND_QUEUE_ITEM_NOT_FOUND";
case RADIOLIB_ERR_JOIN_NONCE_INVALID:
return "RADIOLIB_ERR_JOIN_NONCE_INVALID";
case RADIOLIB_ERR_DWELL_TIME_EXCEEDED:
return "RADIOLIB_ERR_DWELL_TIME_EXCEEDED";
case RADIOLIB_ERR_CHECKSUM_MISMATCH:
return "RADIOLIB_ERR_CHECKSUM_MISMATCH";
case RADIOLIB_ERR_NO_JOIN_ACCEPT:
return "RADIOLIB_ERR_NO_JOIN_ACCEPT";
case RADIOLIB_LORAWAN_SESSION_RESTORED:
return "RADIOLIB_LORAWAN_SESSION_RESTORED";
case RADIOLIB_LORAWAN_NEW_SESSION:
return "RADIOLIB_LORAWAN_NEW_SESSION";
case RADIOLIB_ERR_NONCES_DISCARDED:
return "RADIOLIB_ERR_NONCES_DISCARDED";
case RADIOLIB_ERR_SESSION_DISCARDED:
return "RADIOLIB_ERR_SESSION_DISCARDED";
}
return "See https://jgromes.github.io/RadioLib/group__status__codes.html";
}
// helper function to display any issues
void debug(bool failed, const __FlashStringHelper* message, int state, bool halt) {
if(failed) {
Serial1.print(message);
Serial1.print(" - ");
Serial1.print(stateDecode(state));
Serial1.print(" (");
Serial1.print(state);
Serial1.println(")");
while(halt) { delay(1); }
}
}
// helper function to display a byte array
void arrayDump(uint8_t *buffer, uint16_t len) {
for(uint16_t c = 0; c < len; c++) {
char b = buffer[c];
if(b < 0x10) { Serial1.print('0'); }
Serial1.print(b, HEX);
}
Serial1.println();
}
#endif
LoRaWAN_Starter.ino
/*
RadioLib LoRaWAN Starter Example
Pin mapping for DX-LR30 / LR20-SP board:
Serial1: PA9 (TX) / PA10 (RX) -> CH340C -> USB
SPI1: PA5 (SCK), PA6 (MISO), PA7 (MOSI)
Radio: PA4 (NSS), PA3 (DIO0), PA2 (DIO1), RST unknown
For full API reference, see the GitHub Pages
https://jgromes.github.io/RadioLib/
*/
#include <Arduino.h>
#include <SPI.h>
#include "config.h"
#define LED_PIN PC13
void setup() {
// --- Release PC13 from backup domain ---
RCC->APB1ENR |= RCC_APB1ENR_PWREN | RCC_APB1ENR_BKPEN;
PWR->CR |= PWR_CR_DBP;
BKP->RTCCR &= ~BKP_RTCCR_ASOE;
pinMode(LED_PIN, OUTPUT);
// Explicitly set USART1 pins (required for genericSTM32F103C8 variant)
Serial1.setTx(PA9);
Serial1.setRx(PA10);
Serial1.begin(115200);
delay(3000); // Give time to open the serial monitor
Serial1.println(F("\n=== LoRaWAN Starter (DX-LR30) ==="));
Serial1.print(F("SystemCoreClock = "));
Serial1.print(SystemCoreClock);
Serial1.println(F(" Hz"));
// Initialize SPI1 (default pins PA5/PA6/PA7 on STM32F103)
SPI.begin();
Serial1.println(F("Initialising radio (SX1262)..."));
int16_t state = radio.begin();
Serial1.print(F("radio.begin() returned: "));
Serial1.print(state);
Serial1.print(F(" ("));
Serial1.print(stateDecode(state));
Serial1.println(F(")"));
if (state != RADIOLIB_ERR_NONE) {
Serial1.println(F("*** Radio init FAILED — halting. ***"));
Serial1.println(F("Check SPI wiring (PA4=NSS, PA5=SCK, PA6=MISO, PA7=MOSI)"));
Serial1.println(F("and DIO0 (PA3). Is the LR20/30 module powered?"));
while (true) {
// Blink fast to indicate error
digitalWrite(LED_PIN, !digitalRead(LED_PIN));
delay(100);
}
}
Serial1.println(F("Radio OK! Setting up OTAA..."));
// Setup the OTAA session information
state = node.beginOTAA(joinEUI, devEUI, nwkKey, appKey);
if (state != RADIOLIB_ERR_NONE) {
Serial1.print(F("beginOTAA failed: "));
Serial1.println(stateDecode(state));
while (true) { digitalWrite(LED_PIN, !digitalRead(LED_PIN)); delay(200); }
}
Serial1.println(F("Joining LoRaWAN network..."));
state = node.activateOTAA();
if (state != RADIOLIB_LORAWAN_NEW_SESSION) {
Serial1.print(F("Join failed: "));
Serial1.println(stateDecode(state));
while (true) { digitalWrite(LED_PIN, !digitalRead(LED_PIN)); delay(300); }
}
Serial1.println(F("Joined! Ready.\n"));
}
void loop() {
Serial1.println(F("Sending uplink..."));
uint8_t value1 = radio.random(100);
uint16_t value2 = radio.random(2000);
uint8_t uplinkPayload[3];
uplinkPayload[0] = value1;
uplinkPayload[1] = highByte(value2);
uplinkPayload[2] = lowByte(value2);
int16_t state = node.sendReceive(uplinkPayload, sizeof(uplinkPayload));
if (state < RADIOLIB_ERR_NONE) {
Serial1.print(F("sendReceive error: "));
Serial1.println(stateDecode(state));
} else if (state > 0) {
Serial1.println(F("Received a downlink!"));
} else {
Serial1.println(F("Uplink sent, no downlink."));
}
Serial1.print(F("Next uplink in "));
Serial1.print(uplinkIntervalSeconds);
Serial1.println(F(" seconds\n"));
delay(uplinkIntervalSeconds * 1000UL);
}
Adding a data point on the Failed to init device issue from stm32flash / the RTS-DTR auto-bootloader sequence (@SurejSureshLMIC, @olek87, @NeutralSystem's thread above).
On our board (DX-PJ26 + DX-PJ27/DX-LR30), the documented sequence (-i rts,-dtr,dtr:-rts,-dtr,dtr @ 460800 baud, per the manufacturer's mcuisp config) never worked, no matter what we tried — extending RTS settle time up to 5 full seconds, reordering to hold reset before asserting BOOT0, double reset pulses, all four static RTS/DTR level combinations. Root cause turned out to be simpler than a timing issue: DTR does not reset the MCU on this board at all. Confirmed directly — pulsed DTR (including in the exact pattern the sequence uses, with RTS held) while watching a running program's serial output, and it never restarted. No software sequence can enter the bootloader if the reset step it depends on isn't actually happening.
Reliable workaround: hold the board's KEY button, press+release RST once while still holding KEY, then start the upload while continuing to hold KEY until you see execution start. Manual override of whatever the auto-program circuit isn't doing on this revision/batch.
Also confirmed RadioLib doesn't work on this hardware (radio.begin() hangs indefinitely, no timeout) — used a custom SX1262 driver instead and got two boards exchanging LoRa packets successfully.
Activity
fpistm commentedon Jul 25, 2025
Added to #722
olek87 commentedon Oct 17, 2025
you have to set DTR and RTS write to get the board in flash-mode. I made (rather gpt did) a small script for visual studio code. it works dor me, maybe someone finds it useful:
reset.sequence.py:
And this is the correspondning platformio.ini:
[-][New Variant] STM32F103C8T6 with DX- LR30 or DX-LR20[/-][+][New Variant] STM32F103C8T6 with DX-LR30 or DX-LR20[/+]NeutralSystem commentedon Mar 24, 2026
Full working project with these boards [PlatformIO]:
https://github.com/NeutralSystem/STM32_DX-LR20_LORA
SurejSureshLMIC commentedon May 26, 2026
Using DX-LR30
When plugged in I am getting
Windows Device Manager: "Unknown USB Device (Device Descriptor Request Failed)"
g6094199 commentedon May 26, 2026
i think u reply to @NeutralSystem ?
if u have found an bug you should file an issue over there
NeutralSystem commentedon May 26, 2026
Thank you for tagging me @g6094199 .
This i will think, must be a driver issue.
Have you installed the correct drivers to communicate with the board?
to be clear, this is the driver you want: CH341SER [ https://learn.sparkfun.com/tutorials/how-to-install-ch340-drivers/windows-710 ] or, [ https://www.wch-ic.com/downloads/ch341ser_exe.html ]
SurejSureshLMIC commentedon May 26, 2026
I changed to a linux laptop.
DEBUGGING:
STEP 1) took two identical boards
STEP 2) Flashed blink code on SAMPLE A using following platformio.ini
//____________________________________________________________________________
[env:blink_test]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
; No external LoRa libraries - using custom driver in lib/SX1262_Custom
upload_protocol = serial
upload_speed = 115200
monitor_speed = 115200
; Output Intel HEX format for flashing with MCU ISP tools
board_build.mcu = stm32f103c8t6
board_upload.maximum_size = 65536
build_flags =
-D HAL_UART_MODULE_ENABLED
-D ENABLE_HWSERIAL1
upload_flags =
-i
rts,-dtr,dtr:-rts,-dtr,dtr
//___________________________________________________________________
code uploaded sucessfully.
STEP 3) Repeating step for SAMPLE B
//________________________________________________________________________
Auto-detected: /dev/ttyUSB0
Uploading .pio/build/blink_test/firmware.bin
Error probing interface "serial_posix"
Cannot handle device "/dev/ttyUSB0"
stm32flash Arduino_STM32_0.9
Failed to open port: /dev/ttyUSB0
//__________________________________________________________________________
STEP 4) hold down the button while uploading
//__________________________________________________________________________
Auto-detected: /dev/ttyUSB0
Uploading .pio/build/blink_test/firmware.bin
Failed to init device.
stm32flash Arduino_STM32_0.9
http://github.com/rogerclarkmelbourne/arduino_stm32
Using Parser : Raw BINARY
Interface serial_posix: 115200 8E1
*** [upload] Error 1
//__________________________________________________________________________
STEP 5) Hold down the button and release it just before the upload started => Upload Sucessful :)
STEP 6) Plug it back in to see if it appears without holding the buttons. And it Did !!!!!!!!!!!!!!!
Problem Solved!!!!!!!!!!
But the issue still bugged me
So I found the guy who used the board earlier.
enquired about the last code which was uploaded to the board.
Apparently he used Serial.print instead of serial1.print.
Also he had was using the 'SX1262_Custom' from @NeutralSystem and CANbus code from STM32_CAN.
I believe something in that code messed up something. Unfortunately, the code was not available.
Thank you very much guys for the prompt reply.
NeutralSystem commentedon May 27, 2026
Glad it worked for you, good job.
This is my platformio file, with upload flags i figured from the documentation from the supplier of these boards, this just uploads the code to the board without needing to do anything else, ( The same as you ) using platformIO:
[env:genericSTM32F103C8]
platform = ststm32
board = genericSTM32F103C8
framework = arduino
upload_protocol = serial
upload_port = COM5
upload_speed = 115200
monitor_speed = 115200
monitor_port = COM5
; Output Intel HEX format for flashing with MCU ISP tools
board_build.mcu = stm32f103c8t6
board_upload.maximum_size = 65536
build_flags =
-D HAL_UART_MODULE_ENABLED
-D ENABLE_HWSERIAL1
upload_flags =
-i
rts,-dtr,dtr:-rts,-dtr,dtr
g6094199 commentedon May 27, 2026
@NeutralSystem
i´ d like to create a PR for this board to add support. but this is way more complicated (the instructions are not clear in every step and not fully created) than i thought. do we have a chance to work together on this?
NeutralSystem commentedon May 28, 2026
@g6094199
You may use it/do as you wish.
What project were you thinking of? what were you thinking of achieving?
Tamadite commentedon Jul 2, 2026
My successful RadioLib LoRaWAN example called LoRaWAN_Starter from the Arduino IDE but using VSCode for uploading and serial monitoring.
platformio.ini
reset_sequence.py credits to olek87 (see previous posts)
config.h
LoRaWAN_Starter.ino
taufderl commentedon Aug 25, 2026
Adding a data point on the
Failed to init deviceissue from stm32flash / the RTS-DTR auto-bootloader sequence (@SurejSureshLMIC, @olek87, @NeutralSystem's thread above).On our board (DX-PJ26 + DX-PJ27/DX-LR30), the documented sequence (
-i rts,-dtr,dtr:-rts,-dtr,dtr@ 460800 baud, per the manufacturer'smcuispconfig) never worked, no matter what we tried — extending RTS settle time up to 5 full seconds, reordering to hold reset before asserting BOOT0, double reset pulses, all four static RTS/DTR level combinations. Root cause turned out to be simpler than a timing issue: DTR does not reset the MCU on this board at all. Confirmed directly — pulsed DTR (including in the exact pattern the sequence uses, with RTS held) while watching a running program's serial output, and it never restarted. No software sequence can enter the bootloader if the reset step it depends on isn't actually happening.Reliable workaround: hold the board's KEY button, press+release RST once while still holding KEY, then start the upload while continuing to hold KEY until you see execution start. Manual override of whatever the auto-program circuit isn't doing on this revision/batch.
Also confirmed RadioLib doesn't work on this hardware (
radio.begin()hangs indefinitely, no timeout) — used a custom SX1262 driver instead and got two boards exchanging LoRa packets successfully.