Skip to content

*usbd_dwc_otg:misaligned membuf #45

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

alexrayne
Copy link

provided load/store ep fifo with unaligned transfer membuffer.

     now memory buffer of transfer can be unaligned with negligible price.

! :last bytes store - fixed loose of last loaded from fifo bytes caused by memcopy call otimisation on keil ARMcc.

…unaligned membuffer.

         now memory buffer of transfer can be unaligned with negligible price.
!                 :last bytes store - fixed loose of last loaded from fifo bytes
                        caused by memcopy call otimisation on keil ARMcc.
while (bytes >= 4) {
bytes -= 4;
*mem32++ = *fifo;
}
}//if (((uintptr_t)mem & 3) == 0)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code style: 👎

@kuldeepdhaka
Copy link
Contributor

Are you trying to fix a [single] compiler specific bug in the library?

@alexrayne
Copy link
Author

No, i`ve try to improove FS driver to use misaligned transfers
for HS with DMA usage - it is useless

@kuldeepdhaka
Copy link
Contributor

@alexrayne All uC that have this periph have support for unaligned memory access.
What is the point of optimization?

imo If you write a comment noting the above assumption (unaligned memory access supported is assumed), that would be better.

@alexrayne
Copy link
Author

well, if you`re are wright - it easy to check, just read uint32 from adress xxxx01, and look at HardFault on ARM CM4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants