mirror of https://github.com/commaai/panda.git
some computers are slow to enumerate
This commit is contained in:
parent
37b3327c28
commit
71d81ed916
|
@ -27,7 +27,7 @@ bin: obj/$(PROJ_NAME).bin
|
|||
# this flashes everything
|
||||
recover: obj/bootstub.$(PROJ_NAME).bin obj/$(PROJ_NAME).bin
|
||||
-python -c "from panda import Panda; Panda().reset(enter_bootloader=True)"
|
||||
sleep 0.5
|
||||
sleep 1.0
|
||||
$(DFU_UTIL) -a 0 -s 0x08004000 -D obj/$(PROJ_NAME).bin
|
||||
$(DFU_UTIL) -a 0 -s 0x08000000:leave -D obj/bootstub.$(PROJ_NAME).bin
|
||||
|
||||
|
|
|
@ -61,9 +61,19 @@ int usb_cb_control_msg(USB_Setup_TypeDef *setup, uint8_t *resp, int hardwired) {
|
|||
case 0xd1:
|
||||
// this allows reflashing of the bootstub
|
||||
// so it's blocked over wifi
|
||||
if (hardwired) {
|
||||
enter_bootloader_mode = ENTER_BOOTLOADER_MAGIC;
|
||||
NVIC_SystemReset();
|
||||
switch (setup->b.wValue.w) {
|
||||
case 0:
|
||||
if (hardwired) {
|
||||
puts("-> entering bootloader\n");
|
||||
enter_bootloader_mode = ENTER_BOOTLOADER_MAGIC;
|
||||
NVIC_SystemReset();
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
puts("-> entering softloader\n");
|
||||
enter_bootloader_mode = ENTER_SOFTLOADER_MAGIC;
|
||||
NVIC_SystemReset();
|
||||
break;
|
||||
}
|
||||
break;
|
||||
// **** 0xd6: get version
|
||||
|
|
|
@ -136,6 +136,7 @@ class Panda(object):
|
|||
break
|
||||
except Exception as e:
|
||||
print("exception", e)
|
||||
traceback.print_exc()
|
||||
if wait == False or self._handle != None:
|
||||
break
|
||||
assert(self._handle != None)
|
||||
|
@ -154,7 +155,7 @@ class Panda(object):
|
|||
except Exception:
|
||||
pass
|
||||
if not enter_bootloader:
|
||||
time.sleep(0.5)
|
||||
time.sleep(1.0)
|
||||
self.connect()
|
||||
|
||||
def flash(self, fn=None):
|
||||
|
|
|
@ -1,3 +1,3 @@
|
|||
#!/bin/bash
|
||||
nosetests -x -s tests/automated/$1*.py
|
||||
PYTHONPATH="." nosetests -x -s tests/automated/$1*.py
|
||||
|
||||
|
|
Loading…
Reference in New Issue