Sunday, March 23, 2025

Raspberry Pi running BASIC

Earlier on this blog, I posted something about the BASIC language on Linux. 

It turns out that all the tools mentioned in this posting are available on Raspberry Pi computers too. In fact, BWBASIC, FreeBasic and Geany work in the exact same way.


Raspberry Pi zram swap

Raspberry Pi computers may not always have the best amount of RAM available. For small embedded applications, this is just perfect, no precious ram wasted by remaining empty.
However, depending on the application, more memory might be required. The fallback would be virtual memory. In big server installations, swap is not even a topic. However, if an SD-card is were the files live on, SWAP is somewhat out of the picture.

If CPU power is not an issue, ZRAM might be a solution of the RAM-shortage of an RPi-application. 
While my RPi500 has plenty of RAM, I installed ZRAM anyways.
This is what my present memory situation looks like:

               total        used        free      shared  buff/cache   available
Mem:         8131616      835544     6173708      103560     1315828     7296072
Swap:        4270584           0     4270584

NAME       ALGORITHM DISKSIZE DATA COMPR TOTAL STREAMS MOUNTPOINT
/dev/zram0 lzo-rle       3.9G   4K   80B   12K       4 [SWAP]

NAME       TYPE      SIZE USED PRIO
/dev/zram0 partition 3.9G   0B  100
/var/swap  file      200M   0B   -2

And yes, the RPi500 is equipped with 8GB of RAM and 4 CPU cores. 
Presently I would not know how to fill up all the memory available to me.

Raspberry Pi 500 USB boot

There seems very little information on the internet on the Raspberry Pi 500. I love the RPi400, so, how could I resist to purchase an RPi500? I got the whole package, including mouse, PSU and the book.

The RPi500 comes preinstalled with a micro-SD, no surprise here. I am not a big fan of running my OS on SD-cards. So, I ordered a USB3 to SATA adapter to go with the 500. Of course my intention was to use an SSD in this setup. However, I was curious if the RPi500 could handle an spiny-disk-device. And yes, it can. Here is what I did:

Boot the RPi500 with the SD-card. Use the tool "SD Card Copier" to copy the contents of a Seagate Expansion external USB3 HDD. Surprise surprise, it worked. Once the SD-card was copied to the HDD, I shut down the RPi500 and removed the SD-card. Switching back on booted right away from the hard-drive. Of course a spiny disk does not provide a very snappy experience, but it worked. The SPi500 was able to supply the spiny disk, however, the temperature of the keyboard-computer was slightly elevated; not to an alarming level, however noticeable. 

While I call the exercise a success, I went back to the original plan and replaced the HDD with a (Kingston) SSD drive. This was done by simply using the "SD Card Copier" to copy the HDD content to the SSD.
The RPi500 runs a lot cooler and snappier now, who would have though?

Contrary to the actions one had to perform with the Raspberry Pi 4 generations, not strange commands are needed to boot the RPi5 generation using USB devices.