-
Notifications
You must be signed in to change notification settings - Fork 2k
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
cc110x: not working since SPI driver interface rework #6857
Comments
Hi, sorry for the late reply! Just did a little digging into the driver: when I introduced some delays into the @kaspar030: would you mind to have a quick look? |
to go more specific, inserting a simple |
Hi, the loop do {
res1 = spi_transfer_reg(dev->params.spi, SPI_CS_UNDEF,
(addr | CC110X_READ_BURST), CC110X_NOBYTE);
res2 = spi_transfer_reg(dev->params.spi, SPI_CS_UNDEF,
(addr | CC110X_READ_BURST), CC110X_NOBYTE);
} while (res1 != res2); in |
|
Let me summarize what I figured out so far:
Update: Wrong data sheet. The chip is the CC1100, not CC1101. Reading the register twice until getting the same value twice is the suggested workarround. |
Hi again, this little patch will get the device stop from hanging by using the status byte instead of reading the register: diff --git a/drivers/cc110x/cc110x-rxtx.c b/drivers/cc110x/cc110x-rxtx.c
index bbe216d..2dc1a44 100644
--- a/drivers/cc110x/cc110x-rxtx.c
+++ b/drivers/cc110x/cc110x-rxtx.c
@@ -177,9 +177,10 @@ static void _tx_continue(cc110x_t *dev)
return;
}
- int fifo = 64 - cc110x_get_reg_robust(dev, 0xfa);
+ uint8_t status = cc110x_strobe(dev, CC110X_SNOP);
+ int fifo = status & 0x0f;
- if (fifo & 0x80) {
+ if ((status & 0x70) == 0x70) {
DEBUG("%s:%s:%u tx underflow!\n", RIOT_FILE_RELATIVE, __func__, __LINE__);
_tx_abort(dev);
return; However, this approach is suboptimal: The status bytes contains the number of free bytes in case this value is less than 15. If 15 or more bytes are available, the value 15 will be given. If reading the TXBYTES from the status register would not result such headaches, the efficiency would be greatly increased. (The above patch has never been tested. And at the very least using the SNOP approach should be implemented in a loop which write 15 Bytes chunks until the packet is written or the FIFO is full, which is not done.) I'll have a look into it again sometime this week. Kind regards, |
since MSBA2 + Networking means cc110x and all the later discussion in this thread is about cc110x I adapted the issue title accordingly. |
Btw: In the TI forum it is suggested to verify the SPI communication. I had no time to do that so far, but a wrong SPI configuration could easily explain the issue at hand. |
TI doesn't know about us :( how very hurtful ^^ |
But Nordic does ;-) |
I know :-) |
(well that Tutorial was written by @kaspar030, but regardless: we know that they know about us ;-)) |
The documentation says:
I don't fully understand that. But lets assume that when changing to RX mode, the CC1100 expects data on falling edge, otherwise on rising edge. However, the driver expects SPI to work on rising edge only. So when reading the TX_BYTES register, reading always fails. Lets look into the DEBUG output:
So a I'll try to find some time to dig deeper into it. But some help would be nice. Maybe someone can explain me in which cases the Chip will switch to falling edge, as I don't understand the documentation in this point? Kind regards, |
Maybe, if they find time @haukepetersen or @OlegHahm can help you with that? |
Fixed in PR #9154 |
#9154 has been merged. Let's close this one. |
Since #4780 I cannot use networking on the msba2 board. I used the gnrc_networking example on two msba2 boards and I can't even access the shell anymore because the code in the
main()
is not reached. Possibly this is an issue/task for #6437.Used example: gnrc_networking
With 513b20f:
With b101c70 (commit right before):
The text was updated successfully, but these errors were encountered: