DGTPi upgrade to Raspberry Pi5

265 views
Skip to first unread message

Ghislain Bourgeois

unread,
Feb 4, 2024, 4:44:32 PM2/4/24
to PicoChess
Hello,

I have received my Raspberry Pi5 and started looking more seriously into porting dgtpicom to it. It will be a more involved than the previous upgrades, as the hardware has changed more significantly this generation. I am starting this thread in case anyone is interested and also looking into this, in the hope of sharing what I learn, and not duplicate efforts.

In the Pi5, most I/O has been moved to a new chip design by Raspberry Pi to handle the peripherals. It is named the RP1 chip, and it uses an older process that lets it handle more current. It will allow Raspberry Pi to move the main CPU to smaller processes faster, as handling the GPIO is separated. There is a datasheet available here: https://datasheets.raspberrypi.com/rp1/rp1-peripherals.pdf

Compared to previous versions, not only has the memory map been changed, but the registers functions are also different. One of the first thing needed in dgtpicom is to set the GPIO pins alternative functions; this is completely different on the Pi5, has each GPIO pin has its own register for this, while previous Pis had multiple GPIO pins controlled from the same register.

Another big difference is that previous Pis had a separate peripheral to handle I2C slave duty (in our case, receiving messages from the clock). The new chip has full I2C peripherals that can act as both master and slave (sending to the clock, and receiving from the clock).

I do not think any of those changes will prevent us from using the Pi5 in a DGTPi, but they will require more changes in the code. My first reflex here is to attempt a complete rewrite, only targeting the Pi5. I am considering doing this rewrite in Rust as it is a language I want to learn.

So, DGTPi upgrade to Raspberry Pi5 will probably take some time still. If anyone in the community is also looking into this, this thread would be a good place to collaborate.

Ghislain

Roy

unread,
Mar 7, 2024, 3:25:11 PM3/7/24
to PicoChess
Hello Ghislain,

Today I obtained a Raspberry Pi 5 myself and can confirm your findings.
The dgtpicom program has to be reimplemented completely.

From what I see in the source code (https://github.com/lucasvdp/dgtpi), it might suffice to create a Python3 program or module using a library like (https://github.com/kplindegaard/smbus2) and integrate this directly into the picochess respository as a drop-in replacement. Later we could directly integrate the functionality into picochess itself.

As I am in the process of porting picochess into docker (https://github.com/Aurora-Beta/picochess-docker), I had to integrate and compile the two other binary programs at build time of the container image, namely the opening book server, the games database and also the now broken dgtpicom-service.

My suggestion would be to reimplement all of these small programs natively in Python3 as part of the picochess repository itself, requiring only one managed runtime.

Kindest Regards!
Reply all
Reply to author
Forward
0 new messages