cherry/cdc_acm_uart crash

SDK(main)/example/cherry_usb/cdc_acm_uart 通信会死机.

e[32m[I/TOUCH] Regist touch screen driver, probe=1202627d e[0m
call par CFG1(3313)
fc 9, xtal 2000, pll 2047
call par CFG1(3313)
fc 9, xtal 2000, pll 2046
[I/main] USB-UART Bridge starting…
[I/usb_uart] UART initialized successfully
[I/usb_uart] USB-UART bridge initialized
[I/main] USB-UART Bridge ready
msh />
[22:39:02.393]收←◆[I/usb_uart] USB Configured
[I/usb_uart] Set baud rate: 1000000

[22:39:10.552]收←◆[I/usb_uart] Set baud rate: 115200
[I/usb_uart] Set baud rate: 115200

[22:39:13.325]收←◆Function[rt_mutex_take] shall not be used in ISR
Assertion failed at function:rt_mutex_take, line number:659 ,(0)
Previous ISR enable 1

/* USB CDC ACM Bulk OUT callback - called when USB receives data */

void usbd_cdc_acm_bulk_out(uint8_t busid, uint8_t ep, uint32_t nbytes)

{

if (nbytes > 0)

{

    /\* Buffer received data \*/

    rt_mutex_take(&buffer_mutex, RT_WAITING_FOREVER);

    rt_size_t written = rt_ringbuffer_put(&usb_to_uart_rb, usb_read_buffer, nbytes);

    rt_mutex_release(&buffer_mutex);



    if (written < nbytes)

    {

        LOG_W("USB RX buffer overflow: %u bytes lost", nbytes - written);

    }



    /\* Signal thread to process data \*/

    rt_sem_release(&usb_rx_sem);

}



/\* Start next read \*/

usbd_ep_start_read(busid, CDC_OUT_EP, usb_read_buffer, sizeof(usb_read_buffer));

} 应该是这个函数上使用了 metux?这函数是在中断上吗?如何改到不是中断上?

What board are you using? Did you directly compile and flash this example program, or did you make any modifications?

Official development board. Compiled and used directly.

What is the model of the chip? Or could you please specify the command used for compilation?

Regarding SF32LB52

You can refer to the following code for modifications: