RTK Postcard error on upload

I am trying to perform a simple test of the RTK Postcard but receive the following error when trying to upload this sketch:

/*

SparkFun RTK Postcard - Hardware Serial GNSS Test Sketch

This sketch reads raw NMEA sentences from the Quectel LG290P GNSS module

via the ESP32 hardware serial port and forwards them to the USB Serial Monitor.

*/

// Define the HardwareSerial pins mapping to the LG290P module

// Adjust RX/TX pin definitions based on your specific layout if using custom mapping

#define RXD2 16

#define TXD2 17

#define GNSS_BAUD 115200 // LG290P default baud rate

void setup() {

// Initialize the USB Serial Monitor

Serial.begin(115200);

while (!Serial) {

; // Wait for the USB serial port to connect

}

Serial.println(“— SparkFun RTK Postcard Serial Test —”);

// Initialize HardwareSerial 2 connected to the GNSS receiver

Serial2.begin(GNSS_BAUD, SERIAL_8N1, RXD2, TXD2);

Serial.println(“Listening for GNSS data…”);

}

void loop() {

// Pass data from the GNSS module to the USB Serial Monitor

if (Serial2.available()) {

Serial.write(Serial2.read());

}

// Pass data/commands from the USB Serial Monitor back to the GNSS module

if (Serial.available()) {

Serial2.write(Serial.read());

}

}

Sketch uses 282041 bytes (21%) of program storage space. Maximum is 1310720 bytes.
Global variables use 22844 bytes (6%) of dynamic memory, leaving 304836 bytes for local variables. Maximum is 327680 bytes.
esptool v5.2.0
Serial port /dev/cu.usbmodem59320023421:
Connecting…
Connected to ESP32 on /dev/cu.usbmodem59320023421:
Chip type: ESP32-PICO-V3-02 (revision v3.0)
Features: Wi-Fi, BT, Dual Core + LP Core, 240MHz, Embedded Flash, Embedded PSRAM, Vref calibration in eFuse, Coding Scheme None
Crystal frequency: 40MHz
MAC: 64:b7:08:87:ae:6c

Uploading stub flasher…

A fatal error occurred: Failed to write to target RAM (result was 0107: Checksum error)
Failed uploading: uploading error: exit status 2

Even though that uses the ESP32 PICO, the guide says to try using the ESP32 Dev Module as the board selection

If that doesn’t fix it, double-check the usb cable is communicating with other devices (is a known-good data-capable cable); then maybe also try lowering the upload speed to 460800 or 115200 and re-attempt

That is the board selected:

Hi @KMU69 ,

The Postcard uses a CH342 USB - UART interface from WCH. Please check you have the latest macOS driver installed.

Link to search.wch-ic.com

The latest driver for macOS appears to be:

image

I hope this helps,
Paul

@KMU69 ,

The user in this thread was having a similar issue with the CH340 on macOS. He recommends using the standard CH340 driver that comes pre-installed with macOS. But the critical thing is to reduce the upload speed to 460800.

I hope this helps,
Paul

I removed CH341SER_MAC and rebooted the Mac. I have tried all the available upload speeds but always get the same error. Are these other settings correct?

Is there a better sketch that I could use for testing the RTK Postcard? Thanks.

Hi @KMU69 ,

OK. Thank you for the update.

Your issue is not the sketch itself. The esptool upload is failing. We need to work out why that is happening.

Could something else be attempting to access the COM port (/dev/cu.usbmodem59320023421) while the upload is happening?

It is possible to run esptool directly from the command line, without going through the Arduino IDE. Perhaps you could try that?

I hope this helps,
Paul

Nothing else is attempting to access the COM port. Never had this problem with other boards.

Do you have a link that explains how to use the esptool from the command line. Happy to try that. Thanks, as always.

Kevin

Hi Kevin,

I’ll include some links below.

To generate the binary for your own code / sketch, select Sketch \ Export Compiled Binary in the Arduino IDE.

If you are looking at any of the docs.sparkfun.com pages and see this:

please just click Cancel. We are getting that fixed…

Best wishes,
Paul

I’ve installed the esptool but get the same error when running the flash-id command:

Not sure what to do about possibly editing the configuration file as I’ve tried their other suggestions?

@KMU69

Ah! If I have /dev/cu.usbmodem selected, I see the same error as you:

If I have /dev/cu.wchusbserial selected, the upload works just fine:

Looks like it is all down to the port / driver?

That port does not show up as an option for me. Where do I get that driver?

Hooray! I had install that driver before but had not given it permission. Was never prompted for that. Working now. Thanks again for digging into this.

Cheers - Kevin

Looks like I installed it a couple of years ago:

I would have downloaded it from the WCH website. Unfortunately I must have deleted the installer file after I installed it… So I don’t know exactly which one I installed. Sorry about that.

Nice one - congrats!

Used this link to install the driver, give it permission and test it.

Install CH34X driver for Mac and give permission to execute