Post Reply 
Flashing HP15CE with linux
Yesterday, 03:36 AM (This post was last modified: Today 03:20 AM by Idnarn.)
Post: #49
RE: Flashing HP15CE with linux
(11-27-2024 07:47 AM)blackjetrock Wrote:  Has anyone managed to flash with Linux?

Today I did. I tried this with a current generation HP 12C "Gold" calculator with the screwed battery door, which shares the hardware with the HP 15C CE.

WARNING: The following only documents the steps I used and what happened. This is not a suggestion that you try the same. It may brick your device or do something else unexpected. I will accept no responsibility if these steps lead to any sort of problems with your device. Bricking your device (e.g., erasing all firmware and making USB access with pogo cable not work on this particular model of SoC in the calculator) is possible with the programs used, be warned. If that happens, I am not responsible.

A quick intro first. The HP 15C CE calculator has an Atmel ATSAM4LC2CA SoC chip which is in the SAM4L chip series. The chip has flash ROM of 128 kiB (131072 bytes) organized into 256 pages of 512 bytes each (256 * 512 = 131072). The chip has a built-in program called SAM-BA that supports the feature of flashing it over USB. This program resides in the first 16384 bytes (first 32 pages, or between offsets 0 to 0x3fff in hex) of flash ROM on the chip. It must not be overwritten or disturbed. If it is overwritten, one may not be able to connect to the calculator over USB. The chip itself protects this region using a "lock" bit, but it is possible to unlock this region using the programs mentioned below. If you follow the same steps, please understand what commands you're executing.

References:

(a) page 61 of https://www.mouser.com/datasheet/2/268/A...368710.pdf

(b) page 5 of https://ww1.microchip.com/downloads/en/A...T03454.pdf which is actually for a SAM4L8 device (which has double the flash).

The firmware is written to the chip's flash ROM. For this, the calculator has to be connected to a computer using a pogo cable. Instructions for connecting the cable and bringing the calculator to a state for flashing are here: https://hpcalcs.com/downloads/apps/1_How..._Cable.pdf

An open source program that works on Linux called BOSSA is used below to write the firmware to the calculator. I used this version of BOSSA as from code review it appeared to have the best support for SAM4L devices: https://sourceforge.net/p/bossa-fork/cod...aster/tree

This is NOT the upstream/original version of BOSSA. It is different from the version of BOSSA mentioned in earlier posts in this thread. The upstream/original version of BOSSA apparently has no support for SAM4L devices.

This verison of BOSSA has to be compiled from source code. It was very simple to do so. I just had to clone the git repository and run make, and install any missing dependencies it complained about. I didn't install the wxWidgets library dependency as I don't need to use a GUI. I use the "bossac" program below which is a command-line program which gets built even when the wxWidgets library is not installed.

Here is the console output of running the "bossac" program after connecting the calculator using the pogo cable and pressing ERASE + RESET buttons. All commands were run as root user to avoid possibility of device permission issues. Commands I entered are prefixed with the "#" prompt character.

Info:
Code:

# bin/bossac -i
Device found on ttyACM0
Device       : ATSAM4L
Chip ID      : ab0a07e1
Version      : 
Address      : 0
Pages        : 256
Page Size    : 512 bytes
Total Size   : 128KB
Planes       : 1
Lock Regions : 16
Locked       : 0
Security     : false
Boot Flash   : false
BOD          : false
BOR          : false
Boot Pin     : PC14 high to enter bootloader
User Page    : 512 bytes
#

Backup the existing firmware on the calculator, which in my case is the 12C firmware as it is a 12C calculator I am flashing:
Code:

# bin/bossac -r 12c.bin
Device found on ttyACM0
Read 114688 bytes from flash
[==============================] 100% (224/224 pages)
# sha256sum 12c.bin 
0525203ca13a6933587fc9e22c086749fd3799f6e2e940de933269e79899fb99  12c.bin
#

Flash the "0A0Ah" version of the HP 15C CE firmware from Moravia's website: https://hpcalcs.com/downloads/apps/HP_IA...0120ms.bin

As was mentioned previously, the first 16384 bytes of flash on the device are occupied by the SAM-BA software. This has to be left intact and not overwritten. The provided firmware from Moravia is 114688 bytes in size. 114688 + 16384 = 131072 which is exactly 128 kiB (the size of flash ROM on the Atmel ATSAM4LC2CA):

Code:

# ls -l HP_IAR_USB\ 120ms.bin 
-rw-r--r-- 1 root root 114688 Nov 30 11:20 'HP_IAR_USB 120ms.bin'
#

NOTE: In this version of the BOSSA software, the "bossac" program claims to detect a SAM4L device and flashes starting from page 32 (offset 16384 or 0x4000) automatically. See the -f, --firstpage=PAGE argument in the CLI arguments of bossac.

Code:

# sha256sum HP_IAR_USB\ 120ms.bin 
339bce585390a340e99ab9235b73eb0f7137cafebe0cdcdb938d90a82d090bfb  HP_IAR_USB 120ms.bin
# bin/bossac -w "HP_IAR_USB 120ms.bin" 
Device found on ttyACM0
Write 114688 bytes to flash
[==============================] 100% (224/224 pages)
#

That's it. The firmware can be read again to a file (such as in the backup step above) and compared with the Moravia firmware file to verify that the flashing was correctly done.

Reset the calculator (press the reset key on the pogo cable, or the reset pin button inside the battery compartment).

The checksum can be checked within the calculator by switching it on by holding down g and ENTER keys and pressing ON to turn on the calculator.

Result:

https://imgur.com/a/K3IuHUv
https://imgur.com/a/mUgOtrd

Good luck.

The firmware update steps above using BOSSA ought to work for BSDs and Mac OS too. Just make sure you compile from source code from the linked repository earlier in this comment, and don't use the upstream version of BOSSA which has no support for the chip family used in the calculator (SAM4L). There are two notes for Mac OS; the second one may have been addressed in Mac OS since as this version of BOSSA code is 10 years old.

  1. The OS X USB driver detects an Atmel device as a USB modem. When prompted about a new network interface, click Cancel to continue.
  2. Some stability issues have been seen with the OS X USB driver using BOSSA. When running BOSSA a second time to the same Atmel device, the USB driver can lock up causing BOSSA to freeze. As a workaround, always disconnect and reconnect the Atmel device before running BOSSA again.


Also see this thread for Python scripts to to save and load programs on the HP 15C CE using Linux (VoyagerSave functionality): https://www.hpmuseum.org/forum/thread-22525.html
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Flashing HP15CE with linux - blackjetrock - 11-27-2024, 07:47 AM
RE: Flashing HP15CE with linux - RPNerd - 11-27-2024, 08:31 AM
RE: Flashing HP15CE with linux - RPNerd - 11-27-2024, 08:41 AM
RE: Flashing HP15CE with linux - rprosperi - 11-27-2024, 12:37 PM
RE: Flashing HP15CE with linux - Jase - 11-27-2024, 12:49 PM
RE: Flashing HP15CE with linux - Idnarn - 11-27-2024, 03:08 PM
RE: Flashing HP15CE with linux - Idnarn - 11-27-2024, 03:07 PM
RE: Flashing HP15CE with linux - Idnarn - 11-27-2024, 03:35 PM
RE: Flashing HP15CE with linux - Idnarn - 11-27-2024, 05:52 PM
RE: Flashing HP15CE with linux - Idnarn - 11-28-2024, 01:18 AM
RE: Flashing HP15CE with linux - Idnarn - 11-29-2024, 04:47 PM
RE: Flashing HP15CE with linux - Idnarn - 11-29-2024, 05:26 PM
RE: Flashing HP15CE with linux - Idnarn - 11-29-2024, 05:06 PM
RE: Flashing HP15CE with linux - Idnarn - 11-29-2024, 05:07 PM
RE: Flashing HP15CE with linux - Idnarn - 11-29-2024, 05:50 PM
RE: Flashing HP15CE with linux - Idnarn - Yesterday 03:36 AM



User(s) browsing this thread: 29 Guest(s)