Other Parts Discussed in Thread: IWR1243, UNIFLASH, AWR1243, AWR1443
Hello,
I have tried to port the DFP example code <mmwavelink_example> in DFP version 01_00_00_01, to a STM32 microcontroller, but unfortunately I have some issues with the implementation so the code doesn't really work as expected.
I am using an IWR1443, to which I have loaded the "xwr12xx_masterss.bin" and the "xwr12xx_xwr14xx_radarss.bin", so the IWR1243 is emulated. These bins are also found in the DFP library.
The SPI communication and the SPI_HOST_IRQ seems to work, since the STM32 MCU is receiving asyncronous events from the IWR1443 chip after the CNYS writes and the intitial messages from the IWR1443 chip is sent with correct checksum.
The call to "MMWL_powerOnMaster" returns OK
and MMWL_setDeviceCrcType also return OK
but the call to MMWL_rfEnable returns with a TIMEOUT error.
I have analyzed the messages written and read by the STM32 MCU to power up the RF (in MMWL_rfEnable) and it looks okay, see below.
But one thing that seems a little strange is that in the example code it seems like we are waiting for an ASYNC message saying that RL_DEV_AE_RFPOWERUPDONE_SB (see MMWL_asyncEventHandler), but the message read from the IWR1443 after the AWR_DEV_RFPOWERUP_MSG command (see below), does not have a ASYNC message class, but a RESPONSE message class (yellow below), i.e. the "rlDriverAsyncEventHandler" will not be called in the function "rlDriverMsgCmdReply" and therefore will never mmwl_bStartComp be set to 1 in MMWL_asyncEventHandler.
Is this a bug or have I done something wrong?
In my STM32 implementation I am not using any OS and it was therefore not obvious how to implement some of the rlosi*** functions. For example I have just immediate call to pEntry(pValue) in the function "rlOsiSpawn" Is that Okay?.
I would really appreciate an example implementation using the DFP for an external host, which is not using any OS.
BR
Haakan
--- WRITE 22 BYTES ---
0x0034 /* SYNC => master to slave indicating a new command */
0x0012
0x0021
0x0043
0x0005 /* OPCODE */
0x0080 0x8005 => DIRECTION = 0101 (Host to Master), MSGTYPE = 00 (COMMAND), MSGID = 0x200 (AWR_DEV_RFPOWERUP_MSG)
0x0012 /* MSGLEN */
0x0000 len = 18
0x0000 /* FLAGS */
0x0010 0x1000 => RETRY = 00 (New message), ACKREQ = 00 (ACK), PROT_VER = 0, CRC = 00 (Append CRC), CRCLEN = 00 (16bit), SEQNUM = 1
0x0000 /* REMCHUNKS */
0x0000 0
0x0001 /* NSBC */
0x0000 1
0x00E7 /* CHECKSUM */
0x006F CRC = 0x6FE7 (Stämmer!)
0x0000 /* SBLKID */
0x0040 0x4000 = AWR_DEV_RFPOWERUP_SB
0x0004 /* SBLKLEN */
0x0000 0x4 = 4 bytes
0x0000
0x00DA
--- WRITE 16 BYTES ---
0x0078 /* Write CNYS => External Host is ready to receive message */
0x0056
0x0065
0x0087
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
--- READ 4 BYTES ---
0x00FF
0x00FF
0x00BA /* Sync Start */
0x00DC
--- READ 4 BYTES ---
0x00CD
0x00AB /* Sync End */
0x0016 /* OPCODE */
0x0080 0x8016 => DIRECTION = 0110 (Master to Host), MSGTYPE = 01 (RESPONSE), MSGID = 0x200 (AWR_DEV_RFPOWERUP_MSG)
--- READ 10 BYTES ---
0x000E /* MSGLEN */
0x0000 0xE = 14 bytes
0x000C /* FLAGS */
0x0010 0x100C => RETRY = 00 (New message), ACKREQ = 11 (NO_ACK), PROT_VER = 0, CRC = 00 (Append CRC), CRCLEN = 00 (16bit), SEQNUM = 1
0x0000 /* REMCHUNKS */
0x0000
0x0000 /* NSBC */
0x0000
0x00CF /* CHKSUM */
0x006F CRC = 0x6FCF (Stämmer!)
--- READ 2 BYTES ---
0x0026 /* CRC */
0x00B5 0x26B5
---- WRITE 16 BYTES ----
0x0078 /* Write CNYS => External Host is ready to receive message */
0x0056
0x0065
0x0087
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF
0x00FF