eclipse-threadx / usbx

Eclipse ThreadX - USBX is a high-performance USB host, device, and on-the-go (OTG) embedded stack, that is fully integrated with Eclipse ThreadX RTOS
https://github.com/eclipse-threadx/rtos-docs/blob/main/rtos-docs/usbx/index.md
MIT License
148 stars 88 forks source link

_ux_utility_memory_allocate调用方可以考虑字节对齐吗? #69

Closed chengshuihang closed 1 year ago

chengshuihang commented 2 years ago

您好!_ux_utility_memory_allocate函数的调用方可以增加字节对齐的配置吗?我现在使用STM32H743,使用了USB DMA和高速缓存,因此我期望 传输的数据地址是32字节对齐的,并且这个数据缓冲区大小是32字节对齐的(实际传输的数据大小可以不是32字节倍数,但空间需要是32字节倍数,防止两种属性的数据在同一块高速缓存中)

xiaocq2001 commented 2 years ago

Did you try the allocation with UX_ALIGN_32?

Another option, use MPU to setup a cache safe memory area for memory allocation, allocate cache safe memory to avoid caching issues.

chengshuihang commented 2 years ago

是的,我希望我可以指定UX_ALIGN_32分配,至于MPU管理非缓存内存方案,和我当前方案区别不是太大。

chengshuihang commented 2 years ago

或者我将UX_ALIGN_MIN修改为UX_ALIGN_32,可以吗?

xiaocq2001 commented 2 years ago

Yes. You can try.

xiaocq2001 commented 1 year ago

UX_ALIGN_MIN exported in ux_user_sample.h.

Closing.