Yes, I was able to connect a Nordic nRF24L01 radio to the Quark D2000 Board. The driver code including a couple of simple examples is here: https://github.com/skiselev/rf24-qmsi GitHub - skiselev/rf24-qmsi: RF24 port for Intel QMSI
I likely need document it :-)
The API is similar to the Arduino nRF24L01 library API. Copy files from the "board" directory to the "bsp/board" in your QMSI project, and use main.c and Makefile files from the examples directory as a starting point.
Thanks for your reply.
I see the comment in your code:
/* Use GPIO for slave select due to bug in DesignWare SPI */
/* qm_pmux_select(QM_PIN_ID_0, QM_PMUX_FN_2);*/ /* SS0 */
And I thought, that my device doesn't work because of the same bug
I have added gpio controlled ChipSelect routines too, but wthout success. I'm trying to run SX1272 radio. And I should read register from it like below:
uint8_t readRegister(uint8_t addr)
spi_buf = addr & 0x7F;
spi_buf = 0xFF;
polled_xfer_desc.tx = spi_buf;
polled_xfer_desc.rx = rx_buf;
polled_xfer_desc.tx_len = 2;
polled_xfer_desc.rx_len = 2;
qm_spi_transfer(QM_SPI_MST_0, &polled_xfer_desc, &status);
But 0x00 returns any time
It is difficult to tell why it is not working. Your read register code looks good to me. Did you configure SPI, GPIOs, and pinmux'es? See rf24_init() function in board/drivers/rf24/rf24.c. Otherwise it would be interesting to see the picture from oscilloscope/logic analyzer.
Yes, SPI configured and works with loopback mode.
There's Semtech's read register function below:
void SX1272ReadBuffer( uint8_t addr, uint8_t *buffer, uint8_t size )
//NSS = 0;
GpioWrite( &SX1272.Spi.Nss, 0 );
SpiInOut( &SX1272.Spi, addr & 0x7F );
for( i = 0; i < size; i++ )
buffer[i] = SpiInOut( &SX1272.Spi, 0 );
//NSS = 1;
GpioWrite( &SX1272.Spi.Nss, 1 );
Yes, that function makes sense. I am still wondering if there is an issue on the electrical or pin/SPI configuration side. It would be interesting to see that NSS indeed goes low before each SPI transfer. And then, if possible to observe other SPI signals. Even if you don't have a scope, a multimeter with frequency measurement function might do (if you run the SPI transfer in loop).
I checked the MISO, MOSI lines by oscilloscope, and no any data transfer. After that I found the bug. Forgot to add this lines:
qm_pmux_select(QM_PIN_ID_17, QM_PMUX_FN_2); /* MOSI */
qm_pmux_select(QM_PIN_ID_18, QM_PMUX_FN_2); /* MISO */
I thought, that RXD and TXD means UART and didn't add them in my code.