In the fast-gpio repository opening /dev/mem is executed in the Module::_SetupAddress.
After opening /dev/mem the close(m_mfd) function is called which closes /dev/mem before doing any write command.
I am trying to toggle gpio15 in my C++ program and its not working yet.
In https://github.com/OnionIoT/fast-gpio/blob/master/src/fastgpioomega2.cpp, the
open("/dev/mem", O_RDWR), then
mmaps 1024 bytes starting from the given base address. The result tof the
mmapis stored into
regAddressand based on this memory-mapped address the program accesses the registers. So the file handle is not needed anymore and is closed.
mmap-ed block should later freed using
munmap()but the code doesn't do that. However, it should still work.
I.e. I don't see a problem with the library code. What is the application program you've written to access GPIO15?
@Maximilian-Gerhardt Thank you for your reply.
GPIO16 and GPIO17 work on the Expansion dock but GPIO15 is always at 1.5V. I tested the same program on another MT7688 module but the same issue persists.
I am using openwrt 18.06 for the onion omega.
GPIO16 and GPIO17 work on the Expansion dock but GPIO15 is always at 1.5V.
Omega-Expansion-Dock.pdf (IO is GPIO).
Forget what I wrote. I misunderstood your post(s). :-(