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
H7 Fix frozen ADC values #12439
H7 Fix frozen ADC values #12439
Conversation
Do you want to test this code? Here you have an automated build: |
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.
Good spot: the comment at line 538 was clearly misleading.
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.
Lols, Data Cache was disabled on F7 6 years ago:
//HAL_CLEANINVALIDATECACHE((uint32_t*)&adcValues, configuredAdcChannels);
@haslinghuis That line of code has been commented out from the start for F7. The data cache is enabled for F7, but the dma buffers are located in DTCM RAM, and can be directly accessed by the CPU so no manual operations are needed. dma can't access dtcm ram on H7 so we have to do it like this 🙂 |
AUTOMERGE: (FAIL)
|
H7 ADC buffer invalidate cache
Fix adc readings not updating on H7 mcus by invalidating the cached adc dma buffer before reading.
The adc dma buffer is in DMA_RAM, and it says here that cache coherency operations are needed for reading, but we're currently not doing it
betaflight/src/main/drivers/stm32/memprot_stm32h7xx.c
Lines 48 to 60 in e5cd2ca
Fixes #12419
Fixes #12280