We are using MiFi along with several of the GPIOs for a project and noticed something strange recently. On power up, the Mifi will turn on GPIO 15 for a few seconds, and then once UBoot hands off to OpenWRT to boot the GPIO goes off again.
Now I swear MiFis that we ordered 6 months ago did not do this, but perhaps I just never noticed it… anyway I downloaded the AR150/MiFi/Domino UBoot from GL-Inet github to see what was going on, and after some digging finally found these lines in “u-boot/common/main.c”:
all_led_off();
//add start by gl-inet_xiaoxin
gpio_control(GPIO_13_INDICATE_POWER,GPIO_13_ON);// This led is indicate power on
gpio_control(GPIO_6_ENABLE_USB,GPIO_6_ON);// This gpio is enable usb
//add end by gl-inet_xiaoxin
The definition pulled in from the Makefile for domino sets:
On the AR150 GPIO 15 is used for the the Power LED, so this makes sense; however on MiFi this GPIO is left available for user access.
So I have rebuilt Uboot with GPIO_13_ON set to 0, so that uBoot will not turn the GPIO on. The build looks OK, but I am nervous that something may not be right and I will end up bricking my unit… so:
a) Does MiFi have any kind of JTAG interface/support in case my build is bad??
b) Does anyone have such a JTAG interface hooked up and willing to test my uboot build???
then make clean; make domino and should be all good. You guys already have 3 binary images in the bin/ folder of that repository, so it would be easy enough to simply replace the existing uboot-gl-mifi.bin with the newly generated one, and leave the AR150 image alone…
Let me know if that is feasable… otherwise I will have to just close my eyes and potentially sacrifice 1 MiFi in the name of testing…
The system led for MIFI isn’t user controllable, it isn’t use GPIO15, while GPIO15 is user controllable. What you do is correct. I rebuilt a u-boot for you without turn on GPIO15. Please unzip the attachment.
@kyson-lok Awesome thank you, this solved the problem for us and lets GPIO 15 remain for use by our application without worrying about bootloader doing strange things to it!