-
Notifications
You must be signed in to change notification settings - Fork 413
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CC1101::receive will always return ERR_RX_TIMEOUT #348
Comments
@Guglio95 |
Hello @asafteirobert, As the datasheet states, it It's true that the datasheet says nothing about de-asserting on the packet end, but it should be de-asserted since the driver read all the packet bytes. |
I'm talking about the simple blocking CC1101::receive. Are there interrupts I'm not seeing?
|
Hello @asafteirobert The (working) revision I was using did non contain that waiting-part. Did you try to get rid of it? |
I remember writing that in one of the very first versions of the CC1101 driver, when (as @asafteirobert correctly pointed out), Digging through the commit history, it seems like that what happened was that there were to PRs from @Guglio95 (/ the RFQuack team as a whole):
So long story short, I should probably do more thorough reviews of PRs. |
@asafteirobert it seems that presence of a second waiting loop is indeed the cause of blocking receive always returning ERR_RX_TIMEOUT, removing it solved this particular issue. Though it still seems that sometimes, CC1101 receives garbage packets as reported in #345, so this is unrelated. Should be fixed now, thanks for looking into this! |
* 'master' of git://github.com/jgromes/RadioLib: (83 commits) [nRF24] Added interrupt-driven examples [AX.25] Added option to adjust audio frequencies (jgromes#346) [MQTT] User SerialModule wrapper [HTTP] User SerialModule wrapper [XBee] Use SerialModule wrapper [JDY08] Use SerialModule wrapper [HC05] Use SerialModule wrapper Added SerialModule wrapper class (jgromes#305) [CC1101] Fixed blocking receive always returning timeout (jgromes#348) [CC1101] Added 0x17 as valid version number (jgromes#349) Added AFSK via OOK example Bump version to 4.5.0 [Si443x] Fixed rxosr calculation (jgromes#199) [Si443x] Added antenna switching on GPIO0/1 [Si443x] Fixed preamble configuration (jgromes#199) [Si443x] Added software reset [PHY] Fixed negative random numbers (jgromes#328) [RF69] Renamed TRNG method [RF69] Renamed TRNG method [SX126x] Renamed TRNG method ...
Describe the bug
CC1101::receive
will always returnERR_RX_TIMEOUT
.This is because GDO0 will always stay high after a packet is received.
I have tracked it down to this change.
https://github.com/jgromes/RadioLib/pull/279/files#diff-8f4be18065fcaf0dcbf0cc902df2a1669a8dc78b86f344d2c0a3804d09b8240dR331
CC1101_REG_IOCFG0
was changed fromCC1101_GDOX_SYNC_WORD_SENT_OR_RECEIVED
(0x06) toCC1101_GDOX_RX_FIFO_FULL_OR_PKT_END
(0x01) which seems to be causing the issue.According to the datasheet 0x01 "De-asserts when the RX FIFO is empty." it says nothing about de-asserting on packet end. Maybe there was some confusion from the name and comment for
CC1101_GDOX_RX_FIFO_FULL_OR_PKT_END
?The behavior of 0x01 causes CC1101::receive to time out while waiting for packet end, since GDO0 won't actually de-assert on packet end.
To Reproduce
Run
CC1101_Transmit.ino
andCC1101_Receive.ino
from the examples.CC1101_Receive.ino
won't printData: Hello World!
as expected.Replacing
CC1101_GDOX_RX_FIFO_FULL_OR_PKT_END
withCC1101_GDOX_SYNC_WORD_SENT_OR_RECEIVED
inCC1101::startReceive
causes theHello World
packets to be received, but I'm also receiving a lot of junk data, so the fix is likely more complicated.Expected behavior
When running
CC1101_Transmit.ino
andCC1101_Receive.ino
,CC1101_Receive.ino
should correctly receive the hello world packets and not anything else.Additional info:
The text was updated successfully, but these errors were encountered: