2 RAK4630 modules were used as LoRA Point To Point Transmitter and reciever , the code is modified from the RAK example folder. During code flashing with the USB to USB-C cable provided,
the below described error ocuured, from this point onwards i had not been able to flash the modules.another observation is the Com Port is unable to open and Upload button in Arduino IDE seems to be stuck.
The first message that popped up Arduino Log is this
Forcing reset using 1200bps open/close on port COM21
After reconnection, this message occurs.
Sketch uses 67696 bytes (8%) of program storage space. Maximum is 815104 bytes.
Global variables use 9352 bytes (3%) of dynamic memory, leaving 228216 bytes for local variables. Maximum is 237568 bytes.
Forcing reset using 1200bps open/close on port COM21
PORTS {COM21, } / {} => {}
PORTS {} / {} => {}
PORTS {} / {} => {}
PORTS {} / {COM21, } => {COM21, }
Found upload port: COM21
C:\Users\rajee\AppData\Local\Arduino15\packages\rakwireless\hardware\nrf52\1.3.3/tools/adafruit-nrfutil/win32/adafruit-nrfutil.exe --verbose dfu serial -pkg C:\Users\rajee\AppData\Local\Temp\arduino_build_456850/LoRaP2P_TX_only.ino.zip -p COM21 -b 115200 --singlebank
Upgrading target on COM21 with DFU package C:\Users\rajee\AppData\Local\Temp\arduino_build_456850\LoRaP2P_TX_only.ino.zip. Flow control is disabled, Single bank, Touch disabled
Opened serial port COM21
Starting DFU upgrade of type 4, SoftDevice size: 0, bootloader size: 0, application size: 67704
Sending DFU start packet
Timed out waiting for acknowledgement from device.
Sending DFU init packet
Failed to upgrade target. Error is: Attempting to use a port that is not open
Traceback (most recent call last):
File "__main__.py", line 296, in serial
File "dfu\dfu.py", line 235, in dfu_send_images
File "dfu\dfu.py", line 203, in _dfu_send_image
File "dfu\dfu_transport_serial.py", line 155, in send_init_packet
File "dfu\dfu_transport_serial.py", line 241, in send_packet
File "serial\serialwin32.py", line 306, in write
serial.serialutil.PortNotOpenError: Attempting to use a port that is not open
Sometimes Arduino IDE gets stuck with port not available error. Sometimes I can simply hit Upload again and it works.
Make sure you have selected the correct port in Arduino IDE → Tools → Port and then choose the Get Board Info to make sure you successfully communicate with the board and get Serial Number etc.
Otherwise you should put the RAK4630 into DFU mode and try again:
Quickly double-tap the reset button on RAK baseboard while the unit is already connected to USB port.
The green light should begin throbbing (slow fade in/out)
You should see a Windows Explorer window open for the RAK and it will be detected as a new device.
Go back to Arduino and browse Tools → Port and select the active port (it will be different from your usual port since the unit appears as other hardware)
Re-upload the Arduino sketch.
DFU mode has always rescued me in such issues.
NOTE if you have a RUI version of the RAK4630 it does not include the double-click DFU mode. But you specifically said you’re using the Arduino version so you should be OK. Otherwise, to convert RAK4631/4630-R (RUI) to RAK4631/4630 (Arduino) you can see here and here.
Did this, and one of My RAK 4630 was made working again, but my second module is still not falling into DFU Mode. The RED led is turned on always, and Blue/Green Light is never turned ON.
My PC’s Device manager is able to detect the device connected to port.
I Used WisBlock-WisToolBox and updated the firmware and reset my board. Still not able to Upload Arduino code. Is there a way to somehow factory reset the device. Any help would be great.
I’m wondering if it would then be necessary to re-flash the Arduino BSP to the board (see here). @beegee would be a better resource to answer that. I think a serial debug/flash tool is needed to do this (see here).
As I previously stated, I have never borked a RAK4631 so badly that it was unrecoverable in DFU mode by double-tapping the button.
Another idea: try swapping the non-working 4631 over to a baseboard that is known working, just in case there’s a problem with the baseboard. If you have a newer 19007 baseboard (USB-C) you may try that as well. Also try a different USB port and cable.
The RAK4630 has RUI3 firmware by default. Can you please confirm if you are following this guide? I am thinking that you are using Arduino BSP and not RUI3. Or maybe mixed both approaches?
Did this and changed it to to RAK4631/4630 (Arduino). Now the green light is turned on. still while flashing, i am getting this error.(attached in the image)
After changing to Arduino BSP, when the device is plugged in immediately after the red light the green light slowly blinks and it falls to bootmode(I could see the board in my file explorer(RAK4631D))
I have changed the RAK4630 base board. still no change in behaviour. I am required to develop LoRa communication , So i need both the boards. Is there a way to hard reset and start fresh? what are my options.
What do you mean “both boards”? The RAK4630 and RAK4631 are the same board. 4630 is the solderable bare module, and 4631 is the module on a carrier board that can easily be plugged into the RAK baseboards (such as RAK19007). Make sure you have the most up-to-date BSP in Arduino.
There is no option to select RAK4630 from the Boards menu:
I think the way to confirm flash is to write values to all memory locations, then read them to confirm matching.
Does your program write to flash memory? The flash is rated to 10,000 erase cycles so if you are writing a lot of data into the flash from within your program, it could easily wear out some cells…