-
Notifications
You must be signed in to change notification settings - Fork 119
Open
Labels
Description
On most microcontrollers I've worked with, interactions with hardware happens via memory mapped IO. For example, writing to memory addres 0x4000A7FF could set a GPIO pin high; reading from that address could read out the state of a GPIO pin.
In C, this is mostly done by using the volatile keyword, for example:
*((volatile uint32_t*) 0x4000A7FF) = *((volatile uint32_t*) 0x4000A7FF) | 1;.
This forces the compiler to really fetch/store to the memory address every time it's used, since it can have side-effects.
Most microcontroller vendors also publish the memory regions of their chips, which then looks something like this:
So, what rev.ng would need to support this:
- Support for adding volatile memory regions for memory mapped IO (in Ghidra, you have R,W,X,volatile)
- Support for emitting the
volatilekeyword when interacting with the memory mapped IO regions