hal_queues vs. hal_buffers with USB

Discussions and support about ChibiOS/HAL, the MCU Hardware Abstraction Layer.
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

Postby tsichevski » Sun Mar 11, 2018 2:05 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: hal_queues vs. hal_buffers with USB

Postby Giovanni » Sun Mar 11, 2018 3:59 pm

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

Postby tsichevski » Sun Mar 11, 2018 5:56 pm

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: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: hal_queues vs. hal_buffers with USB

Postby Giovanni » Sun Mar 11, 2018 6:05 pm

Eventually yes.

Giovanni


Return to “ChibiOS/HAL”

Who is online

Users browsing this forum: No registered users and 8 guests