From efbbe216c6bb607922b969bf6b888e0823d66652 Mon Sep 17 00:00:00 2001 From: Peter Wallace Date: Thu, 28 Nov 2024 12:59:39 -0800 Subject: [PATCH] 32 bit SPI access fails on RPI5 so for now force 8 bit SPI mode --- spi_boards.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/spi_boards.c b/spi_boards.c index d0b29db..0a7918e 100644 --- a/spi_boards.c +++ b/spi_boards.c @@ -98,13 +98,17 @@ int spi_boards_init(board_access_t *access) { } spidev_set_lsb_first(sd, false); spidev_set_mode(sd, 0); - if (spidev_set_bits_per_word(sd, settings.bits_per_word) < 0) - { - fprintf(stderr,"unable to set bpw32, fallback to bpw8\n"); + // Either the following test fails on SPI5 or theres an issue with 32 bit SPI access + // so... disable 32 bit access for now. + // The cost of forcing 8 bit access is minor as it only slows flashing/verification. + // So, for now, just force 8 bit access for everyone. + // if ((spidev_set_bits_per_word(sd, settings.bits_per_word) < 0) + // { + // fprintf(stderr,"unable to set bpw32, fallback to bpw8\n"); canDo32 = false; settings.bits_per_word = 8; spidev_set_bits_per_word(sd, settings.bits_per_word); - } + // } spidev_set_max_speed_hz(sd, settings.speed_hz); return 0;