I was wondering why this function:
bool udd_ep_run(udd_ep_id_t ep, bool b_shortpacket, uint8_t * buf, iram_size_t buf_size, udd_callback_trans_t callback)
in usb_device.c dosen't require the buf to pass as pointer to a volatile uint8_t? The buf is transfered via the usb peripheral which has its own dedicated dma.
The reasion why I thought the parameter needs to be volatile is that the buffer might change but the compiler dosen't know about it so it might optimise the code in a sense that the data is always the same?
In udi_cdc.c which uses the udd_ep_run function the data buffer is also declared without a volatile:
//! Buffer to receive data COMPILER_WORD_ALIGNED static uint8_t udi_cdc_rx_buf[UDI_CDC_PORT_NB][UDI_CDC_RX_BUFFERS];
So why is its ok to declare a buffer for a dma without volatile?