DWM3000 : What to write to TX_BUFFER

At point 3.1, the user manual explains what the user has to write to the TX Buffer for a transmission. The configuration of the MAC Header seems to be done by the DWM3000. However we cannot find, in the registers, the parameters of the MAC Header like Frame Type (Data, Beacon, Ack…), Sequence Number … described in IEEE802.15.4 standard.
Is it possible to clarify what to write to the TX_Buffer :
a) the MAC Payload (user’s data) and the DWM3000 transmits itself the MAC Header.
b) or the whole PHY Payload (MAC Header + MAC Payload).
In case of (b), I suppose the frame length is : MAC Header length + MAC Payload length + CRC.
Since I do not use the DWM3000 APIs functions, I have to write all the routines completely myself.
Thank you.
GOFFIN David

Short anser:
(b) and yes.

From the user manual:

5.1 MAC level processing in the DW3000
The DW3000 transmits data from the TX_BUFFER in a frame with data length as specified in the TXFLEN field of the TX_FCTRL, inserting the 2-octet FCS as the last two octets of the data payload. The DW3000 will not do any other MAC level transmit processing. It is up to the host system software to prepare the correctly formatted frame conforming to the IEEE802.15.4 standard [1] MAC if this is required.

The description for TXFLEN includes

The value specified by TXFLEN determines the length of the data portion of the transmitted frame. This length includes the two-octet CRC appended automatically at the end of the frame, unless DIS_FCS_TX (in Sub-register 0x00:10 – System configuration) is use to suppress the FCS.

So any MAC level packet header information you want to include must be created by your system and added to the Tx buffer together with your data. However unless you need to interact with other systems or wish to make use of the receive side filtering it’s not required that you conform to the 802.15.4 standard MAC format header. The DW3000 doesn’t care what data format you are transmitting.

The data length you need to set is then the length of the header plus the data (so how much you’ve written into the tx buffer) plus 2 assuming you don’t disable the checksum.

When writing to the Tx buffer you can specify an offset, this allows you to write the header and the data independently if required or only modify one of the two between transmits.