How do I specify COM port for rp2040load.exe

I'm trying to upload a pre-compiled binary to my Arduino Nano RP2040. I can see that this is accomplished using the rp2040load.exe under the rp2040tools/1.0.6 directory. The tool used like this:
rp2040load.exe -v -D <.elf file>

However, this tool does not take any argument for COM Port, so exactly how does it work. I mean, I guess it could search around pinging COM ports for an RP2040, but what if you have two or more attached? Am I barking up the wrong tree with this tool? Or is there another file/tool I need to be running first?

Any help in how to upload pre-compiled binaries to an Arduino RP2040 would be much appreciated!

I don't have any experience, however have you tried / can you ask the program?

Something like rp2040load.exe -h or ? or -? etc

I did. You can do rp2040load.exe -h and it tells you this:

Usage of C:\Users\jmdod\AppData\Local\Arduino15\packages\arduino\tools\rp2040tools\1.0.6\rp2040load.exe:
-D string
Path of the elf file to load
-v Show verbose logging
-y Verify flash after upload

Its very strange. The verbose output of Arduino IDE does not show any additional mention of COM port or any other tool being run which indicates a port. Although there is a vague mention of:

Performing 1200-bps touch reset on serial port COM5

right before it runs rp2040load.exe. So, my latest theory is that you have to put the part into some sort of reset mode, and then the rp2040load.exe tool must look for the reset device on all the COM ports. But, its not clear how this is actually done, since it occurs before running rp2040load.exe.

I just verified that I am correct. The rp2040load.exe works if I manually put the Arduino RP2040 in bootloader mode (double-tap the reset). So, now I need to figure out how I can place the device in bootloader mode remotely through the USB port.

Hi @jmdodd95682.

Before running the rp2040load command, Arduino IDE momentarily opens the serial port of the Nano RP2040 Connect board at 1200 baud (this is referred to as the "1200 bps touch).

There isn't anything special about the way Arduino IDE does this. You can use any other method to produce this "touch". You only need to open the port configured at 1200 baud. You can even use the Arduino IDE Serial Monitor to try it out (I understand Serial Monitor is not a suitable tool for producing the "touch" your actual application).

There is code in the "Arduino Mbed OS Nano Boards" core that runs in the background of your sketch program and recognizes this "1200 bps touch" as a special signal that the board should be put into the USB mass storage device mode where it presents itself to the computer as a flash drive to which the new program binary UF2 file can be copied to complete the upload.

Awesome! That's very subtle. I'll try that. Thanks!

That worked! Thank you for the help.

I wrote a simple python script below that performs it for anyone who wants a quick method:

import serial

comport="COM5"
ser = serial.Serial(comport, 1200, timeout=5)
ser.close()

The trick is the close(). Simply opening the serial port was not enough to cause it to reset to Bootloader mode. I had to close the serial connection.

You are welcome. I'm glad you were able to find a solution for putting the board into the USB mass storage mode. Thanks for taking the time to share you findings!

Regards,
Per

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