Post Reply 
Flashing HP15CE with linux
11-29-2024, 04:47 PM (This post was last modified: Yesterday 06:17 AM by Idnarn.)
Post: #41
RE: Flashing HP15CE with linux
Update: Please see a newer post in this thread for updated steps that I used to flash on Linux using a different fork of BOSSA.

(11-28-2024 05:56 PM)blackjetrock Wrote:  Same result, I'm afraid...

Can you try the BOSSA tool and see if flashing with it works?

* Compile it from source from master branch of: https://github.com/shumatech/BOSSA
* Also merge this PR that adds support for SAM4L devices before you compile: https://github.com/shumatech/BOSSA/pull/143

For git commands to get to this tree state, see the commands prefixed with $ below:

Code:

$ git clone https://github.com/shumatech/BOSSA
Cloning into 'BOSSA'...
remote: Enumerating objects: 1727, done.
remote: Total 1727 (delta 0), reused 0 (delta 0), pack-reused 1727 (from 1)
Receiving objects: 100% (1727/1727), 1.15 MiB | 16.61 MiB/s, done.
Resolving deltas: 100% (1321/1321), done.
$ cd BOSSA/
$ ls
appletgen*  install/  LICENSE  Makefile  README.md  res/  src/
$ git remote add nandojve https://github.com/nandojve/BOSSA
$ git fetch nandojve
remote: Enumerating objects: 19, done.
remote: Counting objects: 100% (12/12), done.
remote: Total 19 (delta 12), reused 12 (delta 12), pack-reused 7 (from 1)
Unpacking objects: 100% (19/19), 4.96 KiB | 846.00 KiB/s, done.
From https://github.com/nandojve/BOSSA
 * [new branch]      arduino     -> nandojve/arduino
 * [new branch]      bossa/sam4l -> nandojve/bossa/sam4l
 * [new branch]      master      -> nandojve/master
$ git merge nandojve/bossa/sam4l
Updating 3532de8..53f8401
Fast-forward
 Makefile          |   2 +-
 src/CalwFlash.cpp | 210 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++​++++++++++++++++++
 src/CalwFlash.h   |  84 +++++++++++++++++++++++++++++++++++++
 src/Device.cpp    |  26 +++++++++++-
 src/Device.h      |   2 +
 src/Flash.h       |   8 ++++
 6 files changed, 330 insertions(+), 2 deletions(-)
 create mode 100644 src/CalwFlash.cpp
 create mode 100644 src/CalwFlash.h
$

With Debian bookworm (such as for a Raspberry Pi 5 user), it'll also need the following patch to bump the wx version dependency:
Code:

diff --git a/Makefile b/Makefile
index 650fa65..2645392 100644
--- a/Makefile
+++ b/Makefile
@@ -4,7 +4,7 @@
 # Version
 #
 VERSION?=$(shell git describe --tags --dirty)
-WXVERSION=3.0
+WXVERSION=3.2
 
 #
 # Source files

I confirm that BOSSA properly compiles with the above on Debian bookworm, but I don't have a screwdriver handy right now to connect my HP 15C CE and try it.

Update: Please see a newer post in this thread for updated steps that I used to flash on Linux using a different fork of BOSSA.
Find all posts by this user
Quote this message in a reply
11-29-2024, 05:02 PM
Post: #42
RE: Flashing HP15CE with linux
No, sorry, I've binned the calculators...
Find all posts by this user
Quote this message in a reply
11-29-2024, 05:06 PM
Post: #43
RE: Flashing HP15CE with linux
(11-28-2024 06:06 PM)blackjetrock Wrote:  I think I'll be divesting myself of the HP15CEs...

Don't give up. I'm pretty sure there's at least one developer at Moravia who's using a current Linux distribution to develop firmware for these calculators. If it comes to that, we can try to get a referral at Moravia to help.

But meanwhile let's try BOSSA and see if it works, as it appears to be used with SAM microcontrollers widely (from the reports in that git repo). And someone did write this PR to add SAM4L support, so there's hope that it works.
Find all posts by this user
Quote this message in a reply
11-29-2024, 05:07 PM
Post: #44
RE: Flashing HP15CE with linux
(11-29-2024 05:02 PM)blackjetrock Wrote:  No, sorry, I've binned the calculators...

Ok, sorry to hear that.
Find all posts by this user
Quote this message in a reply
11-29-2024, 05:21 PM
Post: #45
RE: Flashing HP15CE with linux
(11-29-2024 05:06 PM)Idnarn Wrote:  ...SAM4L support, so there's hope that it works.

It should should also work with 2015+ HP-12C+'s as well. One can load HP-15C CE firmware into those. Or the opposite.

A1

HP-15C (2234A02xxx), HP-16C (2403A02xxx), HP-15C CE (9CJ323-03xxx), HP-20S (2844A16xxx), HP-12C+ (9CJ251)

Find all posts by this user
Quote this message in a reply
11-29-2024, 05:26 PM
Post: #46
RE: Flashing HP15CE with linux
I'll try BOSSA with one of my calculators, maybe tomorrow.
Find all posts by this user
Quote this message in a reply
11-29-2024, 05:30 PM (This post was last modified: 11-29-2024 05:30 PM by AnnoyedOne.)
Post: #47
RE: Flashing HP15CE with linux
I hope BOSSA works. That'd mean flash programming support for Windows (SAM-BA 2.18) and Linux (BOSSA) users. Perhaps those on MacOS as well Smile

A1

HP-15C (2234A02xxx), HP-16C (2403A02xxx), HP-15C CE (9CJ323-03xxx), HP-20S (2844A16xxx), HP-12C+ (9CJ251)

Find all posts by this user
Quote this message in a reply
11-29-2024, 05:50 PM (This post was last modified: 11-29-2024 06:11 PM by Idnarn.)
Post: #48
RE: Flashing HP15CE with linux
FWIW there is a different BOSSA fork here with SAM4L support:
https://sourceforge.net/p/bossa-fork/cod...aster/tree

(It is much older code, but hopefully the CLI interface will still compile and work.)

Edit: Compiled for me on Debian bookworm after removing -Werror from COMMON_CXXFLAGS, as the compiler warns about use of obsolete C++ features.

Edit: This version of BOSSA appears to be better after looking at the changes for SAM4L. It also automatically starts writing from page 32 which probably is location 0x4000 assuming a 512 byte page size, but I will have to check from "info" tomorrow to confirm.
Find all posts by this user
Quote this message in a reply
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
Yesterday, 01:23 PM
Post: #50
RE: Flashing HP15CE with linux
(Yesterday 03:36 AM)Idnarn Wrote:  
(11-27-2024 07:47 AM)blackjetrock Wrote:  Has anyone managed to flash with Linux?
Today I did.

Congrats. So Windows good. Linux good. MacOS?

A1

HP-15C (2234A02xxx), HP-16C (2403A02xxx), HP-15C CE (9CJ323-03xxx), HP-20S (2844A16xxx), HP-12C+ (9CJ251)

Find all posts by this user
Quote this message in a reply
Yesterday, 02:19 PM
Post: #51
RE: Flashing HP15CE with linux
Hopefully someone will confirm so that everyone knows (not just them).

A1

HP-15C (2234A02xxx), HP-16C (2403A02xxx), HP-15C CE (9CJ323-03xxx), HP-20S (2844A16xxx), HP-12C+ (9CJ251)

Find all posts by this user
Quote this message in a reply
Post Reply 




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