hal_queues vs. hal_buffers with USB

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
Post Reply
tsichevski
Posts: 35
Joined: Fri Feb 09, 2018 12:44 am
Has thanked: 2 times
Been thanked: 5 times

hal_queues vs. hal_buffers with USB

Post by tsichevski »

Hi all,
I want my device to implement a simple subset of MTP (https://en.wikipedia.org/wiki/Media_Transfer_Protocol) over USB.
What is the best way to do it with ChibiOS?
I consider using the hal_serial_usb, but it is based on hal_buffers, and I cannot understand why. Why this is better than hal_queues? Besides, the later is well documented in the "ChibiOS/RT 3.0 - The Ultimate Guide", and the former is not.

Regards,
Vladimir
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: hal_queues vs. hal_buffers with USB

Post by Giovanni »

Hi,

hal_buffers offers better performance for blocks of data, hal_queues is byte-based, queues have been removed from RT and added to HAL, the book refers to RT 3.0, now we are at 5.0 and some things have changed, also, the book only covers RT, not HAL.

Giovanni
tsichevski
Posts: 35
Joined: Fri Feb 09, 2018 12:44 am
Has thanked: 2 times
Been thanked: 5 times

Re: hal_queues vs. hal_buffers with USB

Post by tsichevski »

Giovanni wrote:Hi,

hal_buffers offers better performance for blocks of data, hal_queues is byte-based, queues have been removed from RT and added to HAL, the book refers to RT 3.0, now we are at 5.0 and some things have changed, also, the book only covers RT, not HAL.

Giovanni


Thank you, Giovanni,
so, I gather, if I do not know the package size in advance, I shall use I/O Bytes Queues: http://chibios.sourceforge.net/docs3/ha ... u_e_s.html

Regards,
Vladimir.

PS: The book is great! Do you plan to publish an updated version?
User avatar
Giovanni
Site Admin
Posts: 14893
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: hal_queues vs. hal_buffers with USB

Post by Giovanni »

Eventually yes.

Giovanni
Post Reply