Skip to content

weioSPI read_block_data error, when block size > 175 #267

@ementi

Description

@ementi

I am using SPI communication (Port 0) to communicate with a sensor.
I am trying to read a block of 1024 bytes with the read_block_data() function.
It works perfectly for setting block sizes "SPI_FUNC_READ_BLOCK_DATA" <= 175. But if I want to read more, I get the error: (For example with 176 bytes)

read_value = spi.read_block_data(hex_addr)
File "/weio/weioLib/weioSPI.py", line 144, in read_block_data
return list(unpack(receiveFlags, result))
error: unpack requires a string argument of length 177 

(I changed the function a bit, so if I want to read n Bytes the unpack requires a string argument of length n+1, that's why the error says "177" instead of "176")

Is it possible to increment the maximum size of "SPI_FUNC_READ_BLOCK_DATA" to 1024 bytes?

Best Regards
ementi

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions