-
Notifications
You must be signed in to change notification settings - Fork 619
[TDM] os/arch/arm/src/amebasmart: remove INT DMA isr callback when ch8 used #7031
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
Conversation
zhongnuo-tang
commented
Nov 3, 2025
- ch8 requires both INT and EXT DMA, but the last valid data is from EXT DMA, so we should only trigger callback to parse data when EXT dma done
1. ch8 requires both INT and EXT DMA, but the last valid data is from EXT DMA, so we should only trigger callback to parse data when EXT dma done
|
Hi @allen-kim-sec , I have tried with sensor recordsamples 2048 and all data matched between LA and APP print. LA: LA: Could the 0000 case actually from sensor really reading 0000 data? |
|
It's the same result 0033: 026d 000b 1e99 ffff ffff ffff ffff ffff |
This PR should not affect the 0000, it is to prevent multiple callback from both prime and ext DMA. |
Hello? zhongnuo , After reading your question, I felt that you might not fully understand the situation, so I am replying again. For now, I believe this PR is safer as it uses a single handler, as I mentioned earlier. Patterns:
|
It's not proper case : problem is 64Bytes zero , therefore ch1 , ch2 , ch5 , ch6 should be zero... |
Hi @allen-kim-sec , |
1. when using rxbuff in struct, it is not 64bytes aligned, and result in cache coherence issue when using DMA 2. change it to static buffer instead.
|
Hi @allen-kim-sec , |
It's fine... clear... working fine. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
match frame data and not find any trailed 0 --> is it move another address or clear defect ?
@zhongnuo-tang
please attach tech report
(*(g_i2sdevice[2])).i2s_rx_buf address is 0x60145df0 .
always occured at the first page. it's the first DMA Page ,,,,
I think it is not align issue... is it possible ?
it is not happened Breakpoint on the trace32 , noone write 0x0000 value in that memory range( i2s_rx_buf buffer )
|
@zhongnuo-tang DMA Page Buffer address is changed to 0x60115000 from 0x60145df0. |
Hi Allen, i strongly thinks it is alignment issue. Our GDMA requires the memory to be 64bytes aligned and thats why we always use aligned(64) to the buffer, but in this case, first page 0x60145df0 is not aligned when we use the buff in the structure, i think maybe because aligned(64)in struct is used incorrectly. But for static buffer, aligned(64) ensures the addr to be aligned. |
What I found through repeated Trace32 analysis is that I couldn't catch any instance where 64 bytes were written as 0. |
Hi @allen-kim-sec, The main reason for enforcing 64-byte alignment is related to the cache line boundary, not the DMA hardware itself. After DMA transfers data from the peripheral to memory, the CPU typically performs a cache invalidate to ensure it reads the updated data. However, if the first page is not aligned to a 64-byte cache line, the cache line at the start of the buffer overlaps with unrelated memory. For example, when the cache line covering the range 0x60145dc0 ~ 0x60145dff is invalidated, the entire 64 bytes are affected, including the start of the DMA buffer at 0x60145df0. Therefore, even if the data at 0x60145dc0 never changes, invalidating this cache line can overwrite part of the DMA buffer (e.g., with 0x0000) if the invalidate happens after the I2S callback performs its own cache maintenance. In short, the corruption occurs because the first DMA buffer is not 64-byte aligned, causing its initial cache line to overlap unrelated memory. Subsequent pages are aligned and therefore not affected. |