You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit includes a few changes that I needed to make to the MRI
library in this repository to get it working on the Cortex-M7 over
Serial1.
* Pass in an empty string to __mriInit() from setup() instead of NULL.
* I modified armv7-m_asm.S to expose mriFaultHandler as a global symbol
named __mriFaultHandler so that HardFault_IRQn,
MemoryManagement_IRQn, BusFault_IRQn, and UsageFault_IRQn could be
dynamically set appropriately when initializing the MRI library.
mbed-os has its own handlers defined in the FLASH based interrupt
vector that stop us from placing the MRI ones there.
* I modified Platform_CommHasReceiveData() to clear the overrun flag
that can sometimes be set if MRI is doing something else when GDB
first sends a command. Once the flag gets set, no more data will be
received until software clears it. It should be ok to ignore overrun
as it will just result in a packet checksum error to which MRI will
issue a NAK.
* I commented out my code in MRI which uses the MPU to disable caching.
Disabling caching on a Cortex-M7 caused the core to see stale data
when the newer data was still sitting in the cache. It turns out
that this disabling of the cache isn't needed on the M7 core anyway
as the DSB/ISB instructions work as expected with respect to write
buffering. On Cortex-M3/M4 cores I used the MPU to disable
caching so that bus faults for writes to bad addresses would be
synchronous so that they could be properly caught and reported
back to GDB when the GDB user attempted to write to an invalid
piece of memory. DSB/ISB seemed to be ignored on Cortex-M3.
* Cortex-M7 microcontrollers use the newer version 2 of the Flash Patch
and Breakpoint unit to allow for setting hardware breakpoints. When
the hardware breakpoint setting code in MRI was originally written,
only version 1 existed so it contained no code to properly handle
this newer version. Setting the breakpoint address as in version 1 on
version 2 hardware will not set the breakpoint properly. This commit
includes code that can detect this new FPB version and set the
breakpoint address appropriately.
* I also fixed a bug in set/getMPURegionAddress() where I was shifting
the base address left by 5 bits when I should have just been masking
off the lower 5 bits. Since I only used this function to set a base
address of 0 from MRI, I never noticed that it was wrong before. I
just happened to notice it during a code review comparing code in
debug_cm3.h to the latest version of the ARMv7-M Architecture
Reference Manual.
0 commit comments