Omirion Docs

Firmware Upgrade

Quectel RM520N-GL Firmware Update Guide

Complete guide for updating the Quectel RM520N-GL modem firmware using QFirehose on Linux.


Table of Contents


Prerequisites

Hardware Requirements

  • Quectel RM520N-GL modem (connected via USB)
  • Stable power supply (DO NOT disconnect during update)
  • USB 3.0 port (recommended for faster transfer)

Software Requirements

  • Linux system (Ubuntu/Debian recommended)
  • QFirehose tool (version 1.5.1 or higher)
  • ModemManager installed
  • Root/sudo access

Required Packages

sudo apt-get install modemmanager libqmi-utils usbutils

Preparation

1. Download Firmware Package

Obtain the official firmware package from Quectel:

  • Format: RM520NGLAAR03A03M4G_XX.XXX.XX.XXX.zip
  • Verify file integrity (check MD5 if provided)

2. Verify Current Firmware Version

# List available modems
mmcli -L

# Check current firmware version
mmcli -m 0 | grep "firmware revision"

Example output:

firmware revision: RM520NGLAAR03A03M4G

3. Identify Modem Ports

# Check USB connection
lsusb | grep Quectel

# List serial ports
ls -la /dev/ttyUSB*

# Check modem ports
mmcli -m 0 | grep ports

Typical port mapping for RM520N-GL:

  • ttyUSB0: Diagnose port (for firmware update)
  • ttyUSB1: GPS NMEA
  • ttyUSB2: AT command port
  • ttyUSB3: AT command port
  • cdc-wdm0: QMI interface
  • wwan0: Network interface

Update Process

Step 1: Stop ModemManager

CRITICAL: ModemManager must be stopped before firmware update to prevent port conflicts.

# Stop the service
sudo systemctl stop ModemManager

# Verify it's stopped
systemctl status ModemManager | grep Active:
# Should show: Active: inactive (dead)

Step 2: Extract Firmware Package

cd ~/RM520N-GL/Toolz/tool-driver/out

# Extract firmware to avoid permission issues
mkdir -p firmware_extract

unzip -o RM520NGLAAR03A03M4G_A0.301.A0.301.zip -d firmware_extract/

# Verify extraction
ls -la firmware_extract/update/

Step 3: Fix USB Device Permissions

# Find the USB device
lsusb | grep Quectel
# Example output: Bus 002 Device 006: ID 2c7c:0801

# Fix permissions (replace 002/006 with your values)
sudo chmod 666 /dev/bus/usb/002/006

Step 4: Run QFirehose

cd ~/RM520N-GL/Toolz/tool-driver/out

# Run firmware update
sudo ./QFirehose -f firmware_extract

What happens:

  1. MD5 integrity check (29 files)
  2. Switches modem to Emergency Download Mode (EDL/QDL)
  3. Sahara protocol handshake
  4. Firehose protocol flash process
  5. Automatic modem reboot

Step 5: Monitor Progress

The update takes 3-5 minutes. You'll see:

[000.000]: Totals checking 29 files md5 value, 0 file fail!
[002.630]: switch to 'Emergency download mode'
[004.702]: Successfully flash all images
[004.702]: Sahara protocol completed
...
[XXX.XXX]: <response value=ACK />

DO NOT:

  • Disconnect USB cable
  • Power off the device
  • Interrupt the process
  • Press Ctrl+C

Step 6: Wait for Completion

Successful completion indicators:

<log value=Upgrade module successful! />
<log value=Total Time Taken: XX.XXX seconds />

The modem will automatically reboot to normal mode.


Verification

1. Wait for Modem Reboot

# Monitor USB reconnection
watch -n 1 'lsusb | grep Quectel'

# Wait for normal mode (2c7c:0801)
# NOT QDL mode (05c6:9008)

2. Restart ModemManager

sudo systemctl start ModemManager

# Wait for modem detection (10-15 seconds)
sleep 15

# List modems
mmcli -L

3. Verify New Firmware

# Check firmware version
mmcli -m 0 | grep firmware revision

# Check modem state
mmcli -m 0 | grep state
# Should show: state: disabled or searching

4. Test Basic Functionality

# Check SIM detection
mmcli -m 0 | grep -i sim

# Check network interfaces
ip link show wwan0

# Enable modem (if disabled)
sudo mmcli -m 0 -e

Troubleshooting

Issue 1: Permission Denied Errors

Symptoms:

fail to open /dev/bus/usb/002/006, errno: 13 (Permission denied)

Solution:

# Find your USB bus/device numbers

lsusb | grep Quectel
# Example: Bus 002 Device 006

# Fix permissions
sudo chmod 666 /dev/bus/usb/002/006

# Verify permissions
ls -la /dev/bus/usb/002/006
# Should show: crw-rw-rw-

Permanent fix (optional): Create udev rule:

sudo nano /etc/udev/rules.d/99-quectel-modem.rules

Add:

# Quectel RM520N-GL
SUBSYSTEM==usb, ATTR{idVendor}==2c7c, ATTR{idProduct}==0801, MODE=0666
SUBSYSTEM==usb, ATTR{idVendor}==05c6, ATTR{idProduct}==9008, MODE=0666

Reload:

sudo udevadm control --reload-rules
sudo udevadm trigger

Issue 2: Port Not Found

Symptoms:

fail to access /dev/ttyUSB0, errno: 2 (No such file or directory)

Solution:

# Check if ModemManager is stopped
systemctl status ModemManager

sudo systemctl stop ModemManager

# Check available ports
ls -la /dev/ttyUSB*

# Use auto-detect (omit -p flag)
sudo ./QFirehose -f firmware_extract

Issue 3: Modem Stuck in QDL Mode

Symptoms:

lsusb | grep 05c6:9008
# Qualcomm Gobi Wireless Modem (QDL mode)

Solution:

Option 1: Physical reset

# Unplug USB cable
# Wait 5 seconds
# Replug USB cable

Option 2: System reboot

sudo reboot

After reboot, verify normal mode:

lsusb | grep 2c7c:0801  # Should show RM520N-GL

Issue 4: Sahara Protocol Timeout

Symptoms:

SAHARA_CMD_UNKNOWN_XXXXXXXX
# Process hangs/freezes

Causes:

  1. Wrong firmware package for your modem variant
  2. Corrupted firmware files
  3. USB connection issues
  4. Modem already in QDL mode from failed attempt

Solution:

# 1. Kill stuck process
sudo killall QFirehose

# 2. Reset modem (unplug/replug USB)

# 3. Wait for normal mode
lsusb | grep 2c7c:0801

# 4. Re-extract firmware
rm -rf firmware_extract

unzip -o RM520NGLAAR03A03M4G_A0.301.A0.301.zip -d firmware_extract/

# 5. Verify MD5 checksums
cat firmware_extract/md5.txt

# 6. Retry update
sudo ./QFirehose -f firmware_extract

Issue 5: MD5 Check Failed

Symptoms:

md5 checking: firmware_extract/update/xxx.elf FAIL

Totals checking 29 files md5 value, X file fail!

Solution:

# Re-download firmware package (file may be corrupted)
# Or skip MD5 check (NOT recommended):
sudo ./QFirehose -f firmware_extract -n

Issue 6: Modem Not Detected After Update

Symptoms:

mmcli -L
# No modems were found

Solution:

# 1. Check USB connection
lsusb | grep -E '2c7c|05c6'

# 2. Restart ModemManager
sudo systemctl restart ModemManager

# 3. Wait longer (up to 30 seconds)
sleep 30

mmcli -L

# 4. Check kernel logs
dmesg | tail -50

# 5. Check ModemManager logs
journalctl -u ModemManager -n 50 --no-pager

# 6. Last resort: reboot
sudo reboot

Issue 7: Cannot create zip_process_info.txt

Symptoms:

sh: 1: cannot create /tmp/zip_process_info.txt: Permission denied

Solution:

Use extracted firmware directory instead of zip:

# Extract first
unzip -o RM520NGLAAR03A03M4G_A0.301.A0.301.zip -d firmware_extract/

# Use directory, not zip file
sudo ./QFirehose -f firmware_extract

Issue 8: Update Appears Stuck

Symptoms:

  • No output for several minutes
  • Process seems frozen

What's Normal:

  • Some partitions take 30-60 seconds
  • Large partitions (NON-HLOS.ubi, sdxlemur-sysfs.ubi) can take 1-2 minutes
  • Total update time: 3-5 minutes

When to Worry:

  • No progress for > 5 minutes
  • No new log messages for > 2 minutes

Solution:

# DON'T interrupt immediately!
# Wait at least 5 minutes

# If truly stuck (> 10 minutes no activity):
# 1. Check if process is running
ps aux | grep QFirehose

# 2. Check USB connection

lsusb | grep -E '2c7c|05c6'

# 3. If USB disconnected, update failed
# If USB still connected, wait more

# Only as last resort after 15+ minutes:
sudo killall QFirehose
# Then unplug/replug modem and retry

Rollback

If update fails or causes issues, you can flash the previous firmware version.

# 1. Obtain previous firmware package
# Example: RM520NGLAAR03A03M4G_OLD_VERSION.zip

# 2. Stop ModemManager
sudo systemctl stop ModemManager

# 3. Extract old firmware
mkdir -p firmware_old
unzip -o RM520NGLAAR03A03M4G_OLD_VERSION.zip -d firmware_old/

# 4. Flash old firmware
sudo ./QFirehose -f firmware_old

# 5. Verify rollback
sudo systemctl start ModemManager

sleep 15

mmcli -m 0 | grep firmware revision

Best Practices

Before Update

  • Backup important modem configurations
  • Document current firmware version
  • Verify firmware package is for your modem variant
  • Ensure stable power supply
  • Close all applications using the modem

During Update

  • Never disconnect USB cable
  • Never power off device
  • Never interrupt QFirehose process
  • Monitor progress but don't interfere
  • Be patient - takes 3-5 minutes

After Update

  • Wait for automatic modem reboot
  • Verify firmware version changed
  • Test basic functionality (SIM, network)
  • Document update date and version

Common Command Reference

Modem Information

# List all modems
mmcli -L

# Full modem info
mmcli -m 0

# Firmware version only
mmcli -m 0 | grep firmware revision

# Modem state
mmcli -m 0 | grep state

# SIM info
mmcli -m 0 | grep -i sim

USB Diagnostics

# List USB devices
lsusb

# Detailed USB info
lsusb -v -d 2c7c:0801

# USB device tree
lsusb -t

# Check kernel recognition
dmesg | grep -i quectel

Port Information

# List serial ports
ls -la /dev/ttyUSB*

# QMI interface
ls -la /dev/cdc-wdm*

# Network interface
ip link show wwan0

Service Management

# Stop ModemManager
sudo systemctl stop ModemManager

# Start ModemManager
sudo systemctl start ModemManager

# Restart ModemManager
sudo systemctl restart ModemManager

# Check status
systemctl status ModemManager

Safety Warnings

⚠️ CRITICAL WARNINGS:

  1. Power Loss: Never lose power during update - can brick the modem
  2. Wrong Firmware: Only use firmware for RM520N-GL variant
  3. USB Disconnection: Never disconnect USB during update
  4. Interruption: Do not kill QFirehose process unless completely frozen (> 15 min)

🔒 Recovery Options:

If modem becomes bricked:

  • Contact Quectel technical support
  • May require JTAG recovery (professional service)
  • Warranty may be voided if using unofficial firmware

Version History

DateVersionChanges
2025-10-311.0Initial documentation

Additional Resources


License

This documentation is provided as is without warranty. Use at your own risk. Always follow official Quectel documentation and procedures.


Last Updated: 2025-10-31 For: Quectel RM520N-GL Modem Tool: QFirehose Linux v1.5.1

On this page