jperkin / node-rpio

Raspberry Pi GPIO library for node.js
859 stars 124 forks source link

Raspberry Pi Compute Module 4 Rev 1.0 #134

Closed JesperNaarttijarvi closed 3 years ago

JesperNaarttijarvi commented 3 years ago

Does it work for the CM4? I get an error when trying to adapt our CM3 implementations to the CM4. I can't read the PN532 module via node anymore.

Board: Raspberry Pi Compute Module 4 Rev 1.0 Hardwar: BCM2711

jperkin commented 3 years ago

The code should match and enable the 200-pin pinmap, but I don't know if there were any changes since the CM3.

Unfortunately I don't have any CM boards to test on.

JesperNaarttijarvi commented 3 years ago

I'll try to dive deeper into it and see if I find exactly where the problem lies, how ever might not be skilled enough to find it.

jperkin commented 3 years ago

The pinmap is here: https://github.com/jperkin/node-rpio/blob/master/lib/rpio.js#L232-L334

It'll be a case of finding the GPIO documentation for the BCM2711 and then validating that the map between physical pin and gpio pin is correct, then if wrong try plumbing in the correct values and see if it works.

JesperNaarttijarvi commented 3 years ago

That was the indeed the problem. For anyone interested in a quick fix, here is the pinout i used for cm4.

`/*

jperkin commented 3 years ago

Thanks, do you have a reference for this?

JesperNaarttijarvi commented 3 years ago

I found the pin out in the official datasheet and mapped the GPIO ports. It starts on page 14

jperkin commented 3 years ago

Ah perfect, thanks, I'll add proper support for this shortly.

jperkin commented 3 years ago

Released in version 2.4.0, many thanks!

JesperNaarttijarvi commented 3 years ago

Nice, will try to update next week and see if it works.