DGTPi upgrade to Raspberry Pi5

397 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!

Wilhelm

unread,
Apr 2, 2026, 12:08:49 PMApr 2
to PicoChess
Are there any new findings on this? 
According to AI, it would be feasible. 
However, that's beyond my capabilities. 

Best regards, 
Wilhelm

Ghislain Bourgeois

unread,
Apr 2, 2026, 10:26:24 PMApr 2
to pico...@googlegroups.com
I had started some work on this, but life got in the way. I do not
have a lot of time to spend on this, but I'll try to see what I can do
with an agent on this.

I'll try to at least provide some concrete plan that could help
someone with some knowledge and an LLM to push this forward.

Regards,
Ghislain
> --
> You received this message because you are subscribed to the Google Groups "PicoChess" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/picochess/31bf9456-25a0-4969-8da8-fc0446768653n%40googlegroups.com.

Wilhelm

unread,
Apr 3, 2026, 2:55:59 AMApr 3
to PicoChess

“Thank you very much, Ghislain, for taking the time to move the project forward despite the circumstances.”


Best regards, 
Wilhelm

Johan Sjöblom

unread,
Apr 3, 2026, 9:55:39 AMApr 3
to pico...@googlegroups.com
If you create an agent task/step stored in something like "plan.md",... I could see what my agent can do... Time being limited on my side as well, but maybe we can push it forwards...

-- Johan

Ghislain Bourgeois

unread,
Apr 3, 2026, 10:15:09 AMApr 3
to 'Dirk' via PicoChess
I set it out last night, on a multiple phase plan, and it's done with the first phase. I had it start with a refactoring of the code to split the DGT clock protocol and the hardware layer, to make it easier to support different hardware. I need to try it out at later today on my DGTPi running a Pi4 later to make sure it works. Once that's done, I'll let it continue with the next phase.

If this goes well, it should be easy to had support for other boards in the future.

Ghislain

Randy Reade

unread,
Apr 3, 2026, 10:59:32 AMApr 3
to pico...@googlegroups.com
That's great, Ghislain! Thanks for giving some of your time to solving this.

Randy

Ghislain Bourgeois

unread,
Apr 19, 2026, 11:04:33 AM (3 days ago) Apr 19
to pico...@googlegroups.com
Hi,

Some news on this. I have not been successful after 2 weeks of an
agent running directly on a Pi5 with access to a logic analyzer
connected to the pins. The hardware in the Pi5 is very different, and
the agent was not able to go very far. The protocol is not quite I2C,
and that confuses agents to no end. They keep trying to go with what
they know of I2C, and that does not get anywhere.

I have some failed implementations trying to use direct registers
access, the Linux I2C driver or even a software I2C implementation
using bit-banging, and none of them worked. The Linux I2C driver was
the closest, as I was able to see signals being sent out by the Pi5
using the logic analyzer, however I got no reaction from the clock.

I pushed the changes I have to my repo:
https://github.com/ghislainbourgeois/dgtpi

If anyone wants to have a go at it with an agent, there is plenty of
documentation added to it, and the structure is better to separate
hardware access from the rest of the logic. That still worked on my
Pi4, so nothing should be broken for older Pis.

I might try again if I think of something, but for now I am fresh out
of ideas of things to try. Hopefully the refactored code and
documentation can help someone think of something I didn't and move
this further.

Ghislain
> --
> You received this message because you are subscribed to the Google Groups "PicoChess" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to picochess+...@googlegroups.com.
> To view this discussion visit https://groups.google.com/d/msgid/picochess/CAE5Wduvvy8zpCzF%3DPwwAD3%2BE6WSuf4EpUPe6BLXk05SATMXM4g%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages