0%

IWR1443使用内置config文件

TI为推出的IWR1443毫米波雷达评估板提供了丰富可用的演示demo,这些都需要上电之后下载配置文件,这里经过修改可以将配置文件固化在固件中,使得评估板上电即开始工作。

  • 不过需要注意的是评估板的芯片版本必须与SDK的版本一致,否则会出现无法下载固件,CCS编译错误等问题。

    我目前手头的IWR1443对应的SDK版本为mmwave_sdk_02_01_00_04

    对应的demo工具箱版本号为mmwave_industrial_toolbox_3_6_1

    在 mmwave_cli.c中添加CLI的头文件

1
#include <ti/utils/cli/include/cli_internal.h>

图片1

在mmwave_cli.c中添加CLI的结构体

1
extern CLI_MCB      gCLI;

图片2

在main.c文件中添加相应的功能定义

1
extern void MmwDemo_Bypass_CLI (void);
  • 在”void MmwDemo_initTask(UArg arg0, UArg arg1)”函数中调用MmwDemo_Bypass_CLI()函数
1
MmwDemo_Bypass_CLI();

图片3

在mmwave_cli.c中添加配置信息

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#define CLI_BYPASS 1

#define MAX_RADAR_CMD 24

uint8_t* radarCmdString[MAX_RADAR_CMD] =

{

{"sensorStop \r\n"},

{"flushCfg \r\n"},

{"dfeDataOutputMode 1 \r\n"},

{"channelCfg 15 7 0 \r\n"},

{"adcCfg 2 1 \r\n"},

{"adcbufCfg 0 1 0 1 \r\n"},

{"profileCfg 0 77 7 7 57.14 0 0 70 1 240 4884 0 0 30 \r\n"},

{"chirpCfg 0 0 0 0 0 0 0 1 \r\n"},

{"chirpCfg 1 1 0 0 0 0 0 4 \r\n"},

{"chirpCfg 2 2 0 0 0 0 0 2 \r\n"},

{"frameCfg 0 2 16 0 33.333 1 0 \r\n"},

{"lowPower 0 0 \r\n"},

{"guiMonitor 1 0 0 0 0 0 \r\n"},

{"cfarCfg 0 2 8 4 3 0 768 \r\n"},

{"peakGrouping 1 0 1 1 229 \r\n"},

{"multiObjBeamForming 1 0.5 \r\n"},

{"clutterRemoval 0 \r\n"},

{"calibDcRangeSig 0 -5 8 256 \r\n"},

{"compRangeBiasAndRxChanPhase 0.0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 1 0 \r\n"},

{"measureRangeBiasAndRxChanPhase 0 1.5 0.2 \r\n"},

{"CQRxSatMonitor 0 3 5 123 0 \r\n"},

{"CQSigImgMonitor 0 119 4 \r\n"},

{"analogMonitor 1 1 \r\n"},

{"sensorStart \r\n"},

};
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
static int32_t CLI_ByPassApi(CLI_Cfg* ptrCLICfg)

{

//uint8_t cmdString[128];

char* tokenizedArgs[CLI_MAX_ARGS];

char* ptrCLICommand;

char delimitter[] = " \r\n";

uint32_t argIndex;

CLI_CmdTableEntry* ptrCLICommandEntry;

int32_t cliStatus;

uint32_t index, idx;

uint16_t numCLICommands = 0U;



/* Sanity Check: Validate the arguments */

if (ptrCLICfg == NULL)

return -1;



/* Cycle through and determine the number of supported CLI commands: */

for (index = 0; index < CLI_MAX_CMD; index++)

{

/* Do we have a valid entry? */

if (ptrCLICfg->tableEntry[index].cmd == NULL)

{

/* NO: This is the last entry */

break;

}

else

{

/* YES: Increment the number of CLI commands */

numCLICommands = numCLICommands + 1;

}

}



/* Execute All Radar Commands */

for (idx = 0; idx < MAX_RADAR_CMD; idx++)

{

/* Reset all the tokenized arguments: */

memset ((void *)&tokenizedArgs, 0, sizeof(tokenizedArgs));

argIndex = 0;

ptrCLICommand = (char*)radarCmdString[idx];



/* Set the CLI status: */

cliStatus = -1;



/* The command has been entered we now tokenize the command message */

while (1)

{

/* Tokenize the arguments: */

tokenizedArgs[argIndex] = strtok(ptrCLICommand, delimitter);

if (tokenizedArgs[argIndex] == NULL)

break;



/* Increment the argument index: */

argIndex++;

if (argIndex >= CLI_MAX_ARGS)

break;



/* Reset the command string */

ptrCLICommand = NULL;

}



/* Were we able to tokenize the CLI command? */

if (argIndex == 0)

continue;



/* Cycle through all the registered CLI commands: */

for (index = 0; index < numCLICommands; index++)

{

ptrCLICommandEntry = &ptrCLICfg->tableEntry[index];



/* Do we have a match? */

if (strcmp(ptrCLICommandEntry->cmd, tokenizedArgs[0]) == 0)

{

/* YES: Pass this to the CLI registered function */

cliStatus = ptrCLICommandEntry->cmdHandlerFxn (argIndex, tokenizedArgs);

if (cliStatus == 0)

{

CLI_write ("Done\n");

}

else

{

CLI_write ("Error %d\n", cliStatus);

}

break;

}

}



/* Did we get a matching CLI command? */

if (index == numCLICommands)

{

/* NO matching command found. Is the mmWave extension enabled? */

if (ptrCLICfg->enableMMWaveExtension == 1U)

{

/* Yes: Pass this to the mmWave extension handler */

cliStatus = CLI_MMWaveExtensionHandler (argIndex, tokenizedArgs);

}



/* Was the CLI command found? */

if (cliStatus == -1)

{

/* No: The command was still not found */

CLI_write ("'%s' is not recognized as a CLI command\n", tokenizedArgs[0]);

}

}

}



return 0;

}
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void MmwDemo_Bypass_CLI (void)

{

if (CLI_ByPassApi(&gCLI.cfg) != 0)

{

System_printf ("Error: Unable to CLI_ByPassApi\n");

return;

}

return;

}

编译生成bin文件

在build setting选项中勾选生成bin文件

图片4