Post Reply 
Building WP 34S / 31S with Docker
03-24-2024, 10:47 AM
Post: #1
Building WP 34S / 31S with Docker
Although it is said that "the WP 34S project is effectively shut down at this point", an open source project can always be revived. With old code often comes the problem of an ancient toolchain that won't run on modern systems anymore. Over the years I started to create Docker images for various projects that contain all tools to build the software (ideally reproducible, but I'm happy when it compiles at all). Well, here is the …


So far it is just the Dockerfile that allows you to build the Docker image yourself (I haven't checked all licenses to see if redistribution of all software is allowed, but I assume it is). As usual for most Docker images, it is based on a Linux environment (Ubuntu 22.04) and includes Wine and the Yagarto 4.6.0 compiler as described in the "Compiling WP 34S / 31S on Linux" documentation. I skipped the CodeSourcery part because compilation was quick enough on my system.

How does it work? You start the container and mount your local source tree. I prefer to keep local and container files isolated, so I mounted it read-only and copied the files into a new working directory.

Code:
host> docker run -it --rm --name wp34s-builder -v /path/to/source:/wp-src:ro wp34s-builder
container> cp -a /wp-src wp
container> cd wp/trunk
container> make REALBUILD=1

After a few seconds you can find the firmware images in the realbuild subdirectory. You can copy it from the container to your host system by running:

Code:
host> docker cp wp34s-builder:/wp/trunk/realbuild/calc.bin .

I haven't spent much time improving and automating the build process (it could be much easier). Right now it doesn't parse the revision number because I haven't included SVN or Git (and haven't checked if svnversion works after copying the directory).

I guess right now there's nobody actually working with the source anymore. With this simplified build process there might be a chance that more people start modifying and extending WP 34S.
Visit this user's website Find all posts by this user
Quote this message in a reply
03-24-2024, 04:43 PM
Post: #2
RE: Building WP 34S / 31S with Docker
Today, I wanted to find out if anyone has created a WP34S-related repository on GitHub, and then I stumbled upon your project just a few hours ago before reading this article. To my surprise, I saw that the author's modification time was two hours ago.

For the past few days, I have been searching for discussions about WP34S on the forums, and I noticed that the closer it gets to today, the fewer related discussions there are. This made me worry that this excellent project would slowly sink into the vast ocean of the internet filled with countless new information. I'm glad to see that there are still people activating it in various ways.

I'm not particularly familiar with Docker, and I'm wondering if I can run your build process on macOS? Thank you!
Find all posts by this user
Quote this message in a reply
03-25-2024, 06:32 PM (This post was last modified: 03-25-2024 06:33 PM by johnb.)
Post: #3
RE: Building WP 34S / 31S with Docker
Thanks for this update, and for the work you're doing!

I don't think I will launch into WP34 development quite yet, but one never knows.

On the other hand, "now" is always the best time for someone to help ANY tool chain avoid obsolescence. You never know when a latecomer will arrive, wanting to revive an old project!


[Ob. disclosure: this happened to me just recently. I discovered the Ti-89 Titanium, which, for a non-HP, is a surprisingly okay calculator, sort of. I had thoughts of RPN-izing it and adding one of my pet project items as a "native, built in" feature. Nope. I would end up spending months on recreating an as-lost-as-Atlantis tool chain before I could even begin to write helloworld.exe. The project was dead before it started. This is not the only time that's happened due to the dev environment disappearing.]

Daily drivers: 15c, 32sII, 35s, 41cx, 48g, WP 34s/31s. Favorite: 16c.
Latest: 15ce, 48s, 50g. Gateway drug: 28s found in yard sale ~2009.
Find all posts by this user
Quote this message in a reply
03-26-2024, 07:45 PM
Post: #4
RE: Building WP 34S / 31S with Docker
After some attempts, I finally managed to successfully construct the calc.bin using the method provided by the author of this article. Of course, the first step was to generate a Docker image, and then launch the image to perform the compilation work within the container. The process went very smoothly, with only a few warning messages. Within just a few seconds, the target file was generated. In this way, this outstanding project will never perish!

Subsequently, I encountered another dilemma: how can I flash this compiled firmware into my WP34S emulator on my macOS?
Find all posts by this user
Quote this message in a reply
03-26-2024, 09:18 PM
Post: #5
RE: Building WP 34S / 31S with Docker
(03-26-2024 07:45 PM)FreeBlues Wrote:  how can I flash this compiled firmware into my WP34S emulator on my macOS?
You cannot. The firmware is compiled for the WP-34s hardware. The emulator is linked with the same C code but compiled for MacOS.
Find all posts by this user
Quote this message in a reply
03-26-2024, 09:20 PM (This post was last modified: 03-26-2024 09:23 PM by SammysHP.)
Post: #6
RE: Building WP 34S / 31S with Docker
(03-26-2024 07:45 PM)FreeBlues Wrote:  Subsequently, I encountered another dilemma: how can I flash this compiled firmware into my WP34S emulator on my macOS?

I already gave some hints in my comment on GitHub. You need
  • An FTDI USB-TTL adapter (in my tests it only worked with the FTDI adapter unfortunately. Timing appears to be very important.)
  • A pogo pin adapter, not sure if you can still find one commercially available. I made my own.
  • A supported computer – for some reason it didn't work on some of my computers. Checked various USB related properties and they even share the same Arch Linux. Weird.
  • An old version of Qt4 and Linux – but it might also work under macOS.

edit: Oh, just noticed you were talking about the emulator! That's a different build target. The Docker image is for building the firmware for the physical hardware (HP 20B / 30B).
Visit this user's website Find all posts by this user
Quote this message in a reply
03-26-2024, 09:39 PM
Post: #7
RE: Building WP 34S / 31S with Docker
(03-26-2024 09:20 PM)SammysHP Wrote:  [*]An old version of Qt4 and Linux – but it might also work under macOS.
[/list]
It should work under macOS and sometimes I managed to do so.
But it has never been reliable.

I wrote wp34sflashcmd (as far as I remember) but I prefer to use the original MySamBa program in a Windows virtual machine.
They send the same byte over the serial port at the same speed, the source code of wp34sflashcmd is derived of MySamba but for some reason, there are differences and I never found them.
Find all posts by this user
Quote this message in a reply
03-26-2024, 09:46 PM (This post was last modified: 03-26-2024 09:46 PM by SammysHP.)
Post: #8
RE: Building WP 34S / 31S with Docker
I try to avoid Windows as much as possible. Wink So far I flashed my couple HP 20B about 20 times in total. Once I found a working combination of PC and USB-TTL adapter it worked every time with wp34sflashcmd. In my opinion it works absolutely fine, good job!
Visit this user's website Find all posts by this user
Quote this message in a reply
03-27-2024, 07:43 AM
Post: #9
RE: Building WP 34S / 31S with Docker
(03-26-2024 09:18 PM)pascal_meheut Wrote:  
(03-26-2024 07:45 PM)FreeBlues Wrote:  how can I flash this compiled firmware into my WP34S emulator on my macOS?
You cannot. The firmware is compiled for the WP-34s hardware. The emulator is linked with the same C code but compiled for MacOS.

Thank your for providing the info, which has saved me a great deal of time that would have been spend on confirmation searches.
Find all posts by this user
Quote this message in a reply
03-27-2024, 07:44 AM
Post: #10
RE: Building WP 34S / 31S with Docker
(03-26-2024 09:20 PM)SammysHP Wrote:  
(03-26-2024 07:45 PM)FreeBlues Wrote:  Subsequently, I encountered another dilemma: how can I flash this compiled firmware into my WP34S emulator on my macOS?

I already gave some hints in my comment on GitHub. You need
  • An FTDI USB-TTL adapter (in my tests it only worked with the FTDI adapter unfortunately. Timing appears to be very important.)
  • A pogo pin adapter, not sure if you can still find one commercially available. I made my own.
  • A supported computer – for some reason it didn't work on some of my computers. Checked various USB related properties and they even share the same Arch Linux. Weird.
  • An old version of Qt4 and Linux – but it might also work under macOS.

edit: Oh, just noticed you were talking about the emulator! That's a different build target. The Docker image is for building the firmware for the physical hardware (HP 20B / 30B).

Yes, I plan to first test the firmware that I have compiled on the emulator because I only have one real machine.
Find all posts by this user
Quote this message in a reply
03-27-2024, 11:51 AM
Post: #11
RE: Building WP 34S / 31S with Docker
(03-24-2024 04:43 PM)FreeBlues Wrote:  Today, I wanted to find out if anyone has created a WP34S-related repository on GitHub, and then I stumbled upon your project just a few hours ago before reading this article. To my surprise, I saw that the author's modification time was two hours ago.

For the past few days, I have been searching for discussions about WP34S on the forums, and I noticed that the closer it gets to today, the fewer related discussions there are. This made me worry that this excellent project would slowly sink into the vast ocean of the internet filled with countless new information. I'm glad to see that there are still people activating it in various ways.

If we live on through our children, then the WP34S is very much alive! Both the WP43 and C47 calculator projects for the SwissMicros DM42 hardware used the WP34S code as their starting point; there is also a port of the WP34S itself to the same hardware (with a few added features) so the fact that the original hardware is no longer manufactured is not a disaster.

The WP34S Sourceforge repository is still updated with any bug fixes that turn up (up to release 3924 now), and the code still compiles, both for the calculator and the Windows emulator. A couple of new features were added in the past six months - the ability to enter more than 12 digits in integer modes, so long as the 64-bit limit is not exceeded, and an improved algorithm for converting decimals to fractions. There is a limit to what can be added as flash space is limited, and it's important to leave room for user programs. I think that the small number of bug fixes and updates reflects not a lack of interest, but the success of the project. There really isn't that much to add or to fix!

It is good to see this Docker image for building the firmware. I hope more people will be encouraged to experiment.

Nigel (UK)
Find all posts by this user
Quote this message in a reply
03-27-2024, 03:41 PM
Post: #12
RE: Building WP 34S / 31S with Docker
(03-27-2024 11:51 AM)Nigel (UK) Wrote:  
(03-24-2024 04:43 PM)FreeBlues Wrote:  Today, I wanted to find out if anyone has created a WP34S-related repository on GitHub, and then I stumbled upon your project just a few hours ago before reading this article. To my surprise, I saw that the author's modification time was two hours ago.

For the past few days, I have been searching for discussions about WP34S on the forums, and I noticed that the closer it gets to today, the fewer related discussions there are. This made me worry that this excellent project would slowly sink into the vast ocean of the internet filled with countless new information. I'm glad to see that there are still people activating it in various ways.

If we live on through our children, then the WP34S is very much alive! Both the WP43 and C47 calculator projects for the SwissMicros DM42 hardware used the WP34S code as their starting point; there is also a port of the WP34S itself to the same hardware (with a few added features) so the fact that the original hardware is no longer manufactured is not a disaster.

The WP34S Sourceforge repository is still updated with any bug fixes that turn up (up to release 3924 now), and the code still compiles, both for the calculator and the Windows emulator. A couple of new features were added in the past six months - the ability to enter more than 12 digits in integer modes, so long as the 64-bit limit is not exceeded, and an improved algorithm for converting decimals to fractions. There is a limit to what can be added as flash space is limited, and it's important to leave room for user programs. I think that the small number of bug fixes and updates reflects not a lack of interest, but the success of the project. There really isn't that much to add or to fix!

It is good to see this Docker image for building the firmware. I hope more people will be encouraged to experiment.

Nigel (UK)

Indeed, the code of WP34S serves as a solid foundation for C47, and it continues its lifecycle in this manner. However, what I would like to express is that as a mature project that has been iterated over 3924+11 times, it can not only serve as the basis for other projects but also play a greater role on its own.
I am delighted by your participation and guidance, which has inspired me to try it out for myself. I then proceeded to flash the firmware, set up the environment to compile the firmware, and resolved a few minor issues. Ultimately, I successfully flashed the firmware, transforming an HP-30B into the legendary WP34S (something I never dared to imagine I could accomplish), and also successfully compiled the firmware. These were all very enjoyable attempts.
Recently, I have been contemplating what I could do to attract more people's interest in this project. My own journey began with the Chinese version of the WP34S user manual, which sparked my various attempts.
Find all posts by this user
Quote this message in a reply
Post Reply 




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