wiki:linux/devmem

This tool can be handy if direct memory address modification is needed based on a change desired after reading the processor reference manual available on Freescale's Website Link

devmem is a powerful, yet dangerous tool for modifying memory addresses.

root@OpenWrt:/# devmem
BusyBox v1.19.4 (2013-10-02 00:06:48 PDT) multi-call binary.

Usage: devmem ADDRESS [WIDTH [VALUE]]

Read/write from physical address

        ADDRESS Address to act upon
        WIDTH   Width (8/16/...)
        VALUE   Data to be written


Example Writing:

root@OpenWrt:/# devmem 0x20e05cc 32 0x1b0b8

Example Reading:

root@OpenWrt:/# devmem 0x20E06CC 32
0x0001B0B1

Processor Pin Mux devmem Example

Let's for example say we would like to modify a pin-mux register on a i.MX8 processor. Utilizing the reference manual for the processor (available from the processor manufacturer) we see we need to use devmem to write the value 101 (0x5 in hex) to the proper register.

Code to make this pin mux force the pin to be a GPIO as GPIO5_IO26:

devmem 0x30330244 32 0x5 
Last modified 4 months ago Last modified on 12/07/2023 08:04:39 PM

Attachments (2)

Download all attachments as: .zip

Note: See TracWiki for help on using the wiki.