We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hi,
I am facing "Bus error on memory operation" while executing below instruction while invalidating and flushing the TLB.
I am not able to understand what is the reason for "Bus error" as it is a TLB operation instruction ? Also what Bus error signify ?
Also similar error is coming while I try to invalidate instruction cache.
/* Invalidate and flush the TLB */
"tlbi alle2 \n\t" \
Thanks,
Where are you seeing "Bus error on memory operation", in the debugger?
Without know the tool you're using, I suspect it means that the memory system returned an error. When a memory access is made by the core it if first checked against the core's MMU, and then presented to the memory system. Which means the MMU might fault, or if it passes those checks, the memory system (bus) might fault it.
That you would see this immediately after a TLBI isn't necessarily surprising. Changes to translation tables are not guaranteed to take affect until after an appropriate TLB invalidate. What I suspect is happening is that you stepped the TLBI, then the debugger refreshed the various windows you had open. These refreshes would be using the updated view of the translations - which in this case is leading to a bus fault.
So to me, the most likely answer is that you (perhaps unintentionally) are performing an access that the memory system can't handle. Which is in some way connected to the change the code is making to the translation tables. Possible reasons could be:
- The translation tables have mapped in a physical address that doesn't exist
- The debugger is performing an access type the address doesn't support (e.g. 64-bit read from a peripheral that only supports byte reads)
Yes I see it in the debugger once I set up the translation table and try to invalidate the current TLB in order to make sure that my settings are flushed and taking effect.
I wanted to debug my MMU setup code so I step through the code and I see this error when I invalidate TLB.
I am not sure though if this error is coming in case my table settings are wrong ?