I’m trying to pass a 16-bit address through microblaze api from Python to the SPI devices via spi_transfer (e.g. device.transfer(temp_addr_str, read_buf, 4)) .
If the address = 0x4880 , after changing it to bytes via address.to_bytes and decode it into a string, it can be sent without error. However, when address = 0x4888, it prompts error as below:
I am a bit confused here.
- shouldn’t the range be 0-255? From rpc.py, line 305 to 309, I do see why it is packed with format ‘b’.PYNQ/rpc.py at master · Xilinx/PYNQ · GitHub . However, to work with ord() , shouldn’t it always be positive?
- in this case, what is the correct method to pre-process the hex number , for example 0x4880, so that it will not throw this error. presumably, 0x4880, is what I need to send out.