GPS Rollover MC7304

We have over 100 MC7304 modems out in the field affected by the GPS rollover. The modems are installed on systems running FreeBSD, but I can only find linux and Windows tools on the website for the patch.

Only GPS dates seem to be affected at the moment and luckily we can access the modems remotely, including having AT access to them.

Do you support other OSes? Any idea on whether we can patch the modems remotely on FreeBSD? Does the MC7304 support OTA updates and will that help with the problem we have right now?

Usually Linux files can be run on freeBSD. Please give it a try as below:

Applications, but surely not drivers? The Linux QMI SDK depends on GobiNet and GobiSerial.

I would have used whatever serial driver exists in FreeBSD, made sure it could bind to the QDL function on “boot and hold” mode, switched to this mode using the AT!BOOTHOLD command, and then used the simplest possible uploader code to push the file to the modem.

Building this on FreeBSD should not require too many changes:

Note that this code is very hackish, and is not really used by libqmi anywhere. It’s just in the repo for historical reasons. But the code is simple, and should work with a little hand holding from someone knowing FreeBSD.

Thanks a load Bjørn.

I got the swi-update working in FreeBSD and successfully flashed the modem.

Changes made to the code for anyone interested:

  • Include sys/endian.h instead of endian.h
  • Add a type alias for __u8 to point to u_int8_t
  • Add a type alias for __u16 to point to u_int16_t
  • Add a type alias for __u32 to point to u_int32_t
  • Do not include linux/types.h and malloc.h

Once again, thanks Bjørn.

Hello Abdulwahid,

I have also compiled swi-update.c
Can you explain the arguments to launch it, do you have an example? Because i tried:

root@Cell_Router:/home/swi-update# ./a.out --help
swi-update (unknown)
usage: ./a.out [ --help ]–serial [image2] [image3]

root@Cell_Router:/home/swi-update# ./a.out --serial 1199:68c0 ./MC73xx_GPS_Rollover_2019_NVU.nvu
swi-update (unknown)


You need to run the update in two steps, as Bjørn detailed above:

  • Set the modem to "boot and hold"mode
  • Flash the modem using swi-update

The modem exposes 6 ports, and these should be mapped to files on the /dev/ path as cuaUx.0 - cuaUx.5. The AT command port is the 3rd one, so cuaUx.2. Replace the x with your device number.

You can set the modem to “boot and hold” mode by connecting to the AT port via a utility such as cu or minicom and issuing the AT!BOOTHOLD instruction. Easiest way is simply:

printf "AT\!BOOTHOLD\r\n" > /dev/cuaUx.2

This will reboot the modem exposing only one port. So instead of cuaUx.0 to cuaUx.5 in /dev, you’ll have one file, cuaUx. This is the file you need to pass to swi-update.

Using your example, call swi-update as follows:

./a.out --serial /dev/cuaUx MC73xx_GPS_Rollover_2019_NVU.nvu

Thank you very much Abdulwahid,

as I have suceessfully made the 2 steps you said for my OpenWRT OS, according to this log :

root@Cell_Router:~# printf “AT!BOOTHOLD\r\n” > /dev/ttyUSB2
–> I have got the good reply “AT!BOOTHOLD” on the ttyUSB2 port.

root@Cell_Router:/home/swi-update# ./a.out --serial /dev/ttyUSB2 ./MC73xx_GPS_Rollover_2019_NVU.nvu
swi-update (unknown)
Got QDL version: 4
Downloading CWE image ‘./MC73xx_GPS_Rollover_2019_NVU.nvu’
CWE revision: 3
type: SPKG
product: 9X15
image size: 2228
version: INTERNAL_9901234_MC7355_00.00.00.00_00_GPS2019_001.099_000
date: 09/21/18

Waiting for ack
Terminating session - rebooting modem…

Then modem has well rebooted : I have recovered the 4G, Longitude, Latitude and Altitude, they are still OK.

But the original problem of GPRMC date is still here, nothing changed, as today I am still on the 07/04/2000:

I have tried on 2 samples of MC7304 , and the result is the same. I tried yesterday and today.
Anybody knows what’s wrong ?


PS : before this month November 2019, the GPRMC date was working well, and was according to Wikipedia :

For example last month in october 2019 I got the good datagram for october 13rd:

And below is detail of the full datagram of today, with the GPRMC date issue remaining:

root@Cell_Router:/dev# cat < /dev/ttyUSB1

I suspect you got the wrong device specified. When the modem reboots after AT!BOOTHOLD, you’ll only get one port. So even though the swi-update says success, it’s not really uploaded the firmware to the modem.

Could you send me a screenshot of the files in \dev before and after you issue the boot hold?

You are right, I have tried again, and now it works!!!

For reference on OpenWRT OS :
Right, when I made printf “AT!BOOTHOLD\r\n” > /dev/ttyUSB2, during the reset of MC7304 I have lost ttyUSB0,1 and 2; then only ttyUSB0 woke up :
root@GL_OWRT:/dev# ls
(…) ttyUSB0

Also on port ttyUSB2, just before reset I got a nice answer “OK” as below :

And after I have launched in 1 command line :
./a.out --serial /dev/ttyUSB0 ./MC73xx_GPS_Rollover_2019_NVU.nvu
swi-update (unknown)
Got QDL version: 6
Downloading CWE image ‘./MC73xx_GPS_Rollover_2019_NVU.nvu’
CWE revision: 3
type: SPKG
product: 9X15
image size: 2228
version: INTERNAL_9901234_MC7355_00.00.00.00_00_GPS2019_001.099_000
date: 09/21/18
Waiting for ack
Terminating session - rebooting modem…

and then it works, see below result :
now I am in 22/11/2019.

So I advise to be careful when swi-update.c returns “Success!”, this is not the way to make sure that the patch has applied. Anyway, it works.

Have a nice week end, and many thanks again

Good to know it worked for you.

But I would not recommend using swi-update as a generic solution though, It’s a hack with almost no error handling etc, as you’ve discovered. You should use either the Sierra toolkit on the platforms where it is supported or the qmi-firmware-update from libqmi on Linux. FreeBSD is special since I don’t think it is covered by either, which is why I pointed to swi-update.

FYI: I wrote swi-update primarily for my own use, and never got around to clean and fix it up properly. But Aleksander did all the boring and hard work to make something useful out of it. That’s qmi-firmware-update . Which does work fine on OpenWrt and any other Linux system, and has a lot of fixes, proper error handling, firehose (EM7565 etc) support, and much more.

It is probably possible to make qmi-firmware-update work on other Unix systems too, by disabling some of the Linux specific stuff. But I assume it will be a bit more work, and not just a quick fix.