Successfully updated to DM42 3.1 with dfu-utils on LINUX

Discussion around the SwissMicros DM42 calculator
Post Reply
mcc
Posts: 277
Joined: Fri Jun 23, 2017 5:10 am

Successfully updated to DM42 3.1 with dfu-utils on LINUX

Post by mcc »

Hi,

I successfully updated my DM42 to firmware version 3.1 and wanted to describe, what I did so may be it help others to do the same.

Hardware:
PC
DM42
a standard USB cable

Software:
GENTOO Linux
Linux kernel 4.14.10
dfu-util 0.9
DM42_flash_3.1.bin
vim (editor)

1.) DONT PANIC!
2.) The User Manual (https://www.swissmicros.com/dm42/doc/dm42_user_manual/) describes an udev-rule, which
needs to be added to the udev ruleset already installed under /etc/udev/rules.d/.
See chapter "Firmware Update Using dm_tool"=>"Prerequisites in Linux".
3.) Use the tool "dm" to inform the udev daemon about the new rule being installed.
4.) Connect the usb cable to you DM42
5.) Go SETUP->FILE->Activate USB Disk and connect the DM42 to you PC via USB.
6.) If using automounter wait until the partition of the internal flash was mounted.
7.) If not using automounter mount the newly created device to a mountpoint.
8.) List the contents of the flashdisk.
9.) These tests ensure, that the usb cable has good contact (see comment below).
10.) Unmount the usb disk.
11.) Return to the calculator screen of the DM42.
12.) Do not unplug the USB cable from the DM42 instead unplug the USB cable from the PC.
13.) Gain root permissions on your Linux box (become root).
14.) On the DM42: ->Setup->System->Enter System Menu->Bootloader
15.) Wait a second or two....udev needs to recognize that there is a DM42 knocking at it door...
16.) Enter
dfu-util -l
17.) The output should look similiar to this:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

Found DFU: [0483:df11] ver=2200, devnum=3, cfg=1, intf=0, path="7-4", alt=2, name="@OTP Memory /0x1FFF7000/01*0001Ke", serial="205C32A44834"
Found DFU: [0483:df11] ver=2200, devnum=3, cfg=1, intf=0, path="7-4", alt=1, name="@Option Bytes /0x1FFF7800/01*040 e/0x1FFFF800/01*040 e", serial="205C32A44834"
Found DFU: [0483:df11] ver=2200, devnum=3, cfg=1, intf=0, path="7-4", alt=0, name="@Internal Flash /0x08000000/512*0002Kg", serial="205C32A44834"

Important here is, that there is only ONE USB-ID is listed: "0483:df11". This one is of the DM42. If there are more IDs listed, there are more flashable devices connected to the PC (or part of the PC).

18.) If the output looks like this:
dfu-util 0.9

Copyright 2005-2009 Weston Schmidt, Harald Welte and OpenMoko Inc.
Copyright 2010-2016 Tormod Volden and Stefan Schmidt
This program is Free Software and has ABSOLUTELY NO WARRANTY
Please report bugs to http://sourceforge.net/p/dfu-util/tickets/

or like the above, but with different USB-IDs, the DM42 was not recognized. In this case, press the reset contact through the small whole of the back
of the DM42 (dont use anything conductive! A wooden toothpick should work) and see comment below.

19.) If the DM42 is listed with the correct USB-ID proceed with the command to flash the firmware as given in the manual (https://www.swissmicros.com/dm42/doc/dm42_user_manual) in chapter "Firmware Update Using dfu-util".

20.) Flashing needs some time...DONT PANIC!!!
21.) If flashing ends with 100% and without errors: Reset the DM42, disconnect the USB-cable and the version of you brand new firmware via
->Setup->About.

Comments
Short plug
I had some panic attacks ;) when doing this:
My DM42 was not recognized by dfu-util...regardless what I was trying to do.
The reason was: The usb-port of my DM42 was just a tiny little bit too far away from the caseing so that the USB-cable does not get good contact.
I opened the back of the DM42 and now I was able to push in the plug of USB cable right enough.
This way I was able to list the DM42 created USB-device including the correct ID and finally could flash the firmare successfully.
The USB cable was a standard USB cable which had worked for me on other devices successfully.
This is the reason why to check, whether the USB disk of the DM42 is available in beforehand. If it is not, the connection is somehow broken and
is recognized before trying to flash the firmware.


"Wrong" USB device ID
If the USB device ID of the DM42 is not listed at all: Stop trying to flash, see comment above.
If the correct USB device is listed with other device IDs:
The DM42 manual has a certain command, which defines the USB device ID to be used to flash the firmware and to ignore
other. See the manual (link above) in chapter "Firmware Update Uing dfu-util" ... the second commandline.

HTH!
Cheers
Meino
DM 42 - SN: 00373, Firmware release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
User avatar
ijabbott
Posts: 253
Joined: Fri Dec 15, 2017 2:34 pm
Location: GB-MAN

Re: Successfully updated to DM42 3.1 with dfu-utils on LINUX

Post by ijabbott »

mcc wrote:
Mon Jan 01, 2018 3:30 pm
I successfully updated my DM42 to firmware version 3.1 and wanted to describe, what I did so may be it help others to do the same.
Thanks! I may give this a try when I flash version 3.2.
3.) Use the tool "dm" to inform the udev daemon about the new rule being installed.
That's a command I've never seen before. Is it specific to Gentoo Linux? I'd normally use this command to reload the UDEV rules:

Code: Select all

sudo udevadm control -R
mcc
Posts: 277
Joined: Fri Jun 23, 2017 5:10 am

Re: Successfully updated to DM42 3.1 with dfu-utils on LINUX

Post by mcc »

Hi ijabott,

thanks for your response.

To answer your question:
YesNoMayBeForSureCertainlyInDoubt :)

Or in other words: It depends on your distro.
I read this command on a webpage, which describes the process of restarting udev and copied it since GENTOO is a distro
which contents and working depends heavily on what the user has installed and configure -- much more as with any other distro I think.

Mainly those kind of commands depend on the init system a distro uses: InitRC (old, deprecated), OpenRC (the default way,
GENTOO handles it) and systemd and may be others.
If you restart udev the "udev-way" :) that is: udevadm, this MAY (this "may" is a VERY weak one!) irritate you init system, since the udev
daemon MAY change its PID and the init system MAY rely on old, now invalid informations.
But...to be honest...killing (kill -9) udev and restart it via the start script (OpenRC) hasn't harmed nothing here. But this is the "don't do that at home" way of handling such things.

Result of all this should be: Udev should be informed about the new rule and the init system should have up-to-date information about the status of the daemons it handles.

If in doubt: reboot.
But this the windows way, not UNIX. ;)

Cheers
Meino
DM 42 - SN: 00373, Firmware release v.:3.22. / DMCP 3.24. as compiled by SwissMicros
User avatar
ijabbott
Posts: 253
Joined: Fri Dec 15, 2017 2:34 pm
Location: GB-MAN

Re: Successfully updated to DM42 3.1 with dfu-utils on LINUX

Post by ijabbott »

Hi mcc,

Thaks for your response. Regarding restarting the UDEV daemon "the UDEV way", my understanding is that the udevadm control --reload (or -R) command doesn't restart the daemon, it just tells the existing udev daemon to reload its rules and databases.

Anyway, I did flash the latest firmware using (Debian) Linux, although I used dm_tool this time. I'll try dfu-util next time.

I was a a long-term Gentoo user for over 10 years, but no longer use it. I mostly use Debian, Ubuntu and Arch these days.
Post Reply