DW3000 Extend frame

Hi Qorvo team,

I used DWT_PHRMODE_EXT to transmit longer frames but DW3000 sent the wrong frames for lengths over 256 bytes.
Here is the configuration of DW3000.

static dwt_config_t config = {
    5,                /* Channel number. */
    DWT_PLEN_1024,     /* Preamble length. Used in TX only. */
    DWT_PAC32,        /* Preamble acquisition chunk size. Used in RX only. */
    9,                /* TX preamble code. Used in TX only. */
    9,                /* RX preamble code. Used in RX only. */
    0,                /* 0 to use standard 8 symbol SFD, 1 to use non-standard 8 symbol, 2 for non-standard 16 symbol SFD and 3 for 4z 8 symbol SDF type */
    DWT_BR_850K,       /* Data rate. */
    //DWT_PHRMODE_STD,  /* PHY header mode. */
    DWT_PHRMODE_EXT, 
    DWT_PHRRATE_STD,  /* PHY header rate. */
    (1024 + 1 + 8 - 32),/* SFD timeout (preamble length + 1 + SFD length - PAC size). Used in RX only. */
    DWT_STS_MODE_OFF, /* No STS mode enabled (STS Mode 0). */
    DWT_STS_LEN_64,   /* STS length, see allowed values in Enum dwt_sts_lengths_e */
    DWT_PDOA_M0       /* PDOA mode off */
};

This is what I trying to transmit, it is a total of 294bytes without FCS_LEN.

static uint8_t tx_msg[] = { 
  0xC5, 0, 'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E',
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A', 'W', 'A', 'V', 'E', 
  'D', 'E', 'C', 'A'
};

However, DW3000 received the wrong frame, as shown in the picture below.
image

I tried using DW1000 to transmit the same frame, and DW3000 received the correct frame, indicating a tx bug.

Is there any way to fix this problem?

Hi @TanZhiWei ,

This is due to the fact that nRF SPI is limited to maximum 256 bytes in each transaction, so tx_buffer_length is coded on 8 bits.
In addiction to that if you’re using DW3_QM33_SDK available in Qorvo website, you may see that in the HAL_SPI the SPI R/W buffer is limited to 200 bytes (See idatabuf and itempbuf).
The solution to resolve your issue is to write to the dw3000 register in multiple spi transactions (say by 50 bytes).

Hope it helps,
Wassim

Hi @Wassim_Qorvo,

Thanks for the reply.
I am using the function dwt_writetxdata to write the data.
Is that possible to call it multiple times to write the longer data?

Hi @TanZhiWei ,

Yes, it can be code similar to this:

    for (int i = 0;i<spi_sections;i++)
    {
        dwt_writetxdata(spi_section_size + 2, (uint8_t *)&pTcfmMsg->payload + (i * spi_section_size), i * spi_section_size );
    }

    dwt_writetxdata(last_spi_section_size + 2, (uint8_t *)&pTcfmMsg->payload + (spi_sections * spi_section_size), spi_sections * spi_section_size);

    dwt_writetxfctrl(pTcfmMsg->msg_len, 0, 0);

where spi_section_size = 50

1 Like

HI @Wassim_Qorvo,

It works perfectly!!
Thank you very much.

1 Like