kopia lustrzana https://github.com/micropython/micropython
esp32/mpconfigport: Don't hang when machine.bootloader isn't supported.
Currently only the Arduino Nano ESP32 defines a machine.bootloader handler for ESP32. All other boards will intentionally hang. There is no error message, nor is a NotImplementedError raised. There's no indication if Micropython has crashed, or if the bootloader was entered but USB is not working, which is a real problem the ESP32 bootloader has. It's not possible escape from this hang with ^C or any other means besides physical access to the reset pin or the ability to cycle power. Change this to only define an implementation of machine.bootloader() when there is a handler for it. Signed-off-by: Trent Piepho <tpiepho@gmail.com>pull/14004/head
rodzic
27279e69b4
commit
9fc450689b
|
@ -220,11 +220,13 @@ static mp_int_t mp_machine_reset_cause(void) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef MICROPY_BOARD_ENTER_BOOTLOADER
|
||||||
NORETURN void mp_machine_bootloader(size_t n_args, const mp_obj_t *args) {
|
NORETURN void mp_machine_bootloader(size_t n_args, const mp_obj_t *args) {
|
||||||
MICROPY_BOARD_ENTER_BOOTLOADER(n_args, args);
|
MICROPY_BOARD_ENTER_BOOTLOADER(n_args, args);
|
||||||
for (;;) {
|
for (;;) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void machine_init(void) {
|
void machine_init(void) {
|
||||||
is_soft_reset = 0;
|
is_soft_reset = 0;
|
||||||
|
|
|
@ -115,7 +115,6 @@
|
||||||
#define MICROPY_PY_MACHINE (1)
|
#define MICROPY_PY_MACHINE (1)
|
||||||
#define MICROPY_PY_MACHINE_INCLUDEFILE "ports/esp32/modmachine.c"
|
#define MICROPY_PY_MACHINE_INCLUDEFILE "ports/esp32/modmachine.c"
|
||||||
#define MICROPY_PY_MACHINE_BARE_METAL_FUNCS (1)
|
#define MICROPY_PY_MACHINE_BARE_METAL_FUNCS (1)
|
||||||
#define MICROPY_PY_MACHINE_BOOTLOADER (1)
|
|
||||||
#define MICROPY_PY_MACHINE_DISABLE_IRQ_ENABLE_IRQ (1)
|
#define MICROPY_PY_MACHINE_DISABLE_IRQ_ENABLE_IRQ (1)
|
||||||
#define MICROPY_PY_MACHINE_ADC (1)
|
#define MICROPY_PY_MACHINE_ADC (1)
|
||||||
#define MICROPY_PY_MACHINE_ADC_INCLUDEFILE "ports/esp32/machine_adc.c"
|
#define MICROPY_PY_MACHINE_ADC_INCLUDEFILE "ports/esp32/machine_adc.c"
|
||||||
|
@ -269,8 +268,10 @@ typedef long mp_off_t;
|
||||||
#define MICROPY_HW_ENABLE_MDNS_RESPONDER (1)
|
#define MICROPY_HW_ENABLE_MDNS_RESPONDER (1)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MICROPY_BOARD_ENTER_BOOTLOADER
|
#ifdef MICROPY_BOARD_ENTER_BOOTLOADER
|
||||||
#define MICROPY_BOARD_ENTER_BOOTLOADER(nargs, args)
|
#define MICROPY_PY_MACHINE_BOOTLOADER (1)
|
||||||
|
#else
|
||||||
|
#define MICROPY_PY_MACHINE_BOOTLOADER (0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef MICROPY_BOARD_STARTUP
|
#ifndef MICROPY_BOARD_STARTUP
|
||||||
|
|
Ładowanie…
Reference in New Issue