Soft Reset?

11 Jul 2010

Is there a way to reset the LPC1768 module via software? I have an mbed module installed in a first test site 120 miles away. I have been monitoring and fine tuning the application remotely by using LogMeIn. With the module plugged into the USB I have been able to do all modifications and debug except pushing the RESET button after a new firmware download. I've thought of a few different methods:

  • Internet controlled power strip (expensive at ~$150.
  • Remotely restarting the computer. The USB power doesn't alway completely recycle on a system restart.
  • Phoning someone working near by the remote system and asking them to push the blue button. (Become annoying to them after a while).
  • Building up a relay module to allow the ARM to turn itself off for a moment.

A software reset would be nice. I searched this site, but did not find any information on a warm restart.

Doug

11 Jul 2010

Yes, the complete list of ways to tell the interface to restart/load the target MCU are:

  • Press the reset button
  • Pull the nR pin low
  • Send a "break" character down the USB serial connection
  • Call mbed_reset() in target code (which does a semihosting request to the interface to request a reset)

Simon

11 Jul 2010

Thanks Simon and Christian for the replys and tips.

The "ALT-B" and "Break" mentioned by both sounds like the best approach for this long distance software compile/tuning/testing task. I should be able to drag the new .bin file into the mbed folder and then issue a break from TeraTerm. Sounds like a winner.

Thanks again.

Doug

12 Jul 2010

Works like a charm. Thanks again, guys.

29 Jul 2011

Sending break doesn't work from Mac OS X. Tried minicom, screen, coolterm. Apparently the AppleUSBCDC driver doesn't implement tcsendbreak() (at least until Snow Leopard: USBCDC v4.0.5).

This sucks, because break is the only way to reset the mbed externally (from host software) when the mbed target is unresponsive. I realize there isn't much the mbed folks can do about this.

Zainul.

03 Aug 2011

For anyone else with the same problem: I used the watchdog with an UART based kicker. Not as good as the mbed reset but works just as well.

Zainul.

Zainul Charbiwala wrote:

Sending break doesn't work from Mac OS X. Tried minicom, screen, coolterm. Apparently the AppleUSBCDC driver doesn't implement tcsendbreak() (at least until Snow Leopard: USBCDC v4.0.5).

This sucks, because break is the only way to reset the mbed externally (from host software) when the mbed target is unresponsive. I realize there isn't much the mbed folks can do about this.

Zainul.

18 Oct 2011

Hey everyone,

I'm trying to write a batch file to automate the process of copying the firmware and resetting the board after compiling it. This is what i have so far.

SET FROM=C:\Users\Ehsan\Downloads\*_LPC1768.bin

SET TO=E:\

SET PORT=COM3

MODE %PORT%:115200,N,8,1>NUL

:WAIT

IF EXIST %FROM% GOTO COPY

TIMEOUT 1

GOTO WAIT

:COPY

MOVE /Y %FROM% %TO%

ECHO BREAK_SEQUENCE>%PORT%

GOTO WAIT

I'm sure most of you know what it does but in case you don't, it waits in the background until it detects a compiled firmware in the FROM folder and then copies it to your mbed drive and finally resets the board. No user interactions are required. All you have to do is press CTRL-D to compile your program.

However, the problem im facing is that i dont know what should replace the BREAK_SEQUENCE. I've tried to reset the board using TeraTerm's Alt-B and it works perfectly. I did the loop back test and i saw that Alt-B outputs the following in hex format.

0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

My preferred terminal is Termite, but it has no break option as teraterm and when i send the above sequence nothing happens.

Any help is appreciated.

30 Dec 2011

E. T. wrote:

However, the problem im facing is that i dont know what should replace the BREAK_SEQUENCE. I've tried to reset the board using TeraTerm's Alt-B and it works perfectly. I did the loop back test and i saw that Alt-B outputs the following in hex format.

0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00

I don't know what script language you're using, much less the actual value BREAK_SEQUENCE represents in this language, but I have the feeling your problem resides in the following line:

E. T. wrote:

ECHO BREAK_SEQUENCE>%PORT%

I just coded a c# app for the mbed serial port and I also wanted to implement the reset feature. First, I tried by writing a bunch of 0x00 in the port, but because the stop bits are not 0 as well, it didn't work. After checking the msdn documentation, I learned there was a special command ( SerialPortObject.BreakState = true; ) that completely pulls down the Tx line.

How does that matter to you? I think your source code is trying to write the BREAK_SEQUENCE as if it was any other byte array, i.e., using stop bits. Try either removing the stop bits(don't know if possible) or looking for a special command/port parameter.

14 Oct 2013

I think the "break" you are trying to send is a continuous "0" for an extended duration. There probably isn't anything you can "echo" to the port you'll probably need to find a program to generate the break signal.

Although...

One suggestion that comes up elsewhere is to set an abnormally low serial speed, send a nul, then set the speed back to normal. That might not work with USB emulated serial though?

10 Mar 2014

My program includes a switch connected at pin 21, whereby I have to initially press the witch button to run my program.

I now face a problem in which when I include a reset function, it will go back to my first instruction which requires me to manually press the switch again in order to run the program. Does anyone have any idea on how I can bypass this switch function whenever the reset function kicks in?

My project also involves long distance between myself and the circuit on data retrieving through xbee. Appreciate the help.

Alief

02 Dec 2015

CTRL-A then CTRL-B works for me in Mac OS X 10.11 using Screen in the built in Terminal, for those wanted to use the "Break" command on macs