diff options
| -rw-r--r-- | hw/bsp/ch32v10x/family.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/hw/bsp/ch32v10x/family.c b/hw/bsp/ch32v10x/family.c index 72dae7086..9943bf856 100644 --- a/hw/bsp/ch32v10x/family.c +++ b/hw/bsp/ch32v10x/family.c @@ -67,7 +67,10 @@ uint32_t tusb_time_millis_api(void) { #endif void board_init(void) { - __disable_irq(); + /* __disable_irq() in CH32V103 EVT attempts to call + * `csrc mstatus, 0x88` in U-mode, which is allowed ONLY in M-mode. + * Disable this to avoid hard-fault. */ + //__disable_irq(); #if CFG_TUSB_OS == OPT_OS_NONE SysTick_Config(SystemCoreClock / 1000); @@ -123,7 +126,7 @@ void board_init(void) { USART_Init(USART1, &usart); USART_Cmd(USART1, ENABLE); - __enable_irq(); + //__enable_irq(); board_led_write(true); } |
