This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Can't transmit single byte over SPIM with DMA

Hi,

We are trying to transmit a single byte over SPIM using easyDMA but our logic analyzer shows that 16 bits are being clocked out. The first 8 are our message and the second 8 are unknown (possibly the over-read char?). This can be reproduced with the spi_master example in the nrf52 0.9.1 SDK by enabling DMA and configuring 1 byte transmissions:


spi_master/main.c

Replace line 42 with: #define TX_RX_MSG_LENGTH 1

spi_master/config/spi_master_pca10036/nrf_drv_config.h

Replace line 128 with: #define SPI0_USE_EASY_DMA 1

Replace line 138 with: #define SPI1_ENABLE 0

patchfile: spi_master.patch


The project will now attempt to send the byte 0x00 over spi with easyDMA.

Logic trace of what we are seeing.: SPIM_EasyDMA_1Byte_Tx.logicdata image description

Any Idea what is happening here and how we might be able to send 1 byte over SPI & DMA without the 8 extra clock cycles?

Parents
  • Hi

    So sorry for the late response. It seems like you have found a product anomaly. We are working on it, but currently we have not found any workarounds.

  • Hello I came across this post and am having the same issue. I was wondering if you have found any solutions? What I noticed was that the CS signal goes low and then stays low when I try to send 8 bits in a format such as:

    uint8_t bytebuffer = 0x4E;

    spi_send_recv(&bytebuffer, NULL, 1);

    However if I set the length to 2, the CS behaves normally. But the functionality that I need requires 8 bits to be sent with only 8 clock cycles and then the CS should go high after the 8th. Which i haven't been able to find a way to do yet using the nRF52 Preview DK. If you could let me know about any progress on this issue or how to solve it, it would be appreciated. Thanks

Reply
  • Hello I came across this post and am having the same issue. I was wondering if you have found any solutions? What I noticed was that the CS signal goes low and then stays low when I try to send 8 bits in a format such as:

    uint8_t bytebuffer = 0x4E;

    spi_send_recv(&bytebuffer, NULL, 1);

    However if I set the length to 2, the CS behaves normally. But the functionality that I need requires 8 bits to be sent with only 8 clock cycles and then the CS should go high after the 8th. Which i haven't been able to find a way to do yet using the nRF52 Preview DK. If you could let me know about any progress on this issue or how to solve it, it would be appreciated. Thanks

Children
No Data
Related