I am trying to turn a LED on and off via GPIO Pin. I read several tutorials on how to get there with "bare metal" C. But I struggle to find the correct memory location to turn the GPIO on/off. I have this data sheet (using a raspberry Pi 4B this shoudl be the right chip?): https://datasheets.raspberrypi.com/bcm2 ... herals.pdf
according to this datasheet, I would need to put a 1 into the GPFSEL register to toggel a specific GPIO to output and afterwards writing into the GPFSET register to set/unset the pin. But how do I get to the correct memory addresses for example GPIO 16? GPIO registers should start at address 0x7e200000, but apparently I have to translate this memory address to a physical address first to use it, but how do I do that? Anyone have any hints on this conversion?
according to this datasheet, I would need to put a 1 into the GPFSEL register to toggel a specific GPIO to output and afterwards writing into the GPFSET register to set/unset the pin. But how do I get to the correct memory addresses for example GPIO 16? GPIO registers should start at address 0x7e200000, but apparently I have to translate this memory address to a physical address first to use it, but how do I do that? Anyone have any hints on this conversion?
Statistics: Posted by manoca — Wed Aug 14, 2024 8:08 am — Replies 0 — Views 11