modm API documentation
|
lbuild module: modm:cmsis:device
This module wraps the CMSIS headers for STM32 devices and provides the header file and CPP definitions for accessing the modm:target
peripherals. Specifically, it copies the target header file which provides the CMSIS implementation of the target's language interface for its memory-mapped peripherals.
The generated header file modm/platform/device.hpp
contains the necessary target define STM32{FAMILY}{NAME}xx
or similar and includes the modm:target
-specific header.
modm/platform/device.hpp
! This file is only included by interface implementations inside the modm/platform
folder! If you need to implement your own drivers, include only this file.modm implements the target specific CMSIS functionality itself, without using the CMSIS interface. This is necessary to provide similar functionality on non-Cortex-M based targets.
uint32_t SystemCoreClock
contains an up-to-date value of CPU frequency.void SystemCoreClockUpdate()
does nothing, it's a weak empty function.void SystemInit()
is undefined: modm defines its own startup architecture, see the modm:platform:core
module for details.When debugging with GDB, it can sometimes be difficult to access peripherals, due to the CMSIS implementation with CPP defines and GCC optimization flags. Depending on these circumstances, GDB may only "see" a peripheral in a certain context, which can make the debugging experience quite frustrating.
To aid this, we generate a linkerscript fragment and source file, which place the peripherals memory as real objects in the peripheral memory space. You can then access these peripherals inside GDB at any time, regardless of context and build profile setting:
This does not have any effect on your firmware!** It is purely a debug helper feature and none of these definitions make it into the executable.