Skip to content

Commit

Permalink
Merge #19415
Browse files Browse the repository at this point in the history
19415: cpu/esp32: fix stdio_usb_serial_jtag for ESP32-C3 r=benpicco a=gschorcht

### Contribution description

This PR fixes problem with `stdio_usb_serial_jtag` for ESP32-C3.

### Testing procedure

Flash any ESP32-C3 board with the USB interface connected USB D+/D- (GPIO19, GPIO18) using the `stdio_usb_serial_jtag` module:
```
USEMODULE=stdio_usb_serial_jtag BOARD=hip-badge make -j8 -C tests/shell flash term
```

### Issues/PRs references


Co-authored-by: Gunar Schorcht <[email protected]>
  • Loading branch information
bors[bot] and gschorcht authored Mar 22, 2023
2 parents 0c27733 + 28a63f3 commit 9719bbf
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions cpu/esp32/stdio_usb_serial_jtag/usb_serial_jtag.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,16 @@ void stdio_init(void)
/* clear all interrupt flags */
usb_serial_jtag_ll_clr_intsts_mask(USB_SERIAL_JTAG_LL_INTR_MASK);

/* route all UART interrupt sources to same the CPU interrupt */
/* route USB Serial/JTAG interrupt source to CPU interrupt */
intr_matrix_set(PRO_CPU_NUM, ETS_USB_SERIAL_JTAG_INTR_SOURCE, CPU_INUM_SERIAL_JTAG);

/* we have to enable therefore the CPU interrupt here */
/* enable the CPU interrupt */
intr_cntrl_ll_set_int_handler(CPU_INUM_SERIAL_JTAG, _serial_intr_handler, NULL);
intr_cntrl_ll_enable_interrupts(BIT(CPU_INUM_SERIAL_JTAG));

#ifdef SOC_CPU_HAS_FLEXIBLE_INTC
/* set interrupt level */
intr_cntrl_ll_set_int_level(CPU_INUM_SERIAL_JTAG, 1);
#endif
}
/**@}*/

0 comments on commit 9719bbf

Please sign in to comment.