You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
Module::SPIcheckStream is intended to verify the status of a command after it completes. It runs an SPIstatusCommand. However, it calls SPItransferStream with numBytes=0 which means that nothing is returned by SPItransferStream. Setting numBytes=1 fixes the issue (at least for sx1262).
Specifically, here is the call to SPItransferStream:
To reproduce, turn on SPI debugging and observe that on an sx1262 device the normal success status for most commands is 0xA2. Add a printf to SPICheckStream to print spiStatus after the call to SPItransferStream and observe that it has the value 0 from the initialization and not 0xA2.
The text was updated successfully, but these errors were encountered:
Thanks for pointing this out! I'm currently working on a significant rework of the SPI interface to support new radio modules, and this is one of the things that will also be reworked. Looking into my WIP code, I have already used numBytes=1, so this will be fixed once the update is rolled out ;)
Describe the bug
Module::SPIcheckStream is intended to verify the status of a command after it completes. It runs an SPIstatusCommand. However, it calls SPItransferStream with numBytes=0 which means that nothing is returned by SPItransferStream. Setting numBytes=1 fixes the issue (at least for sx1262).
Specifically, here is the call to SPItransferStream:
RadioLib/src/Module.cpp
Line 247 in cfc4259
And here is where data received from the device is copied into the caller-provided buffer, note that it doesn't so anything if numBytes=0:
RadioLib/src/Module.cpp
Line 341 in cfc4259
To reproduce, turn on SPI debugging and observe that on an sx1262 device the normal success status for most commands is 0xA2. Add a printf to SPICheckStream to print spiStatus after the call to SPItransferStream and observe that it has the value 0 from the initialization and not 0xA2.
The text was updated successfully, but these errors were encountered: