Flashing HP15CE with linux - Printable Version +- HP Forums (https://www.hpmuseum.org/forum) +-- Forum: HP Calculators (and very old HP Computers) (/forum-3.html) +--- Forum: General Forum (/forum-4.html) +--- Thread: Flashing HP15CE with linux (/thread-22776.html) |
RE: Flashing HP15CE with linux - Idnarn - 11-29-2024 04:47 PM 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:
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:
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. RE: Flashing HP15CE with linux - blackjetrock - 11-29-2024 05:02 PM No, sorry, I've binned the calculators... RE: Flashing HP15CE with linux - Idnarn - 11-29-2024 05:06 PM (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. RE: Flashing HP15CE with linux - Idnarn - 11-29-2024 05:07 PM (11-29-2024 05:02 PM)blackjetrock Wrote: No, sorry, I've binned the calculators... Ok, sorry to hear that. RE: Flashing HP15CE with linux - AnnoyedOne - 11-29-2024 05:21 PM (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 RE: Flashing HP15CE with linux - Idnarn - 11-29-2024 05:26 PM I'll try BOSSA with one of my calculators, maybe tomorrow. RE: Flashing HP15CE with linux - AnnoyedOne - 11-29-2024 05:30 PM 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 A1 RE: Flashing HP15CE with linux - Idnarn - 11-29-2024 05:50 PM FWIW there is a different BOSSA fork here with SAM4L support: https://sourceforge.net/p/bossa-fork/code/ci/master/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. RE: Flashing HP15CE with linux - Idnarn - Yesterday 03:36 AM (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/Atmel-42023-ARM-Microcontroller-ATSAM4L-Low-Power--1368710.pdf (b) page 5 of https://ww1.microchip.com/downloads/en/Appnotes/Atmel-42051-SAM-BA-for-SAM4L_Application-Note_AT03454.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_to_Use_the_Programming_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/code/ci/master/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:
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:
Flash the "0A0Ah" version of the HP 15C CE firmware from Moravia's website: https://hpcalcs.com/downloads/apps/HP_IAR_USB%20120ms.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:
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:
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.
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 RE: Flashing HP15CE with linux - AnnoyedOne - Yesterday 01:23 PM (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 RE: Flashing HP15CE with linux - AnnoyedOne - Yesterday 02:19 PM Hopefully someone will confirm so that everyone knows (not just them). A1 |