adamgreen / mri

MRI - Monitor for Remote Inspection. The gdb compatible debug monitor for Cortex-M devices.
Apache License 2.0
155 stars 57 forks source link

Avoid compilation errors when platform does not specify MPU structure. #13

Closed PetteriAimonen closed 2 years ago

PetteriAimonen commented 2 years ago

Thanks for the great project!

When compiling on GD32F103, I ran into errors about MPU being undefined. Like many other Cortex-M3 devices, GD32F103 does not have MPU and defines __MPU_PRESENT as 0. However, unlike e.g. STM32, it also does not define the MPU_Type and MPU structures at all.

This caused some compilation problems with the inline functions in debug_cm3.h. This pull request adds a simple #if around them.

I can confirm that this works on GD32F103 now to some extent, though I'm still having some problem with breakpoints crashing.

adamgreen commented 2 years ago

Thanks for the PR.

The MRI code doesn't use the MPU anymore so this is definitely a safe fix.