Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Restart the device via command line #56

Closed
alignan opened this issue Jul 6, 2016 · 5 comments
Closed

Restart the device via command line #56

alignan opened this issue Jul 6, 2016 · 5 comments

Comments

@alignan
Copy link

alignan commented Jul 6, 2016

Hello!

Something that would be really cool and handy would be to restart a device over USB, is this feature available, or on the roadmap?

Thanks!

@JelmerT
Copy link
Owner

JelmerT commented Jul 6, 2016

When you're referring to restarting the chip, I'm presuming you mean restarting while it's running the flashed image. This might be difficult since you can only send a reset command when you're actually communicating with the bootloader (which has to be started manually).

If the hardware supports the RTS (serial pin) to RST (pin on the chip) mapping, then it wouldn't be too hard to add this I think.
How does the PIC on the Re-Mote handle the incoming RTS signal?

@niolp
Copy link

niolp commented Sep 19, 2016

Hi Jelmer.
Do you mean RTS pin on an FTDI232R device? Are there any other hardware considerations to make this work?
Regards

@JelmerT
Copy link
Owner

JelmerT commented Sep 27, 2016

@niolp yes the RTS on an FTDI or similar USB to serial chip. The idea is to connect the RTS or DTR of the serial line to the reset pin on the chip and be able to hard reset the chip that way. You can check the invoke_bootloader function for more details.

@Tanganelli
Copy link

Tanganelli commented Jan 11, 2018

Hi Jelmer,
I am using a zoul board and the contiki OS. I tried to define a reset function inspired by your invoke_bootloader. The following is the result:

`
class CommandInterface(object):
ACK_BYTE = 0xCC
NACK_BYTE = 0x33
def open(self, aport='/dev/tty.usbserial-000013FAB', abaudrate=500000):
self.sp = serial.Serial(
port=aport,
baudrate=abaudrate, # baudrate
bytesize=8, # number of databits
parity=serial.PARITY_NONE,
stopbits=1,
xonxoff=0, # enable software flow control
rtscts=0, # disable RTS/CTS flow control
timeout=0.5 # set a timeout value, None for waiting forever
)

def reset(self, dtr_active_high=False, inverted=False):
    if inverted:
        set_reset_pin = self.sp.setDTR
    else:
        set_reset_pin = self.sp.setRTS
    set_reset_pin(0)
    set_reset_pin(1)
    set_reset_pin(0)
    time.sleep(0.2)
    `

However, it doesn't work. Do you have any suggestion?

Regards
Giacomo

@JelmerT
Copy link
Owner

JelmerT commented Jan 20, 2021

I guess this feature was implemented a while ago. Needs HW support of course.
Closing!

@JelmerT JelmerT closed this as completed Jan 20, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants