Hi,
Is there a button to reset the microcontroller? After program it sometimes is necessary perform a reset more than one time to debug or any reason and is more comfortable to do it from keil instead of power cycling.
Thanks
http://www.keil.com/support/man/docs/uv4/uv4_ui_debug.htm
This is for reset the CPU in debug mode, but this is not what I want because I don't want to start in debug, only perform a reset to the board.
This function is very useful and should be added in next version of Keil.
Is it?
I can't really think of a reason I'd want the IDE to reset the chip unless I'm debugging it.
The is an option to do a reset after a flash download.
"should be added in next version of Keil"
Can't say I can think of any other IDE with this feature ... ?
If your debugger can do it (via a command line), you could create an entry on the 'Tools' menu:
http://www.keil.com/support/man/docs/uv4/uv4_ui_tools.htm
Start debugger is very slow and the IDE have to change from compiler to debugger...
For example, you have a board connected to a PC and you are debugging the code running at the PC , this code get a package sended by the board and decodes it but for any reason this dont work properly and you want to send some packages to debug it and find the error.. you have three methods:
1. Placing a switch on the board to send the package when you press it. This involves to write more code to read the pin, place a switch and connect to the board and of course the board must have a I/O pin free to do that.. Very complicated.
2. Place a timer to send a package every x seconds.. but this is not what I need to debug because don't want to receive more packages until I debugged the first one... Not good solution.
3. Place the code to send the package at board initialization and when the board starts sends the package. If you have a reset button in IDE is very simple, reset the board and receive a new package, in other words, click and get a new package.
This is an example but this is aplicable to many scenarios and you are not debugging the board and not starting the debugger.
What is this "package" that you speak of?
Data package....
Buy a SEGGER J-Link or use one that you currently own.
Run J-Link Commander from the Start Menu or JLink.exe from a command prompt.
J-Link>connect ; connect to the J-Link Device J-Link>r0 ; will drive the reset line low on the J-Link J-Link>r1 ; will drive the reset line high on the J-Link
My guess is most JTAG devices have a simple control program that you could do something similar with.
or set up an entry in the uVision 'Tools' menu ...
all solutions are very impractical... a button in the IDE is the right solution
How about the RST icon in the debugger window? It toggles the reset line on the JTAG.
Solution:
As Andy Neil told me the best is to add a custom icon in tools and use the stlink command line utility as follows:
1. Tools -> Customize Tools Menu 2. Add new and name it as "Reset MCU" (example) 3. Command: the path to the st link command line utility called ST-LINK_CLI.exe 4. Arguments: -c -rst
With this you will add a new button called "Reset MCU" and when you click on it it will reset the MCU without needing enter in the debug mode.
@Robert: He's already said that he doesn't want to do that!
I really don't understand the requirement here - but maybe others might agree that it's an essential feature ... ?
Yes, but this does almost exactly what the OP is asking for and the reasons given for not wanting to do it dont exist.
1) You do not need to start in Debug mode. issue resolved.
2) when the issue happens - connect to board. DO NOT start debugging or load code. Just connect to board. This is not in any way slow.
3) Now you can use the RST button in the IDE just as you would like.