About this User Manual

This user manual refers to special features of DM42. PDF version of this manual is available at https://www.swissmicros.com/dm42/doc/dm42_user_manual.pdf.

Look at the following documentation for description of basic calculator functionality:

General Information

CPU Speed

CPU speed is 24MHz when running on battery (due to limited battery current) and increases to 80MHz when the USB cable is connected.

IR Printing

Calculator contains IR output and can print on HP 82240B infrared printer.

Internal FAT disk

The calculator has 6MB of internal flash storage formatted as a FAT filesystem that is used for loading/saving programs and for backing up calculator state. It is accessible as USB disk when activated via the menu 'File > Activate USB Disk >'.

Internal flash has limited amount of write cycles. While the lifetime with ordinary usage could be dozens of years, an excessive number of writes will wear the flash memory much quicker.

Worst case scenario, you would have to replace the flash chip, which is worth less than $1. If needed, SwissMicros will replace the chip at no cost, but shipping costs must be covered by the customer.

The datasheet mentions a minimum of 100,000 write cycles, which sounds like a lot, but any change in the filesystem means overwriting at least part of the file allocation table, which is stored in a static location.

Calculator comes with pre-filled FAT disk contents. In case the contents of the FAT area is lost it could be always downloaded from the SwissMicros DM42 FAT files page. There is the contents of individual directories accessible separately or the whole contents of FAT disk can be downloaded as single zip file DM42.zip.

There are several directories with special names on the FAT disk:

HELP

Contains help file(s) for built-in DM42 help that can be activated from main system soft menu by pressing F1 key (leftmost in top row of keys).

OFFIMG

Bitmap files from this directory are displayed when the calculator is turned off. See OFF Images chapter for more details.

PROGRAMS

Raw files with programs are loaded/saved from/to this directory.

SCREENS

Screenshots of calculator LCD are saved into this directory. See LCD Screenshots for more details.

STATE

Calculator state files with extension .s42 are stored in this directory. See chapters Load State or Save State how the load or save calculator state.

Calculator Extensions

Virtual variables

Managing some of the new features specific to the DM42 is something that spurred a lot of discussion. Initially we wanted to re-purpose some of the so-called "reserved" flags of the HP-42S but it soon became apparent that others had already done so in various patches for Free42 and we wanted to avoid trampling on anybody’s toes with our own patches for Free42.

The next idea was to extend the number of flags available beyond 100 but obviously only have them accessible via indirect addressing as there was no question of patching Free42 to accept 3 digits in the various flag instructions. But then, how do we make integer values (and one real value) available to programs without assigning a whole block of flags that are going to be awkward to read?

After that we thought of using extended register numbers. They would either have to be assigned ridiculously high index numbers in order to avoid conflict if someone decided to go for a register array SIZE of 2000, or they would have to be assigned negative index numbers. We couldn’t use negative indexes because the HP-42S and Free42 just take the absolute value of the index and use that to access the correct register and some programs might rely on that.

We settled on the concept of "Virtual Variables". These are variables that do not (and cannot, for that matter) exist in the DM42’s variable table. Because of this, they are not listed in the variable menu when you press RCL or STO but there is a way to make them easy-ish to access, just read on…​

There are six such virtual variables:

"DevID"

Device ID (read-only) — RCL "DevID" returns the type of DM42 you’re using. There are currently two hardware models only identified by value 0 (zero) is returned by the DM42 units that we have. Other types of unit that may be produced in future will have different DevID values.

"GrMod"

Graphics Mode (read-write) — RCL "GrMod" retrieves the current graphics mode and STO "GrMod" sets the graphics mode to the number present in the X register. Graphics modes currently supported are:

  • 0 = standard HP-42S resolution 131x16

  • 1 = reserved for future use and maps to 0 on the DM42

  • 2 = DM42 full resolution 200x120

  • 3 = DM42 full resolution 400x240

"ResX" and "ResY"

X- and Y-resolution (read-only) — RCL "ResX" or RCL "ResY" recalls the current X-resolution or Y-resolution respectively into the X stack register. The values that you will get are 131, 200 or 400 for RCL "ResX" and 16, 120 or 240 for RCL "ResY" depending on the current graphics mode (0, 2 or 3).

"Vbat"

Battery voltage (read-only) — If you’re running off battery power then this will give you the voltage read at that precise moment in time. If you’re running on USB power then this will give you the last battery voltage that was recorded before connecting the USB cable. Note that the value retrieved here can and almost always will be different to the voltage displayed in the status bar. The latter is cached and almost always retrieved when the DM42 is idle. The voltage read from "Vbat" is the voltage read while you are using the keyboard and/or running a program. This can be useful for pausing lengthy processing if the battery voltage drops below a threshold and allowing it to recover before resuming.

"RefLCD"

The purpose of programs can vary significantly. There are programs like a stopwatch or games, where quick refreshing of the LCD is required. On the other end of the spectrum are pure computational programs, where no LCD output is required throughout program execution and where it is more beneficial to utilize all the CPU time for computation rather than wasting it on unnecessary LCD updates. The "RefLCD" virtual variable was introduced specifically to address those different requirements. It is possible to disable LCD refreshing altogether or to enable the periodic refresh of individual portions of the LCD.

RefLCD in more detail

It is possible to disable LCD refreshing altogether or to enable the periodic refresh of individual portions of the LCD. The value that you store in this variable is in fact a bitmask as per the table below. Items whose corresponding bit is cleared are not refreshed whereas those whose bit is set are refreshed with 200ms timeout after the LCD contents changes.

Bit Value Zone

0

1

Main area (stack/graphics)

1

2

Goose

2

4

Annunciators

In order to prevent any part of the LCD from refreshing and thus maximize performance, store the value 0 (zero) in "RefLCD". Storing 1 in the variable means that the main area will be updated with 200ms timeout (stack or the graphics display if that is what is active). 2 will allow the goose to fly and 4 will allow the annunciators (including the flag tiles) to be updated. To have more than one zone refreshed during program execution, store the sum of the bit value(s) in "RefLCD" as follows:

Value Binary Zone(s)

0

000

None (no refreshing occurs)

1

001

Main area

2

010

Goose

3

011

Main area and goose

4

100

Annunciators

5

101

Annunciators and main area

6

110

Annunciators and goose

7

111

Annunciators, goose and main area (everything)

You can, however, still refresh zones on an ad hoc basis even when they don’t normally refresh by storing the negative value of the bitmask value in "RefLCD". For example, to update the annunciators programatically "now", store -4 to "RefLCD".

One exception to this is the message area in which VIEW and AVIEW show their results. This is never disabled and is repainted with 200ms delay(if needed) even if zero is stored in "RefLCD". If the redraw response isn’t fast enough (e.g. for a stopwatch application, see below) then you can have the message area refreshed by program by storing the value -8 in "RefLCD". This program shows an example of how to use it:

00 { 49-Byte Prgm }
01▸LBL "STOPW"
02 TIME
03 →HR
04 STO 02
05 "RefLCD"
06 ASTO 03
07 CLX
08 STO IND 03 @ Disable refreshing
09 FIX 02
10▸LBL 00
11 TIME
12 →HR
13 RCL- 02
14 3600
15 ×
16 VIEW ST X
17 -8
18 STO IND 03 @ refresh the message area now
19 GTO 00

Accessing virtual variables

Attempting to STO a value in a read-only virtual variable has no effect, so it is not possible to create these variables in the variables table within Free42. Because of this it is a bit awkward to RCL and STO them directly. We recommend adding a reference to the virtual variables that you will need in your program in order to access the variables indirectly later on. Something like this:

"GrMod"
ASTO 10
"ResX"
ASTO 11
"ResY"
ASTO 12

Where needed you can then simply address the virtual variables this way:

3
STO IND 10
"Pixels on "
├"screen: "
RCL IND 11
RCLx IND 12
ARCL ST X
AVIEW
STOP

F-Buttons

The top row of keyboard consists of six unprinted buttons referenced as F-Buttons (F1-F6) or Soft-Menu Buttons. When no calculator menu is in action those buttons have following functions:

F1

Displays the Help. Note that the /HELP/index.htm file has to be present. The latest version can be downloaded from the DM42 help page.

F2

Toggle this system soft menu visibility.

F3

(not assigned)

F4

Increase buzzer volume

SHIFT-F4

Decrease buzzer volume

F5

Toggle stack alignment (Left, Right, Right Underlined)

SHIFT-F5

Toggle between sans and HP font

F6

Increase font size

SHIFT-F6

Decrease font size

LCD Screenshots

Hold SHIFT and press DISP to get a screenshot.

You will find a .bmp file named according to the current time and date in the /SCREENS folder of the FAT drive.

OFF Images

The LCD display used in DM42 calculator behaves in similar way as e-ink displays and contents of the LCD is visible for a long time after the calculator is turned OFF.

This feature is used to display images when the calculator is turned OFF.

Single hard-coded OFF image is present in calculator firmware and this image is displayed whenever the calculator is turned OFF and FAT disk doesn’t contain any valid custom image or the FAT disk is in error state.

Custom OFF images should be stored in /OFFIMG/ directory. All valid images are then cyclically displayed one after each calculator OFF in the order how they appear in /OFFIMG/ directory.

OFF images require specific image format. It has to be .bmp file with dimensions 400 x 240 and 1 bit depth.

Examples of OFF images can be found on "A collection of off-screen images" page.

PIXEL and AGRAPH

PIXEL and AGRAPH are not limited to the original HP-42S’s resolution of 131x16 pixels. The compatibility with negative values to display lines and with complex numbers and matrices is conserved. You can now use horizontal values of 1≤X≤200 and vertical values of 1≤Y≤120 in 200x120 mode, or 1≤X≤400 and 1≤Y≤240 in 400x240 mode. Switching between 131x16, 200x120 and 400x240 modes is achieved using the GrMod virtual variable and current graphics resolution could be probed by ResX and ResY.

Alpha Input Mode

Upon entering Alpha input mode you will see a new annunciator on the screen:

  • "[ ]" denotes original HP-42S input mode. This is the mode that Alpha input starts with when entered for the first time.

  • "[a]" denotes lower case DM42 input mode.

  • "[A]" denotes upper case DM42 input mode.

SHIFT followed by and allow you to cycle through the modes.

The DM42 remembers which mode you were in last time alpha input was active and upon entering alpha input modes switches immediately to that mode.

Original HP-42S mode
  • Function keys work as expected for standard characters.

  • ASTO (STO) and ARCL (RCL) work as expected.

  • "%", "pi" and "E" work as expected.

  • SHIFT SHOW works as expected.

  • Local labels LBL 01, LBL A and LBL a work as expected.

  • Global labels LBL "ABC", LBL "123" and LBL "A123" work as expected.

  • Un-shifted [R/S] works as expected and [SHIFT] [R/S] enters/leaves Prgm mode as expected.

Lower and upper case DM42 modes
  • The function keys still allow input in HP-42S mode.

  • All alpha keys A-Z give the expected characters.

  • SHIFT A to SHIFT O give the same characters.

  • SHIFT 0 (zero) to SHIFT 9 give the digits 0-9 instead of the alpha characters.

  • Shifted ÷, ×, - and + give '÷', '×', '-' and '+' instead of the alpha characters.

  • Shifted R/S gives '?' instead of entering/leaving Prgm mode.

  • ASTO, ARCL, '%', 'pi' and 'E' (exponent) are not available. Switch to standard HP-42S mode to get them.

  • SHIFT SHOW is not available. Use standard HP-42S mode.

  • Two-digit local labels LBL 01 are not available. Use standard HP-42S mode.

  • Local labels LBL A and LBL a and global labels LBL "ABC", LBL "123" and LBL "A123" work as expected.

  • Un-shifted R/S still behaves as usual allowing program execution to resume after inputting alpha data to a program.

  • Function arguments (eg. STO* "h") work as expected

SST/BST in alpha input mode

Press and hold the SHIFT key while pressing or in order to execute BST or SST respectively when in alpha input mode. As on the original HP-42S, BST will start auto-repeating after a while and SST will NULL after a couple of seconds if you press and hold or respectively.

Since DM42 3.10 in addition to default IR printing user can choose printing to file.

This functionality can be activated in Print to File menu.

Two output formats are supported:

Graphics Print

Creates bitmap (.bmp) file with printed data in graphics.

Text Print

Creates text (.txt) file with printed data in UTF-8.

The output file /PRINTS/<time-stamp>.txt for text output and /PRINTS/<times-tamp>.bmp for graphics output is created just after the 'Text Print' or 'Graphics Print' (respectively) is activated in menu.

Disabling one of those options flushes appropriate buffer and finishes the file. Next activation of previously deactivated 'Text Print' or 'Graphics Print' creates new file with current time-stamp.

Printing buffers are allocated from available calculator memory just after the 'Text Print' or 'Graphics Print' is selected in menu. Error is displayed if not enough memory is available also no file is created and selected option isn’t activated.

There are two options for tweaking the print to file functionality:

Don’t print to IR

(affects both 'Text Print' and 'Graphics Print')
Disables printing to IR and printing delays.

Graphics in Text

(affects 'Text Print' only)
If enabled graphics prints appear as block graphics in text file using Unicode "Block Elements". Note that you need reasonably equipped font to display the graphics print correctly (which isn’t the default case for Windows users).

Program Decoder/Encoder

Thanks to generous contribution of Godwin (known as grsbanks in forum) we can use web based program decoder and encoder for Free42 raw files - i.e. those files used for program import/export in DM42.

Thus you can prepare your DM42 program directly on PC and then download it to DM42 and import it there. As well as export programs written directly on DM42 and edit them on PC.

The program decoder/encoder is located at https://www.swissmicros.com/dm42/decoder/. Follow this link and look into instructions tab for more details.

DM42 Menus

Menu navigation:

  • Select menu items using , keys.

  • Activate current menu item by pressing ENTER key or by pressing the number key corresponding to particular menu line.

  • Return to previous menu level by EXIT key

Main Setup menu

Main 'Setup menu' could be entered by pressing SHIFT+SETUP.

From there other sub-menus could be entered or about screen displayed

File menu

1. Load Program >

Used for loading the *.raw programs stored in the /PROGRAMS/ directory of the flash storage.

It should display all *.raw files from /PROGRAMS/ directory in alphabetical order.

To load program

  • Select the program to load using the and keys

  • ENTER to load the selected program

Loading info flashes for a second until the program is loaded into calculator memory.

Then the program list is displayed again. You can load next program or leave the menu by EXIT key.

2. Save Program >

Used for saving one or more program(s) from the calculator memory to a *.raw file in the /PROGRAMS/ directory of the flash storage.

  • Select the program or programs to save, confirm with ENTER

  • Choose existing filename as target or type new target filename, confirm with ENTER

3. Activate USB Disk >

Used to copy files from/to a host computer - e.g. backup/restore the calculator state files from /STATE/ directory or read/write programs in RAW format into /PROGRAMS/ directory.

  • Connect the calculator to a computer using a USB cable

  • The DM42’s flash disk should be visible on the computer

  • Read/write files

  • 'Eject device' on the host machine.

  • Calculator should end USB disk mode automatically if correctly ejected by OS. You can end USB disk mode by pressing EXIT key on the calculator but be sure all data are flushed to disk first.

The last two points 'Eject device' and 'Press EXIT key on calculator' (if it doesn’t end automatically) are important to avoid unsaved data and possible FAT disk corruption!
Note that calculator programs must be stored in the /PROGRAMS/ directory of the flash storage to be accessible from the calculator menu.

4. Show Disk Info >

Displays disk status and disk block info.

Calculator State menu

The calculator reads last used state file after a hardware RESET (i.e. after pressing the [RESET] on the back of the calculator).

Reading of last stored calculator state file can be bypassed (eg. when the FAT disk is corrupted and the calculator hangs after a reset while reading the state file) by holding the - key and pressing the [RESET] button on the back of the calculator.

1. Load State

Displays list of available calculator state files (.s42 extension) from /STATE/ directory.

To load calculator state file:

  • Select particular file and press ENTER to load the state file.

  • Confirmation dialog appears and you have to acknowledge you want to abandon current calculator state.

If confirmed, calculator is restarted and selected calculator state file loaded.

2. Save State

Used for saving current calculator state to a *.s42 file into the /STATE/ directory of the flash storage.

To save state file: - Select existing filename as target or type new target filename, confirm with ENTER - Confirmation dialog can appears if existing file is about to be overwritten

If confirmed, calculator state is saved and subsequently is the calculator restarted and the calculator state file reloaded.

3. Load Clean State

Restarts the calculator without reading the state file (same as [RESET] + -).

For functional details look at Printing to File.

1. Graphics Print

Selecting this menu item enables printing to graphics file.

2. Text Print

Selecting this menu item enables printing to text file.

3. Graphics in Text

Selecting this menu item enables to see graphics in text file.

4. Don’t print to IR

Selecting this menu item disables default printing to IR printer.

Settings menu

1. Set Time >

Used for setting the time.

  • Use the function keys to adjust the time.

  • Press Set to write the new time to the calculator clock or EXIT to cancel your changes.

2. Set Date >

Used for setting the date.

  • Use the function keys to adjust the date.

  • Press Set to write the new date to the calculator clock or EXIT to cancel your changes.

  • Σ+ could be used to change between DMY/MDY formats.

3. Status Bar >

Displays filed selector for what should be displayed in calculator top status bar:

Status Bar menu
1. State Filename
2. Day of Week
3. Date
4. Date Separator
5. Month Shortcut
6. Time
7. Power Voltage in Header

Fields are always displayed in order how they appear in this menu.

4. Stack Font Sizes >

Enters font size configuration for stack registers:

Stack Font Sizes menu
1. Font Size Offset Reg X: 0
2. Font Size Offset Reg Y: 0
3. Font Size Offset Reg Z: 0
4. Font Size Offset Reg T: 0
5. Font Size Offset Reg L: 0
6. Font Size Offset Reg A: 0

For each register a font offset in range -5 .. 5 could be specified. Each font offset is relative to current font size set by F6 / SHIFT+F6 keys.

Example:
Lets expect there are five font sizes 1 to 5 and third font size is selected. If the "Font Size Offset Reg X" is set to 1 and other offsets remain zeroed, then the X register will be displayed in one step larger font then others.

Note that the if the maximal font size is reached the font remains at maximal size. So, setting all font offsets to 5 actually disables any effect of F6 / SHIFT+F6 keys.

5. Beep Mute

Selecting this menu item toggles the 'Beep Mute' flag.

When the 'Beep Mute' flag is active, no sounds are produced by the calculator.

Note that this value is stored in the calculator state file.

6. Slow Auto-repeat

Selecting this menu item toggles the 'Slow Auto-repeat' flag.

When the 'Slow Auto-repeat' flag is active auto-repeat delays are prolonged.

Note that this value is stored in the calculator state file.

7. Stack Layout

Enters stack layout selector where one of following layouts could be selected

Stack Layout menu
1. XYZTL
2. XYZTA
3. XYZT
4. XYL
5. XYA
6. XY

System menu

1. Bootloader

Activates bootloader mode for firmware flashing.

You can flash DM42 firmware once is the bootloader mode entered.

Press the RESET button on the back of the calculator if you activate Bootloader mode accidentally.

2. Diagnostics

Diagnostic screen for factory checking and troubleshooting.

3. Format FAT Disk >

Format the internal FAT disk storage. All data is erased.

4. FAT Disk Media Test >

Checks whole flash disk FAT area for bad blocks. Disk is formatted starting from first good block after the check.

All data is erased from disk.

5. Self Test

Displays production test menu where tests of various parts of calculator could be run from.

Self Test menu
1. KBD Test
2. LCD Test
3. IR Test
4. BEEP Test

Firmware Update

Please remember it is always wise to make FAT disk backups periodically and especially before any update.
Latest firmware is available at https://www.swissmicros.com/dm42/firmware/

If you are looking for quick update instructions you most probably want to follow Quick Update Guide.

DM42 has two firmware areas. First one is the main flash area which is updated with each firmware update, the second one is auxiliary QSPI area which is rarely updated and special update menu appears when the firmware needs new QSPI contents.

Note that since version 3.7 the calculator operating system (called DMCP) is separated from the DM42 program. Thus, both DMCP and DM42 program could be loaded separately. See Quick DMCP and PGM Update Guide for details.

No action related to QSPI contents is needed until firmware requests QSPI update by showing DMCP System menu or "QSPI Load" menu for versions before 3.7.

The preferred firmware update method is using calculator FAT disk which is available since firmware version 3.5.

This method is implemented in main firmware, so it could be unavailable if the firmware is corrupted. Then other method of update based on internal CPU flashing routine could be used. This method requires the calc to be switched in so called 'Bootloader mode'.

The internal bootloader exposes standard DFU interface and can be programed by any DFU programming software with limitation that firmware is plain binary file not file in general .dfu format, so the programming software has to support it.

This section describes how to update firmware using FAT disk or using bootloader mode with two utilities GUI based dm_tool and command line based dfu-util.

macOS users can get dfu-util via Homebrew

Availability of the particular update method on mainstream operating systems outlines following table:

FAT disk dm_tool dfu-util

Windows

X

X

X

Linux i686

X

X

X

Linux x86_64

X

X

X

macOS

X

X

Changes since v3.7

Since version 3.7 the firmware for the calculator contains only operating system (called DMCP). DM42 program could be loaded separately as described in section "Program update".

Instructions for quick update of both DMCP firmware and program load are in "Quick Update Guide".

There is new DMCP User Manual future plan which should contain information about SDK and program development for DMCP platform. Before the manual becomes available here are some useful links related to DMCP development:

  • Source code for DM42 program: https://github.com/swissmicros/DM42PGM
    Follow instructions in README files for program building

  • Source code for base DMCP_SDK with simple "Hello World" program: https://github.com/swissmicros/DMCP_SDK
    Follow instructions in README files for program building

  • More enhanced SDK demo: https://github.com/swissmicros/SDKdemo.
    It is simple RPN style calculator with

    1. Power management

    2. LCD printing

    3. Keyboard handling

    4. Use of Intel® Decimal Floating-Point Math Library (which leads to project with data in QSPI flash)

    5. Menu system

    And as usually, follow instructions in README files for program building.

Developing programs for embedded systems requires some level of expertise and SwissMicros doesn’t have enough resources to make individual support for program building and SDK use.

Quick Update Guide

Here we will update DMCP system and DM42 program at once using combined flashing file, therefore we need just single file for that:

Prerequisites

DMCP_flash_x.x_DM42-y.y.bin - Combined DMCP system file with DM42 program, e.g. DMCP_flash_3.10_DM42-3.10.bin

Steps

  1. Activate USB disk from DM42 program "SETUP → Files → Activate USB Disk" or directly from DMCP System menu.

  2. Connect USB cable from DM42 to PC/Mac computer.

  3. Copy the DMCP_flash_x.x_DM42-y.y.bin file from the PC/Mac computer to root folder of calculator disk.

  4. Eject (safely remove) the calculator disk from PC/Mac computer. Please, be patient this can take some time. Don’t unplug USB cable until safely ejected from OS.

  5. Calculator detects presence of new firmware file and asks for update. You can confirm it immediately or press EXIT key and activate flashing process later using "Flash firmware from FAT" either from DM42 program "SETUP → System" or directly from DMCP System menu "Enter System Menu"

  6. Once finished the calculator resets and should restart to updated DM42 program.

DMCP and PGM Update Guide

Since version 3.7

Here we will update DMCP system and DM42 program separately, therefore we need two files for that:

Prerequisites

DMCP_flash_x.x.bin - DMCP system file, e.g. DMCP_flash_3.10.bin
DM42-x.x.pgm - DM42 program file, e.g. DM42-3.10.pgm

Steps

  1. Activate USB disk from DM42 program "SETUP → Files → Activate USB Disk" or directly from DMCP System menu.

  2. Connect USB cable from DM42 to PC/Mac computer.

  3. Copy both DMCP_flash_x.x.bin and DM42-x.x.pgm files from the PC/Mac computer to root folder of calculator disk.

  4. Eject (safely remove) the calculator disk from PC/Mac computer. Please, be patient this can take some time. Don’t unplug USB cable until safely ejected from OS.

  5. Calculator detects presence of new firmware file and asks for update. You can confirm it immediately or press EXIT key and activate flashing process later using "Flash firmware from FAT" either from DM42 program "SETUP → System" or directly from DMCP System menu "Enter System Menu"

  6. Once finished the calculator resets and displays the DMCP System menu.

  7. Choose "Load Program" and select appropriate DM42-x.x.pgm file, loading process should start

  8. Once loaded the system should (after key-press) restart to DM42 program.

Program Loading/Update

Since version 3.7

Use this if you want to switch between programs or load new program to already loaded DMCP system.

DMCP system can have one loaded program and only loaded program can be started. Programs have .pgm extension and are expected to be stored in root folder of calculator disk.

Prerequisites

Program file with .pgm extension, e.g. DM42-3.10.pgm, SDKdemo-1.0.pgm, etc.

Steps

  1. Activate USB disk from DM42 program "SETUP → Files → Activate USB Disk" or directly from DMCP System menu.

  2. Connect USB cable from DM42 to PC/Mac computer.

  3. Copy the program file to root folder of calculator disk.

  4. Eject (safely remove) the calculator disk from PC/Mac computer. Please, be patient this can take some time. Don’t unplug USB cable until safely ejected from OS.

  5. Issue "Load Program" from DMCP System menu. This menu can be reached from DM42 program at "SETUP → System → Enter System Menu→Reset to DMCP menu".

  6. Program list from root folder of FAT disk is displayed. Choose required program, press ENTER. After confirmation question the loading process should start.

  7. Once loaded the system should (after keypress) restart to loaded program.

If anything goes wrong, like the current DMCP system is older then program requires, the restart ends in Program Info screen which should show reason why program cannot start.

DMCP Update Guide

Here we will update DMCP system only. Note that this will end just in DMCP menu and you will need to load some program to get some real functionality.

Prerequisites

DMCP_flash_x.x.bin - DMCP system file, e.g. DMCP_flash_3.10.bin

Steps

  1. Activate USB disk from DM42 program "SETUP → Files → Activate USB Disk" or directly from DMCP System menu.

  2. Connect USB cable from DM42 to PC/Mac computer.

  3. Copy the DMCP_flash_x.x.bin file from the PC/Mac computer to root folder of calculator disk.

  4. Eject (safely remove) the calculator disk from PC/Mac computer. Please, be patient this can take some time. Don’t unplug USB cable until safely ejected from OS.

  5. Calculator detects presence of new firmware file and asks for update. You can confirm it immediately or press EXIT key and activate flashing process later using "Flash firmware from FAT" either from DM42 program "SETUP → System" or directly from DMCP System menu "Enter System Menu"

  6. Once finished the calculator resets and should restart to DMCP menu.

Bootloader mode activation

Bootloader mode can be activated from main Setup menu: "SETUP → System → Bootloader" or by using RESET and PGM button.

The sequence of entering bootloader mode using RESET and PGM button is:

  • Press and hold PGM button

  • Press and release the RESET button

  • Release the PGM button

Older models have both buttons accessible through the holes in the calculator backplate. Newer models have hole in the backplate for RESET button only, therefore the backplate should be removed first, then use the RESET and PGM buttons directly on PCB.

FW Update Using dm_tool

Latest version of dm_tool can be downloaded from the Tools web page.

Prerequisites for Windows

You have to install libusb driver as described here: http://www.swissmicros.com/doc/libusb_install/libusb_install.html.

Prerequisites for Linux

USB device access rights

You can allow access to the DFU device for users in plugdev group by running as root:

cd /etc/udev/rules.d/
cat << OI > 49-stm32-dfuse.rules
# This is udev rules file (place in /etc/udev/rules.d)
# Makes STM32 DfuSe device accessible to the "plugdev" group

ACTION=="add", SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="664", GROUP="plugdev"
OI
udevadm control --reload-rules

Alternatively you can use dfu-util as root or prefix the commands with sudo, e.g.

sudo dfu-util -l

Launching dm_tool

Switch the calculator to bootloader mode

From menu or by RESET+PGM buttons (see Bootloader mode activation).

Connect the calculator to the PC

Be sure the libusb driver is installed if used in Windows (http://www.swissmicros.com/doc/libusb_install/libusb_install.html).

Launch dm_tool

It can be launched by clicking on the exe file or from command line with firmware filename as argument.

If everything works well and the calculator was connected before launching dm_tool, then the message at the right side of [Program] button should show device number. If it shows "No DFU capable devices found (Click to refresh)" try to click at the message and it should display the ID of connected device after refresh and

Memory layout:
    0x8000000-0x80fffff:  size 1024kB = 512*2kB pages

in the text area.

If the message "No DFU capable devices found" still remains there something is wrong with libusb driver installation or connection to the calculator or the calculator isn’t in bootloader mode.

Finally press the [Program] button to flash new firmware.

FW Update Using dfu-util

Switch the calculator to bootloader mode

From menu or by RESET+PGM buttons (see Bootloader mode activation).

Connect the calculator to the PC

You can list information about connected DFU device using dfu-util -l

then start flashing using

dfu-util -D DM42_flash.bin -a "@Internal Flash  /0x08000000/512*0002Kg" -s 0x8000000

If you have connected more devices with DFU interface or if dfu-util isn’t able to detect the device, you can specify the USB device ID on command line using -d option:

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

Please, be patient, it takes some time.

Press RESET button after dfu-util finishes the flashing.

Example output of dfu-util

$ dfu-util -D build/DM42_flash.bin -a "@Internal Flash  /0x08000000/512*0002Kg" -s 0x8000000
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/

dfu-util: Invalid DFU suffix signature
dfu-util: A valid DFU suffix will be required in a future dfu-util release!!!
Opening DFU capable USB device...
ID 0483:df11
Run-time device DFU version 011a
Claiming USB DFU Interface...
Setting Alternate Setting #0 ...
Determining device status: state = dfuERROR, status = 10
dfuERROR, clearing status
Determining device status: state = dfuIDLE, status = 0
dfuIDLE, continuing
DFU mode device DFU version 011a
Device returned transfer size 2048
DfuSe interface name: "Internal Flash  "
Downloading to address = 0x08000000, size = 756288
Download	[=========================] 100%       756288 bytes
Download done.
File downloaded successfully

real	1m55.929s
user	0m0.044s
sys	0m0.048s

Example output of dfu-util -l:

$ dfu-util -l
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=46, cfg=1, intf=0, path="3-7", alt=2, name="@OTP Memory /0x1FFF7000/01*0001Ke", serial="205734813133"
Found DFU: [0483:df11] ver=2200, devnum=46, cfg=1, intf=0, path="3-7", alt=1, name="@Option Bytes  /0x1FFF7800/01*040 e/0x1FFFF800/01*040 e", serial="205734813133"
Found DFU: [0483:df11] ver=2200, devnum=46, cfg=1, intf=0, path="3-7", alt=0, name="@Internal Flash  /0x08000000/512*0002Kg", serial="205734813133"

QSPI flashing

No action related to QSPI contents is needed until firmware requests QSPI update by showing DMCP System menu or "QSPI Load" menu for versions before 3.7.
Latest QSPI flash contents could be found at https://www.swissmicros.com/dm42/firmware/qspi_data/.

If you are looking for quick QSPI update instructions you most probably want to follow Flashing QSPI from FAT disk instructions.

General information

While the contents of main flash changes with each firmware version. The QSPI contents is usually preserved and it will be explicitly noted in release notes when the QSPI contents changes.

Moreover, DMCP system makes checksum of expected QSPI contents after RESET before launching loaded program. If this check fails the DMCP system doesn’t allow to start the program and writes information about missing QSPI data. Then you can use DMCP System Menu for both copying the QSPI data file to calculator as well to install this file.

Obsolete: Firware versions from 2.10.13 to 3.7 contain built-in QSPI loader which is activated when QSPI data doesn’t match.

The prefered option for QSPI update is to use "QSPI Load" menu to copy firmware to the calculator filesystem and flash the QSPI contents from the file.

User can also switch the calculator into bootloader mode and then use dfu-util or dm_tool (obsolete) described below.

Flashing QSPI from FAT disk

Here we will update QSPI flash contents. We expect here calculator in DMCP menu. Which is the place where calculator stops if you need to update QSPI flash contents.

Prerequisites

DM42_qspi_x.x.bin - QSPI data file, e.g. DM42_qspi_3.x.bin

Steps

  1. We expect the calculator in DMCP menu.

  2. Activate USB disk from DMCP menu "Activate USB Disk"

  3. Connect USB cable from DM42 to PC/Mac computer.

  4. Copy the DMCP_flash_x.x.bin file from the PC/Mac computer to root folder of calculator disk.

  5. Eject (safely remove) the calculator disk from PC/Mac computer. Please, be patient this can take some time. Don’t unplug USB cable until safely ejected from OS.

  6. Start QSPI update from DMCP menu "Load QSPI from FAT"

  7. After successful updating the QSPI data file is removed from calculator disk

Flashing QSPI using dm_tool (obsolete)

Note that this method is obsolete and will be removed.

The dm_tool takes care about QSPI loader itself. Thus flashing new QSPI contents is as easy as flashing QSPI and ordinary flash contents in a row:

  1. Flash DM42_qspi_xxx.bin

  2. Flash DM42_flash_xxx.bin

The second step is important as the ordinary firmware is replaced by QSPI loader in first step.

See Launching dm_tool for details about flashing using dm_tool.

Flashing QSPI using dfu-util

Download QSPI loader firmware DMflash.bin

Get DMflash.bin from the URL http://www.swissmicros.com/tools/DMflash.bin.

Switch the calculator into bootloader mode

From menu or by RESET+PGM buttons (see Bootloader mode activation).

Flash QSPI bootloader

dfu-util -D DMflash.bin -a "@Internal Flash  /0x08000000/512*0002Kg" -s 0x8000000

Press RESET button after dfu-util finishes the flashing.

Flash QSPI contents

dfu-util -D DM42_qspi_2.10.12.bin -a "@QSPI Flash   /0x90000000/512*04Kg" -s 0x90000000

Press F (top right key) to switch the calculator back to bootloader mode.

Flash main firmware

dfu-util -D DM42_flash_2.10.12.bin -a "@Internal Flash  /0x08000000/512*0002Kg" -s 0x8000000

Press RESET button after dfu-util finishes the flashing.

Note that this step is important as the ordinary firmware is replaced by QSPI loader earlier.

DMCP System Menu

Since version 3.7

This is main menu of DMCP system (i.e. operating system of the calculator).

This menu is automatically displayed if DMCP system doesn’t contain any loaded program or starting of the program fails.

If there is valid program loaded into DMCP system it is automatically started after RESET and thus the DMCP menu isn’t displayed.

To force DMCP menu start you can use F1+[RESET] (i.e. upper left key + RESET button through the hole in calculator backplate).

DMCP System menu

1. Program Info

Displays information about program loaded into DMCP system.

2. Run Program

Starts currently loaded program.

3. Load Program

Displays selection dialog to choose among programs stored in FAT root directory. Loads selected program to DMCP system.

4. Load QSPI from FAT

Starts flashing of the QSPI firmware. The firmware DM42_qspi_xxx.bin or DMCP_qspi_xxx.bin is expected to be stored in the FAT filesystem root directory.

5. Settings >

Time and Date settings.

6. Activate USB Disk

Used to copy files from/to a host computer.

  • Connect the calculator to a computer using a USB cable

  • The DM42’s flash disk should be visible on the computer

  • Read/write files

  • 'Eject device' on the host machine.

  • Calculator should end USB disk mode automatically if correctly ejected by OS. You can end USB disk mode by pressing EXIT key on the calculator but be sure all data are flushed to disk first.

The last two points 'Eject device' and 'Press EXIT key on calculator' (if it doesn’t end automatically) are important to avoid unsaved data and possible FAT disk corruption!

7. Enter System Menu

Jumps to the main System menu

8. About

Displays general information about DMCP system

QSPI Load menu

Obsolete, valid for versions before 3.7

This menu is displayed only when the calculator detects invalid contents of QSPI firmware area.

QSPI Load menu

1. Bootloader

Activates bootloader mode for firmware flashing.

Press the RESET button on the back of the calculator if you activate Bootloader mode accidentally.

2. Load QSPI from FAT

Starts flashing of the QSPI firmware. The firmware DM42_qspi_xxx.bin is expected to be stored in the FAT filesystem root directory.

3. Activate USB Disk >

Used to copy files from/to a host computer.

  • Connect the calculator to a computer using a USB cable

  • The DM42’s flash disk should be visible on the computer

  • Read/write files

  • 'Eject device' on the host machine.

  • Calculator should end USB disk mode automatically if correctly ejected by OS. You can end USB disk mode by pressing EXIT key on the calculator but be sure all data are flushed to disk first.

The last two points 'Eject device' and 'Press EXIT key on calculator' (if it doesn’t end automatically) are important to avoid unsaved data and possible FAT disk corruption!

4. Format FAT Disk >

Format the internal FAT disk storage. All data is erased.

5. FAT Disk Media Test >

Checks whole flash disk FAT area for bad blocks. Disk is formatted starting from first good block after the check.

All data is erased from disk.

6. Show Disk Info >

Displays disk status and disk block info.