Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for arm64 and RPi4 model B #284

Merged
merged 2 commits into from
Aug 9, 2019
Merged

Add support for arm64 and RPi4 model B #284

merged 2 commits into from
Aug 9, 2019

Conversation

CreaValix
Copy link
Contributor

@CreaValix CreaValix commented Aug 7, 2019

Hi,
I got pigpio working on my new RPI4 Model B running tumbleweed (arm64!) after some patches.

  1. Detection added.

  2. There is a bug for arm64 in pthSocketThreadHandler.
    You seem to send four integers as base messages.
    These are declared as an array of four uintptr_t and recv() writes 16 bytes directly into that array.
    This works for arm32, where uintptr_t is 32 bit (4×4=16), but breaks arm64 (8×4=32).
    The patch reads 4 uint32_t and places them in the uintptr_t array.
    It is a workaround.

Better also add ntohl()s, as arm can run in LE or BE.

BR Alex Simon

Base messages consist of four uint32 integers.
Wrongly, integers are declared as a four-element uintptr_t array.
The 16 bytes are written directly by recv().
This works great for arm32, but on arm64 uintptr_t is 64 bit (8 bytes).

This patch reads four 32-bit integers and writes them into the uintptr_t
array.
@CreaValix CreaValix mentioned this pull request Aug 7, 2019
@joan2937 joan2937 merged commit 55d8b88 into joan2937:master Aug 9, 2019
@joan2937 joan2937 mentioned this pull request Aug 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants