Page 1 of 2

Updating DM-42 on a mac

Posted: Fri Jan 12, 2018 5:13 am
by hpgene
Does anyone here update their DM-42 using a mac and **not** within a virtual windows environment running on the mac?

If so, what do you do and how?

Re: Updating DM-42 on a mac

Posted: Fri Jan 12, 2018 5:53 am
by toml_12953
hpgene wrote:
Fri Jan 12, 2018 5:13 am
Does anyone here update their DM-42 using a mac and **not** within a virtual windows environment running on the mac?

If so, what do you do and how?
Did you read the instructions at

https://www.swissmicros.com/dm42/doc/dm ... bootloader

Use the section headed

Firmware Update

You have to use dfu-util.

Re: Updating DM-42 on a mac

Posted: Fri Jan 12, 2018 9:08 am
by [maven]
For the record, the instructions worked fine for me (after installing dfu-util with homebrew (http://brew.sh)) for updating to both 3.1 and 3.2.

The actual command I ended up using (but this may depend on USB port and so on, so do not blindly copy this!) was

Code: Select all

dfu-util -d 0483:df11 -D DM42_flash_3.2.bin -a "@Internal Flash  /0x08000000/512*0002Kg" -s 0x8000000

Re: Updating DM-42 on a mac

Posted: Fri Jan 12, 2018 1:40 pm
by Thomas Okken
[maven] wrote:
Fri Jan 12, 2018 9:08 am
For the record, the instructions worked fine for me (after installing dfu-util with homebrew (http://brew.sh)) for updating to both 3.1 and 3.2.

The actual command I ended up using (but this may depend on USB port and so on, so do not blindly copy this!) was

Code: Select all

dfu-util -d 0483:df11 -D DM42_flash_3.2.bin -a "@Internal Flash  /0x08000000/512*0002Kg" -s 0x8000000
Same here. I'd just like to add that you can also install dfu-util using MacPorts, if you prefer.

Re: Updating DM-42 on a mac

Posted: Fri Jan 12, 2018 2:35 pm
by salvomic
I wonder if it is possible to install dfu-utils via Homebrew (brew), thank you.

Salvo

Re: Updating DM-42 on a mac

Posted: Fri Jan 12, 2018 5:01 pm
by Thomas Okken
salvomic wrote:
Fri Jan 12, 2018 2:35 pm
I wonder if it is possible to install dfu-utils via Homebrew (brew), thank you.
That question was answered in this thread, two posts before yours.

Re: Updating DM-42 on a mac

Posted: Fri Jan 12, 2018 5:08 pm
by salvomic
Thomas Okken wrote:
Fri Jan 12, 2018 5:01 pm
salvomic wrote:
Fri Jan 12, 2018 2:35 pm
I wonder if it is possible to install dfu-utils via Homebrew (brew), thank you.
That question was answered in this thread, two posts before yours.
sorry, I apologise: I wrote with our read!
Thank you

salvo

Re: Updating DM-42 on a mac

Posted: Fri Jan 12, 2018 5:19 pm
by rprosperi
[maven] wrote:
Fri Jan 12, 2018 9:08 am
For the record, the instructions worked fine for me (after installing dfu-util with homebrew (http://brew.sh)) for updating to both 3.1 and 3.2.

The actual command I ended up using (but this may depend on USB port and so on, so do not blindly copy this!) was

Code: Select all

dfu-util -d 0483:df11 -D DM42_flash_3.2.bin -a "@Internal Flash  /0x08000000/512*0002Kg" -s 0x8000000
Oh, the joy and simplicity of easy-to-use Macs.... typically only Linux users have the fun of experimenting in order to find such an intuitive command.

[Ducking and seeking cover...]

Re: Updating DM-42 on a mac

Posted: Fri Jan 12, 2018 6:12 pm
by Thomas Okken
rprosperi wrote:
Fri Jan 12, 2018 5:19 pm
[maven] wrote:
Fri Jan 12, 2018 9:08 am
For the record, the instructions worked fine for me (after installing dfu-util with homebrew (http://brew.sh)) for updating to both 3.1 and 3.2.

The actual command I ended up using (but this may depend on USB port and so on, so do not blindly copy this!) was

Code: Select all

dfu-util -d 0483:df11 -D DM42_flash_3.2.bin -a "@Internal Flash  /0x08000000/512*0002Kg" -s 0x8000000
Oh, the joy and simplicity of easy-to-use Macs.... typically only Linux users have the fun of experimenting in order to find such an intuitive command.

[Ducking and seeking cover...]
Meh. I don't use Macs because of their "simplicity or ease of use," that argument ceased to have meaning somewhere between Windows 98 and XP, anyway. I use them because I need them for MacOS and iOS development. And Apple laptop hardware is nice.
Nowadays, all desktop OSes are mostly "just works," and they're also all "if it doesn't just work, things get hairy very quickly." :mrgreen:

Re: Updating DM-42 on a mac

Posted: Sat Jan 13, 2018 3:52 am
by pcscote
I have created these BASH scripts to update my DM-42 with my MacBook Pro

Application updater: upload_dm42_app.sh

Code: Select all

#!/bin/bash
if [ $# -eq 0 ]; then # if no parameter has been provided, then show mini-help
   echo "Usage: $0 application_filename"
   echo "Ex #1: $0 DM42_flash_3.0.bin"
   echo "Ex #2: $0 DMflash.bin"
elif [ $# -gt 1 ]; then  # if to many parameters (>1) has been provided, then say it to the user
   echo "ERROR: too many parameters" 
elif [ ! -e "$1" ]; then # does this file exist ?
   echo "ERROR: file $1 is missing"
elif [ ! -f "$1" ]; then # is this a file ?
   echo "ERROR: $1 is not a file"
else
   dfu-util -D $1 -d 0483:df11 -a "@Internal Flash  /0x08000000/512*0002Kg" -s 0x8000000
   echo "Press RESET button after dfu-util finishes the flashing."
fi
QSPI updater: upload_dm42_qspi.sh

Code: Select all

#!/bin/bash
if [ $# -eq 0 ]; then # if no parameter has been provided, then show mini-help
   echo "Usage: $0 qspi_filename"
   echo "Ex   : $0 DM42_qspi_3.0.bin"
elif [ $# -gt 1 ]; then  # if to many parameters (>1) has been provided, then say it to the user
   echo "ERROR: too many parameters" 
elif [ ! -e "$1" ]; then # does this file exist ?
   echo "ERROR: file $1 is missing"
elif [ ! -f "$1" ]; then # is this a file ?
   echo "ERROR: $1 is not a file"
else
   dfu-util -D $1 -d 0483:df11 -a "@QSPI Flash   /0x90000000/512*04Kg" -s 0x90000000
   echo "Press F (top right key) to switch the calculator back to bootloader mode."
fi
Sylvain

edit 1: typo
edit 2: sudo removed from scripts
edit 3: swapped scripts position (Application updater is now first & QSPI updater is now second)
edit 4: update edit log
edit 5: typo