QUERY · ISSUE
ESP32 Port - Using UART0
enhancementport-esp32
Any particular reason the UART0 is blocked for user code?
What are the implication of using it? What are the fun errors?
This can drive the hardware design choices.
Thank you
STATIC mp_obj_t machine_uart_make_new(const mp_obj_type_t *type, size_t n_args, size_t n_kw, const mp_obj_t *args) {
mp_arg_check_num(n_args, n_kw, 1, MP_OBJ_FUN_ARGS_MAX, true);
// get uart id
mp_int_t uart_num = mp_obj_get_int(args[0]);
if (uart_num < 0 || uart_num >= UART_NUM_MAX) {
mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("UART(%d) does not exist"), uart_num);
}
// Attempts to use UART0 from Python has resulted in all sorts of fun errors.
// FIXME: UART0 is disabled for now.
if (uart_num == UART_NUM_0) {
mp_raise_msg_varg(&mp_type_ValueError, MP_ERROR_TEXT("UART(%d) is disabled (dedicated to REPL)"), uart_num);
}
CANDIDATE · ISSUE
esp32: UART(0) is disabled (dedicated to REPL)
Hi @dpgeorge,
in response of to the pull request #3784 relative to the dupterm of the esp8266, my need is to use the UART(0) it's not because the other ports are in use, but because my society production version of the board esp32 use RXD0 and TXD0 to communicate with the device.
By now the esp32 was produced so we can't change the hardwere, is there any way to detach the UART(0) from the REPL using the dupterm function?
I hope i made my point.
Thank you for your reply in advance.