Can trigger a HC12 debug cmd from C code?

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

Can trigger a HC12 debug cmd from C code?

1,539 次查看
wei_w_he
Contributor IV

Hi,

We are developing motor control project using CodeWorrior IDE based on  mc9s12vr64  chip.  Can we trigger a HC12 Debugger command running from C source code? e.g. If running a command “ fprintf(“my.text”, “some text..”), how to trigger it from C code implementation? ( I can only trigger it from HC12 debugger IDE but not from C source code).

 

Thanks and best regards

He Wei

0 项奖励
回复
3 回复数

1,478 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

Hi He Wei

printf()/fprintf() is not possible since there is NO "standard output" in embedded system. User has to implement their own "pseudo" prinf() function, i.e. to format the output in memory and then print out through SCI or SPI

HI-WAVE supports a command FPRINTF which can be used in that case.

Syntax is pretty similar to ANSI C fprintf.

You can have a command as follows:

FPRINTF (MyLog.txt, "temp1 = %d    temp2= %d  temp3= %d\n", temp1, temp2, temp3)

 

If you are using tabs between the different items, you should be able to read the file in a .xls spreadsheet without trouble.

Have a nice day,

Jun Zhang

0 项奖励
回复

1,478 次查看
wei_w_he
Contributor IV

Dear Jennie,

Thanks a lot for the reply. So can we trigger a HI-WAVE cmd or execute a HI-WAVE.cmd file from C code?

Thanks and best regards

He Wei

0 项奖励
回复

1,478 次查看
ZhangJennie
NXP TechSupport
NXP TechSupport

No. you can't trigger it from C code. You can only execute PRINTF from hiwave command window.

0 项奖励
回复