I have been testing the speed on hal_serial_usb, testing with different size for [font=Courier New]SERIAL_USB_BUFFERS_SIZE[/font], [font=Courier New]SERIAL_USB_BUFFERS_NUMBER[/font] and the size of buffer which goes in [font=Courier New]chnWrite(&SDU2, (const uint8_t *)&test_buff, TEST_BUFFER_SIZE)[/font].
I realized what matters most is [font=Courier New]SERIAL_USB_BUFFERS_SIZE[/font]. I was able to squeeze 19MB/s from running the driver alone on STM32F723.
But there was one more parameter which changed the speed substantially to 29MB/s. That was increasing the size check in [font=Courier New]obqWriteTimeout() [hal_buffers.c][/font]
Code: Select all
/* Smaller chunks in order to not make the critical zone too long,
this impacts throughput however.*/
if (size > 64U) {
/* Giving the compiler a chance to optimize for a fixed size move.*/
memcpy(obqp->ptr, bp, 64U);
bp += 64U;
obqp->ptr += 64U;
w += 64U;
}
Do you guys think this parameter should be exposed so that it can be fine-tuned?
Thanks,
AQ