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

ask about this BUG the SPIM: An additional byte is clocked out when RXD.MAXCNT = 1

Dear nordic employee

when I use the spim to send 1 byte address to read it's value(4 bytes)

nrf_drv_spi_transfer(&spi,headerBuffer,(uint8_t)headerLength,readBuffer,(uint8_t)readlength);    headerLength=1;      readlength=4;

I get the problem like the title says

I try to solve it

so I DO like this :spi_pan58_workaround_sdk12.zip(which Referred here

but when I try to read 4byte data(with 1 byte address write),the result is 00 00 00 00(it should be 12 02 33 44 )

where is wrong ?

thank you!

  • hello Sigurd

    12 02 33 44 is the slave device ID(which is fixed

    1、now ,I cannot gei the right result yet after add the ppi and gpiote(MY sdk is 13.1,and I add the code according to the spi_pan58_workaround_sdk12.zip,all code between ### Workaround Section Start and ### Workaround Section end in mian.c

    so do you have a project which is spi ok(with soft device is better )?

    I have the 《spi_pan58_workaround_sdk12.zip》

    but I cannot build it successfully ,it has some mistake

    2、I saw here (when send one byte) nrf_drv_gpiote_in_event_enable(SPI_SCK_PIN, false);// Enable the GPIOTE output pin task. the false is right ?should I change it to be ture?

    best regards for you!

  • I am also facing the same issue. I added the workaround code in SDK 14. Iam using nrf52840. I am sending 0x8F to read the WHO_AM_I and I am receiving 0x00 instead of 0x6A.

  • I just want to add here that if you're just trying to send a single byte out to a peripheral in order to set a register or something, you can just do the following:

    nrf_drv_spi_transfer(&m_spi_master_0, spiTransmitBuffer, 1, NULL, 0);

    Not sure why this isn't documented well anywhere.

Related