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

Increase amount of write bytes to SPI devices over 65535 #383

Closed
mores opened this issue Sep 16, 2024 · 2 comments
Closed

Increase amount of write bytes to SPI devices over 65535 #383

mores opened this issue Sep 16, 2024 · 2 comments

Comments

@mores
Copy link
Contributor

mores commented Sep 16, 2024

When trying to send large amounts of data to SPI device, users will see:
2024-09-15 17:24:14,183 WARN [PiGpioNativeImpl:263] () PIGPIO ERROR: PI_BAD_SPI_COUNT; bad SPI count

This is the largest buffer size this library will allow:

#define PI_MAX_SPI_DEVICE_COUNT (1<<16)
https://github.com/joan2937/pigpio/blob/c33738a320a3e28824af7807edafda440952c05d/pigpio.h#L726

   if (count > PI_MAX_SPI_DEVICE_COUNT)
      SOFT_ERROR(PI_BAD_SPI_COUNT, "bad count (%d)", count);
https://github.com/joan2937/pigpio/blob/c33738a320a3e28824af7807edafda440952c05d/pigpio.c#L4854C1-L4855C61

Break up large data into smaller chunks that can be sent to the SPI device.

@FDelporte
Copy link
Member

FDelporte commented Sep 16, 2024

See discussion #377

@eitch
Copy link
Member

eitch commented Sep 17, 2024

Fix applied through merge #384

@eitch eitch closed this as completed Sep 17, 2024
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

No branches or pull requests

3 participants