我查阅MSP430F2131的用户手册发现,该芯片复位后,目标CPU会从0xFFFE执行,这是一个复位中断,那么我该如何从这个中断恢复,开始执行我自己的main程序呢?
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.
我查阅MSP430F2131的用户手册发现,该芯片复位后,目标CPU会从0xFFFE执行,这是一个复位中断,那么我该如何从这个中断恢复,开始执行我自己的main程序呢?
我其实更加关心的是:
我想要通过MSP430F5437控制JTAG编程,向MSP430F2131里烧录程序,但是我烧完程序后需要让MSP430F2131运行一段时间。
根据《Programming a Flash-Based MSP430 Using the JTAG Interface》里的描述,调用release释放从芯片后,2131会进入复位矢量。我想知道如何从复位矢量进入main函数运行?
或许您可以看一下
我这边没有2131的板子,所以我用G2553来说明一下
在debug设置不自动跳到main
然后debug就会跳到
然后就会跳到boot.c中的
/*------------------------------------------------------------------------*/ /* Allow for any application-specific low level initialization prior to */ /* initializing the C/C++ environment (global variable initialization, */ /* constructers). If _system_pre_init() returns 0, then bypass C/C++ */ /* initialization. NOTE: BYPASSING THE CALL TO THE C/C++ INITIALIZATION */ /* ROUTINE MAY RESULT IN PROGRAM FAILURE. */ /*------------------------------------------------------------------------*/ if(_system_pre_init() != 0) { if (NEEDS_INIT) _auto_init(); } /*------------------------------------------------------------------------*/ /* Handle any argc/argv arguments if supported by an MSP430 loader. */ /*------------------------------------------------------------------------*/ if (NEEDS_ARGS) _args_main(); else main(0); exit(1); }
在上面的语句中就会跳到main