2020-09-17 07:34 AM
Hello all,
I have an STM32F7508-Discovery board (STM32F750N8H6 MCU) with a custom UI application on top, using LTDC and DMA2D in interrupt mode, and continuously filling the full display with red/blue. The Stm32CubeF7 v1.16.0 is used as an SDK.
With this application, I have the following behavior:
The worst part is that this is not an application freeze, but an MCU freeze, because:
Since I can't debug as the debugger stops during the freeze, I suspect an issue at hw level (AHB bus deadlock, power issue).
Did anyone encountered similar freezes on this MCU?
How can I get some traces out to help me with the investigation (ETM traces, SystemView traces)?
Solved! Go to Solution.
2020-09-20 11:21 PM
You are right, I finally found an application note from STM where this is explained. See https://www.st.com/content/ccc/resource/technical/document/application_note/group0/25/ca/f9/b4/ae/fc/4e/1e/DM00287603/files/DM00287603.pdf/jcr:content/translations/en.DM00287603.pdf, Chapter 4.6 Special recommendations for Cortex-M7 (STM32F7/H7). Many thanks for your help, this issue is closed~
2020-09-17 09:32 AM
>>How can I get some traces out to help me with the investigation (ETM traces, SystemView traces)?
If the debug interface is powering down, then thats not going to work.
I don't think the STM32F7508-DK provides access to the trace pins.
The SWO/SWV should work, and the UART to the VCP should be viable, at least until it locks.
Back off the flash wait-states, perhaps try turning off the ART cache/prefetch.
If dropping the debugger, most likely hitting a WFI and powering down debug. For debug builds avoid WFI/SLEEP modes.
Have Hard Fault and Error Handlers output actionable data. Use diagnostic/telemetry output to understand flow and paths to failure.
2020-09-18 02:03 AM
Thanks for your answer.
There is no WFI/SLEEP in my code, so that is not an issue. Also, I have loggers through the fault handlers and they also do not hit.
I found out today that disabling the data cache globally fixes the issue, but since I cannot use such a workaround as it impacts performance, the next thing was to create an MPU region as stongly ordered (cache disabled) which contains both the source and the destination buffers of the DMA2D, still this is not enough.
I suspect an AHB bus freeze (both CPU and DMA2D are AHB bus masters) correlated with a cache issue, but I can't put my finger on it yet, so any suggestions in this direction is greatly appreciated.
2020-09-18 06:56 AM
So, here is an update.
If I add this extra MPU region (for the 256MB of QSPI address space), the freeze is gone.
I do not understand why! From my point of view, this region is useless, as it is override with the 16MB MPU region, but then how can it fix the freeze?
Does STM has some explanation? If not about fixing the freeze, then about the presence of this MPU region in the SDK examples?
2020-09-18 09:46 AM
I know the H7 had some issues in the tail end of the QSPI space (as set in the peripherals 'flash size'), last 32-bytes as I recall.
Could be a speculative read or prefetch at the peripheral level.
Check the errata, talk to the local FAE supporting your account.
2020-09-20 11:21 PM
You are right, I finally found an application note from STM where this is explained. See https://www.st.com/content/ccc/resource/technical/document/application_note/group0/25/ca/f9/b4/ae/fc/4e/1e/DM00287603/files/DM00287603.pdf/jcr:content/translations/en.DM00287603.pdf, Chapter 4.6 Special recommendations for Cortex-M7 (STM32F7/H7). Many thanks for your help, this issue is closed~
2020-09-21 02:17 AM
Not directly related to your particular problem, , but once talking about MPU, you may want to consider also the "CortexM7 data corruption when using data cache configured in write-through" ARM erratum (which made it even to ST errata).
JW