Other Parts Discussed in Thread: MMWAVEICBOOST, , UNIFLASH
Hello team,
I have a IWR6843ISK that I'm using with a MMWAVEICBOOST to learn how to develop using the mmWave SDK. So far I have the following code for the MSS that just tries to initialize the mmWave module:
#include <stdint.h> #include <stdlib.h> #include <stddef.h> #include <string.h> #include <stdio.h> #include <ti/control/mmwave/mmwave.h> #include <ti/drivers/soc/soc.h> #include <ti/drivers/esm/esm.h> #include <ti/drivers/mailbox/mailbox.h> #include <ti/drivers/gpio/gpio.h> #include <ti/drivers/uart/UART.h> static int32_t my_mmwave_callbackFn(uint16_t msgId, uint16_t sbId, uint16_t sbLen, uint8_t *payload) { return 0; } int32_t errCode; int main(void) { SOC_Handle socHandle; SOC_Cfg socCfg; ESM_init(0U); // Init SOC configuration to 0 memset((void*)&socCfg, 0, sizeof(SOC_Cfg)); // Configure SOC socCfg.clockCfg = SOC_SysClock_INIT; socCfg.mpuCfg = SOC_MPUCfg_CONFIG; socCfg.dssCfg = SOC_DSSCfg_UNHALT; //Initialize module socHandle = SOC_init(&socCfg, &errCode); if(socHandle == NULL) { return -1; } if (SOC_waitBSSPowerUp(socHandle, &errCode) < 0) { return -1; } if (SOC_isSecureDevice(socHandle, &errCode)) { /* Disable firewall for JTAG and LOGGER (UART) which is needed by all unit tests */ SOC_controlSecureFirewall(socHandle, (uint32_t)(SOC_SECURE_FIREWALL_JTAG | SOC_SECURE_FIREWALL_LOGGER), SOC_SECURE_FIREWALL_DISABLE, &errCode); } UART_init(); GPIO_init(); Mailbox_init(MAILBOX_TYPE_MSS); MMWave_Handle mmwaveHandle; //Prepare Init config for mmwave module MMWave_InitCfg mmwaveCfg; memset((void*)&mmwaveCfg, 0, sizeof(mmwaveCfg)); mmwaveCfg.domain = MMWave_Domain_MSS; mmwaveCfg.socHandle = socHandle; mmwaveCfg.eventFxn = my_mmwave_callbackFn; mmwaveCfg.linkCRCCfg.useCRCDriver = 1U; mmwaveCfg.linkCRCCfg.crcChannel = CRC_Channel_CH1; mmwaveCfg.executionMode = MMWave_ExecutionMode_ISOLATION; //Only in MSS mmwaveCfg.cfgMode = MMWave_ConfigurationMode_FULL; //Radar will be configured using mmWave API instead of having to use mmWaveLink //EXECUTION FALIS HERE!! mmwaveHandle = MMWave_init(&mmwaveCfg, &errCode); MMWave_sync(mmwaveHandle, &errCode); return 0; }
However, the code fails when reaching MMWave_init(), I've actually followed the execution with the CCS debug utility to find that my program fails in:
- MMWave_init()
- MMWave_initLink()
- MMWave_initMMWaveLink()
- rlDeviceGetVersion()
- rlDeviceGetRfVersion()
- rlDriverExecuteGetApi()
- rlDriverCmdInvoke()
- rlDriverCmdSendRetry() <--- Program ultimately fails here, maybe BSS is not responding to commands sent
- rlDriverCmdInvoke()
- rlDriverExecuteGetApi()
- rlDeviceGetRfVersion()
- rlDeviceGetVersion()
- MMWave_initMMWaveLink()
- MMWave_initLink()
The error code I get from the debug trace is: (I don't really know how to read these error codes)
[Cortex_R4_0] {module#34}: line 215: error {id:0x10000, args:[0x9d38, 0x9d3c]} xdc.runtime.Error.raise: terminating execution
I would like to know what I'm possibly doing wrong. Maybe the MMWave_init() must be invoked in a task as in the demos or my approach is totally wrong? I've tried avoiding using the RTOS as I just wanted to use the mmWave SDK as low level as possible.
Some additional info that might be useful regarding my situation:
- I'm using CCS v12.2 to develop the code, loading and debugging it.
- I flashed the ccsdebug.bin once to the board using Uniflash and it seems to work fine as I can debug with CCS correctly, although it is quite unstable.
- The MMWAVEICBOOST has only SOP0 with a jumper on it.
- I loaded a copy of the demo project in CCS, erased all code regarding CLI, RF parsers, etc to have an empty main.c and started writing my code there.
- The only code I have in the DSS is an empty main function that does nothing.
- My ultimate goal is to be able to load my own frame and chirp configurations to the sensor using MMWave_config, I'm aware I can do this by bypassing CLI on the demos as I've read somewhere else, but I'd like to configure the sensor with the least amount of code, besides I'd like to learn using the mmwave SDK as much as possible :)
Please tell me if you need any other information that might be useful, I will appreciate any help I might receive,
Thanks.