AndroidOS, Linux cannot save configs after rebooting

Dear Toradex,

Currently, I’m working on Toradex colibri iMX7D with Android Nougat (or Linux). I got the issue when I rebooting board, all configs that I make before was erased.

Step 1: I connect to board via SerialPort to make configs for board (export GPIOs and change permission for its)

Step 2: From Android app, I connect to peripheral via I2C protocol and read data, I also read input value from GPIOs success

Step3: After rebooting, all configs before was erased so my android app can’t read input value from GPIO nor data from I2C protocol. I have to return to Step 1

When I check in LinuxOS, the situation is the same

My question: How to save all configurations permanently?

Regard,

Tuan

@tuanphan , welcome to our Community.
I have limited knowledge about Android. But you mentioned it can be reproduced on Linux OS. So do you mean Linux OS on colibri iMX7D? If it is, what is the Linux BSP version? You can it by cat /etc/issue.
In our default Linux BSP, I2C interfaces are enabled in the device tree. And they are listed under /dev.

root@colibri-imx7-emmc:~# ls /dev/|grep i2c
colibri-i2c
colibri-i2c-on-module
i2c-0
i2c-3

The default user root can always access them without exporting GPIOs.

root@colibri-imx7-emmc:~# i2cdetect -y -r 0
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- UU -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- UU -- -- -- 
30: -- -- -- UU -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                         
root@colibri-imx7-emmc:~# i2cdetect -y -r 3
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- UU -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --  

Many thanks @benjamin.tx for your support but I just used Linux OS for testing. My concern is Android OS and currently, when I rebooting device, all configs can’t save

I have found on internet some ways like rebuilding Android OS or changing init.rc file (but I didn’t find init.rc file in android version 7.1.2)

Anyway, I think my problem is popular when user wants to develop application on embedded device with Android OS

I would greatly appreciate it if you kindly give me some any ideas to solve the problem?

Regard,
Tuan

Hi @tuanphan , I am sorry that I have little experience with Android. But I can have a look at this.