WISBlock RAK4630 - Broken Pipe

Hello! I am attempting to upload a sketch to the wisblocks RAK4630 and I am getting an error in the arduino ide:

Library Adafruit_nRFCrypto has been declared precompiled:
Using precompiled library in /home/kevin/Arduino/libraries/Adafruit_nRFCrypto/src/cortex-m4/fpv4-sp-d16-hard
Sketch uses 106692 bytes (13%) of program storage space. Maximum is 815104 bytes.
Global variables use 9116 bytes (3%) of dynamic memory, leaving 228452 bytes for local variables. Maximum is 237568 bytes.
Upgrading target on /dev/ttyACM0 with DFU package /tmp/arduino_build_28215/RAK14000-QR-Code.ino.zip. Flow control is disabled, Single bank, Touch disabled


Failed to upgrade target. Error is: [Errno 32] Broken pipe
Traceback (most recent call last):
  File "/usr/local/lib/python3.10/dist-packages/nordicsemi/__main__.py", line 296, in serial
    dfu.dfu_send_images()
  File "/usr/local/lib/python3.10/dist-packages/nordicsemi/dfu/dfu.py", line 235, in dfu_send_images
    self._dfu_send_image(HexType.APPLICATION, self.manifest.application)
  File "/usr/local/lib/python3.10/dist-packages/nordicsemi/dfu/dfu.py", line 157, in _dfu_send_image
    self.dfu_transport.open()
  File "/usr/local/lib/python3.10/dist-packages/nordicsemi/dfu/dfu_transport_serial.py", line 124, in open
    self.serial_port.setDTR(False)
  File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 603, in setDTR
    self.dtr = value
  File "/usr/lib/python3/dist-packages/serial/serialutil.py", line 473, in dtr
    self._update_dtr_state()
  File "/usr/lib/python3/dist-packages/serial/serialposix.py", line 715, in _update_dtr_state
    fcntl.ioctl(self.fd, TIOCMBIC, TIOCM_DTR_str)
BrokenPipeError: [Errno 32] Broken pipe

Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
    Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.

I haven’t found anything online about solving this error. Any ideas before I start to try the DFU mode thing?

You are on Linux or MacOS?

Failed to upgrade target. Error is: [Errno 32] Broken pipe

smells a lot like a python problem.

@carlrowan @marcio any ideas?

The code RAK14000-QR-Code compiles without problems on Windows and can be flashed.

I’m sorry, I should have mentioned that, I am running Linux Specifically Ubuntu 20.04
The compilation goes well, It is just the upload that seems to have a problem. I tried with a few different USB cables thinking it maybe that, but it wasn’t.

I Should also mention that I AM able to send AT commands via Serial Monitor

Hi @Kevin192291 ,

Is the port selected correct? Does basic sketch like LED blinking works? How about basic serial like Serial.println("hello_world");? Does these basic sketch can be compiled and upload successfully? Or with same error?

I am just guessing possibilities here. I have limited exposure to linux.

I have been changing some things, I am not sure if things are getting worse, I tried an empty sketch and now get:

/home/kevin/.arduino15/packages/rakwireless/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: core/core.a(main.cpp.o): in function `loop_task(void*)':
/home/kevin/.arduino15/packages/rakwireless/hardware/nrf52/1.3.0/cores/nRF5/main.cpp:57: undefined reference to `Adafruit_USBD_CDC::operator bool()'
/home/kevin/.arduino15/packages/rakwireless/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /home/kevin/.arduino15/packages/rakwireless/hardware/nrf52/1.3.0/cores/nRF5/main.cpp:57: undefined reference to `Adafruit_USBD_CDC::begin(unsigned long)'
/home/kevin/.arduino15/packages/rakwireless/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /home/kevin/.arduino15/packages/rakwireless/hardware/nrf52/1.3.0/cores/nRF5/main.cpp:57: undefined reference to `Serial'
/home/kevin/.arduino15/packages/rakwireless/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: core/core.a(Uart.cpp.o): in function `serialEventRun()':
/home/kevin/.arduino15/packages/rakwireless/hardware/nrf52/1.3.0/cores/nRF5/Uart.cpp:27: undefined reference to `Adafruit_USBD_CDC::available()'
/home/kevin/.arduino15/packages/rakwireless/tools/arm-none-eabi-gcc/9-2019q4/bin/../lib/gcc/arm-none-eabi/9.2.1/../../../../arm-none-eabi/bin/ld: /home/kevin/.arduino15/packages/rakwireless/hardware/nrf52/1.3.0/cores/nRF5/Uart.cpp:30: undefined reference to `Serial'
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board WisBlock RAK4631.

I am wondering though, The RED light on the RAK5005-0 V1.0 is flickering, is the supposed to be doing that???

I attempt to do this step:

I get a Blue flashing light, along with a green one, and the Red one says solid at this point. But then the same failure error message is displayed:

adafruit-nrfutil --verbose dfu serial --package WisCore_RAK4631_Board_Bootloader.zip -p /dev/ttyACM0 -b 115200 --singlebank --touch 1200
Upgrading target on /dev/ttyACM0 with DFU package /home/kevin/Downloads/WisCore_RAK4631_Board_Bootloader.zip. Flow control is disabled, Single bank, Touch 1200
Touched serial port /dev/ttyACM0
Opened serial port /dev/ttyACM0
Starting DFU upgrade of type 3, SoftDevice size: 151016, bootloader size: 39000, application size: 0
Sending DFU start packet
Timed out waiting for acknowledgement from device.

Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.
Traceback (most recent call last):
  File "/home/kevin/.local/lib/python3.10/site-packages/nordicsemi/__main__.py", line 296, in serial
    dfu.dfu_send_images()
  File "/home/kevin/.local/lib/python3.10/site-packages/nordicsemi/dfu/dfu.py", line 226, in dfu_send_images
    self._dfu_send_image(HexType.SD_BL, self.manifest.softdevice_bootloader)
  File "/home/kevin/.local/lib/python3.10/site-packages/nordicsemi/dfu/dfu.py", line 199, in _dfu_send_image
    self.dfu_transport.send_start_dfu(program_mode, softdevice_size, bootloader_size,
  File "/home/kevin/.local/lib/python3.10/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 179, in send_start_dfu
    self.send_packet(packet)
  File "/home/kevin/.local/lib/python3.10/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 243, in send_packet
    ack = self.get_ack_nr()
  File "/home/kevin/.local/lib/python3.10/site-packages/nordicsemi/dfu/dfu_transport_serial.py", line 282, in get_ack_nr
    raise NordicSemiException("No data received on serial port. Not able to proceed.")
nordicsemi.exceptions.NordicSemiException: No data received on serial port. Not able to proceed.

Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
    Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.

Try to add

#include <Adafruit_TinyUSB.h>

to the sketch. But that is a different problem.

Hello @beegee i do have the same problem! I’m running on MacOS!

Upgrading target on /dev/cu.usbmodemFBC1032D13741 with DFU package /private/var/folders/jg/6jtd_6f11qx63y7132zzym7w0000gn/T/arduino_build_627161/RAK1901_Temperature_Humidity_SHTC3.ino.zip. Flow control is disabled, Single bank, Touch disabled
Timed out waiting for acknowledgement from device.

Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.
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 199, in _dfu_send_image
  File "dfu/dfu_transport_serial.py", line 179, in send_start_dfu
  File "dfu/dfu_transport_serial.py", line 243, in send_packet
  File "dfu/dfu_transport_serial.py", line 282, in get_ack_nr
nordicsemi.exceptions.NordicSemiException: No data received on serial port. Not able to proceed.

Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
    Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.

I used both Bootloaders: J-Link or DFU. Trying to charge the bootloaders the DFU says

Usage: adafruit-nrfutil dfu serial [OPTIONS]
Try 'adafruit-nrfutil dfu serial --help' for help.

Error: Invalid value for '-pkg' / '--package': File '/Users/marcpous/Library/Arduino15/packages/rakwireless/hardware/nrf52/1.3.1/bootloader/WisCore_RAK4631_Board/WisCore_RAK4631_Board_bootloader-0.6.2_s140_6.1.1.zip' does not exist.
Error al carrega el bootloader.

Any guidance please?

Welcome to the forum @mpous

I have no access to a MacOS machine, so I am not sure what happens.

A few questions

  • Is your device detected by your computer when you plug it into the USB port?

  • Which BSP are you using? The Open Source version RAK-nRF52-Arduino or our RUI3 BSP?

  • What is your current bootloader?

    • Open Source bootloader version shows an external drive when you double click reset button, RUI3 bootloader does not have reset double click function

Depending on the BSP you want to use, the correct bootloader must be flashed first. In our documentation we have a guide how to change bootloaders
Updating the bootloader with the ArduinoIDE does not work. You have to do it manually as shown in the guide.

Thanks @beegee for your answer!

Yes! the Arduino IDE detects it on /dev/cu.usbmodemFBC1032D13741

I’m using RAKwireless nRF Boards. Let me try to install RUI3 BSP as well.

i’m trying to update manually the bootloader and i get the same error:


[email protected] Downloads % ./adafruit-nrfutil-macos --verbose dfu serial --package rui3_nrf52840_bootloader_latest.zip -p /dev/cu.usbmodemFBC1032D13741 -b 115200 --singlebank --touch 1200
Upgrading target on /dev/cu.usbmodemFBC1032D13741 with DFU package /Users/marcpous/Downloads/rui3_nrf52840_bootloader_latest.zip. Flow control is disabled, Single bank, Touch 1200
Touched serial port /dev/cu.usbmodemFBC1032D13741
Opened serial port /dev/cu.usbmodemFBC1032D13741
Starting DFU upgrade of type 2, SoftDevice size: 0, bootloader size: 36184, application size: 0
Sending DFU start packet
Timed out waiting for acknowledgement from device.

Failed to upgrade target. Error is: No data received on serial port. Not able to proceed.
Traceback (most recent call last):
  File "nordicsemi/__main__.py", line 294, in serial
  File "nordicsemi/dfu/dfu.py", line 232, in dfu_send_images
  File "nordicsemi/dfu/dfu.py", line 200, in _dfu_send_image
  File "nordicsemi/dfu/dfu_transport_serial.py", line 179, in send_start_dfu
  File "nordicsemi/dfu/dfu_transport_serial.py", line 243, in send_packet
  File "nordicsemi/dfu/dfu_transport_serial.py", line 282, in get_ack_nr
nordicsemi.exceptions.NordicSemiException: No data received on serial port. Not able to proceed.

Possible causes:
- Selected Bootloader version does not match the one on Bluefruit device.
    Please upgrade the Bootloader or select correct version in Tools->Bootloader.
- Baud rate must be 115200, Flow control must be off.
- Target is not in DFU mode. Ground DFU pin and RESET and release both to enter DFU mode.

ok! my fault @beegee it looks like i didn’t had RAKwireless RUI3 version BSP installed properly!

Now it works great!

Thanks for your support :slight_smile:

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