Tool/software: TI C/C++ Compiler
I was trying to run my code from flash memory but some of the functions were being executed from ram for better performance. In the cmd file, table operator and BINIT was used and I hope the auto copy feature of bootloader would be able to copy the code from flash to ram during boot time.
When the debugger was connected, the project worked fine. The compiler built the project without any error messages, and after debug button was clicked, the debugger can take the application to main automatically and the code could safely run from there after I pressed run.
However, if I disconnect the debugger and press the reset button(on board) to reset the device, the program was stuck. I have a LED flashing function in main() to indicate the program was running well, but LEDs were not flashing. If I power down the device and power up again(with or without the debugger connected), program would not run still.
I saw a thread posted on the forum with similar issue. In their case, the cause was that the code that needs to be copied was too large, so that it took bootloader too long to copy it and the watchdog was tripped. If that is also the cause for my problem, I have a question that I wish you guys could help me with.
In the boot28.asm, I can see that if binit and table operator are used, there are codes that will be used to copy the relative functions from flash to ram during boot time. If watchdog is the cause of this issue, than why in my case the watchdog was not tripped when the debugger was connected and the device was being debugged? Isn't that strange that the watchdog only trips when debugger was disconnected or the device was not being debugged?
I mean whether the debugger is connected or not, or whether the device is being debugged or not, the code_start function and _c_int00 function should be executed under all conditions to set up C environment. Then why in the case where the device was being debugged, the watchdog did not trip? Is the watchdog reset interrupt being blocked by debugger when the device is being debugged? Thank you all for any help.