RPi.GPIO has not been updated to support Pi 5, which is why you get the message "Cannot determine SOC peripheral base address". But you don't need any explicit GPIO control just delete all the GPIO lines and try again:
Code:
import spidevmanufact_device_id=0x90device_id_reg=0xABstatus_reg2_read=0x35status_reg1_read=0x05write_enable_reg=0x06write_disable_reg=0x04page_program=0x02dummybyte=0x00spi = spidev.SpiDev()spi.open(1,0)spi.max_speed_hz = 50000000spi.mode = 0spi.xfer([write_disable_reg])#Manufacture and device id readsendCommand=[manufact_device_id,dummybyte,dummybyte,dummybyte,0x00,0x00]response=spi.xfer(sendCommand)print(f"Read manufacture id_0x90 : {response}")#device id readresponse=spi.xfer([device_id_reg,dummybyte,dummybyte,dummybyte,0x00])print(f"Read device id_0xAB : {response}")#Read status Register 1 for WEL bit checkresponse=spi.xfer([status_reg1_read,dummybyte])print(f"Read status Register 1 for WEL bit check(before enable):{response}")spi.xfer([write_enable_reg])#Read status Register 1 for WEL bit checkresponse=spi.xfer([status_reg1_read,dummybyte])print(f"Read status Register 1 for WEL bit check(after enable):{response}")#Read status Register 2 for QSPI enable checkresponse=spi.xfer([status_reg2_read,dummybyte])print(f"Read status Register 2 for QSPI enable check:{response}")spi.close()
Statistics: Posted by PhilE — Thu Apr 04, 2024 7:59 am