我的电机控制程序已经编写好。烧写到flash中可以立即运行。但是单片机一断电再加电,程序就 不能证正常运行了。再将ti的f相关例子下载运行,也出现相同问题,就是运行到FXN_F_selfLoop而死机。我用的是ccs3.3,bios5.41,ic是28335.求问题解答。我的email:huangpeng8@163.com 电话15119840596.谢谢关注。
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
我的电机控制程序已经编写好。烧写到flash中可以立即运行。但是单片机一断电再加电,程序就 不能证正常运行了。再将ti的f相关例子下载运行,也出现相同问题,就是运行到FXN_F_selfLoop而死机。我用的是ccs3.3,bios5.41,ic是28335.求问题解答。我的email:huangpeng8@163.com 电话15119840596.谢谢关注。
除了楼上的建议以外,需要明确的是:
FXN_selfloop() is a trap for various things in DSP/BIOS. The most likely source is an unused interrupt vector. By default, BIOS populates all interrupt vectors with HWI_unused(), which in turn calls FXN_selfloop(). A common cause for triggering an 'unused' interrupt is an illegal op-code, which causes the ILLEGAL interrupt. Basically, this means the code has crashed, and triggered the ILLEGAL. The user then finds he has ended up at FXN_selfloop().
所以除了对BIOS版本升级以外,还可以对自己的代码进行检查,包括程序运行及堆栈分配等。
另外,对于F28335,请确定是否有使用外扩的flash或RAM,如果有,需要在main()函数之前的_c_init00里加入对XINTF的初始化,因为F2833x的XINTF对应PIN脚是默认为GPIO。
此外,还提供以下建议确定是怎样进入到该循环的,从而可以有针对性地查找原因:
Put a breakpoint on FXN_F_selfloop and reproduce your problem. When you reach it, check the value of the PIECTRL register (assuming you have PIE enabled). This register should store the address of the entry in the interrupt table that was executed.
If the value is 0x0D27 (assuming your vector table is placed at the default address of 0xD00), that's interrupt 19, which is the illegal instruction interrupt. That means you've probably blown a stack or have a bug.
Some other common interrupt sources and their PIECTRL values:
Reset - Hwi0 - 0x0D01
Timer0 - Hwi38 - 0x0D4D
Timer1 - Hwi13 - 0x0D1B
Timer2 - Hwi14 - 0x0D1D
NMI - Hwi18 - 0x0D25