@@ -35,69 +35,73 @@ int misc_test()
3535{
3636 int ret = 0 , rc = 0 ;
3737
38+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "device list" )) != 0 ) {
39+ rc |= ret ;
40+ printf ("device list - shell command failed %d\n" , ret );
41+ } else {
42+ printf ("device list - shell command was successful\n" );
43+ }
44+
3845#if DT_NODE_EXISTS (DT_NODELABEL (as6212 ))
39- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "sensor get " TEMP_0 )) != 0 )
40- {
46+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "sensor get " TEMP_0 )) != 0 ) {
4147 rc |= ret ;
4248 printf ("sensor get " TEMP_0 " - as6212 temp sensor - shell command failed %d \n" , ret );
4349 } else {
4450 printf ("sensor get " TEMP_0 " - as6212 temp sensor - shell command was successful\n" );
4551 }
4652#endif
53+
4754#if DT_NODE_EXISTS (DT_NODELABEL (bq24250 ))
48- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c read_byte " I2C_1 " 0x6a 0x3" )) != 0 )
49- {
55+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c read_byte " I2C_1 " 0x6a 0x3" )) != 0 ) {
5056 rc |= ret ;
5157 printf ("i2c read_byte " I2C_1 " 0x6a 0x3 - BQ24250 voltage regulator- shell command failed %d \n" , ret );
5258 } else {
5359 printf ("i2c read_byte " I2C_1 " 0x6a 0x3 - BQ24250 voltage regulator- shell command was successful\n" );
5460 }
5561#else
56- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c read " I2C_1 " 25 10" )) != 0 )
57- {
62+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c read " I2C_1 " 25 10" )) != 0 ) {
5863 rc |= ret ;
5964 printf ("i2c read " I2C_1 " 25 10 - ACT81460 PMIC - shell command failed %d \n" , ret );
6065 } else {
6166 printf ("i2c read " I2C_1 " 25 10 - ACT81460 PMIC - shell command was successful\n" );
6267 }
63- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c write_byte " I2C_1 " 25 47 98" )) != 0 )
64- {
68+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c write_byte " I2C_1 " 25 47 98" )) != 0 ) {
6569 rc |= ret ;
6670 printf ("i2c write_byte " I2C_1 " 25 47 98 - ACT81460 PMIC turn on GNSS - shell command failed %d \n" , ret );
6771 } else {
6872 printf ("i2c write_byte " I2C_1 " 25 47 98 - ACT81460 PMIC turn on GNSS - shell command was successful\n" );
6973 }
7074#endif
75+
7176#if DT_NODE_EXISTS (DT_NODELABEL (sonycxd5605 ))
72- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c read " I2C_1 " 24 10" )) != 0 )
73- {
77+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c read " I2C_1 " 24 10" )) != 0 ) {
7478 rc |= ret ;
7579 printf ("i2c read " I2C_1 " 24 10 - Sony cxd5605 GNSS - shell command failed %d \n" , ret );
7680 } else {
7781 printf ("i2c read " I2C_1 " 24 10 - Sony cxd5605 GNSS - shell command was successful\n" );
7882 }
7983#endif
84+
8085#if DT_NODE_EXISTS (DT_NODELABEL (tsl2540 ))
81- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "sensor get " TSL2540 )) != 0 )
82- {
86+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "sensor get " TSL2540 )) != 0 ) {
8387 rc |= ret ;
8488 printf ("sensor get " TSL2540 " - tsl25403 ambient light sensor - shell command failed %d \n" , ret );
8589 } else {
8690 printf ("sensor get " TSL2540 " - tsl25403 ambient light sensor - shell command was successful\n" );
8791 }
8892#endif
93+
8994#if DT_NODE_EXISTS (DT_NODELABEL (murata_1sc ))
90- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "tmo modem 1 imei" )) != 0 )
91- {
95+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "tmo modem 1 imei" )) != 0 ) {
9296 rc |= ret ;
9397 printf ("tmo modem 1 imei - murata 1sc- shell command failed %d \n" , ret );
9498 } else {
9599 printf ("tmo modem 1 imei - murata 1sc - shell command was successful\n" );
96100 }
97101#endif
102+
98103#if DT_NODE_EXISTS (DT_NODELABEL (rs9116w ))
99- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "tmo wifi status 2" )) != 0 )
100- {
104+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "tmo wifi status 2" )) != 0 ) {
101105 rc |= ret ;
102106 printf ("tmo wifi status 2 - rs9116w- shell command failed %d \n" , ret );
103107 } else {
@@ -111,48 +115,57 @@ int misc_test()
111115 printf ("tmo wifi scan 2 - rs9116w - shell command was successful\n" );
112116 }
113117#endif
118+
114119#if DT_NODE_EXISTS (DT_NODELABEL (lis2dw12 ))
115- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "sensor get " LIS2DW12 )) != 0 )
116- {
120+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "sensor get " LIS2DW12 )) != 0 ) {
117121 rc |= ret ;
118122 printf ("sensor get " LIS2DW12 " - accelerometer - shell command failed %d \n" , ret );
119123 } else {
120124 printf ("sensor get " LIS2DW12 " - accelerometer - shell command was successful\n" );
121125 }
122126#endif
127+
123128#if DT_NODE_EXISTS (DT_NODELABEL (lps22hh ))
124- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "sensor get " LPS22HH )) != 0 )
125- {
129+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "sensor get " LPS22HH )) != 0 ) {
126130 rc |= ret ;
127131 printf ("sensor get " LPS22HH " - pressure sensor - shell command failed %d \n" , ret );
128132 } else {
129133 printf ("sensor get " LPS22HH " - pressure sensor - shell command was successful\n" );
130134 }
131135#endif
132- if (( ret = shell_execute_cmd ( shell_backend_uart_get_ptr (), "fs write /tmo/access_id.txt 30 31 32 33 0a 0d" )) != 0 )
133- {
136+
137+ if (( ret = shell_execute_cmd ( shell_backend_uart_get_ptr (), "fs write /tmo/access_id.txt 30 31 32 33 0a 0d" )) != 0 ) {
134138 rc |= ret ;
135139 printf ("fs write /tmo/access_id.txt 30 31 32 33 0a 0d - SPI nor flash - shell command failed %d \n" , ret );
136140 } else {
137141 printf ("fs write /tmo/access_id.txt 30 31 32 33 0a 0d - SPI nor flash - shell command was successful\n" );
138142 }
139- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "fs read /tmo/access_id.txt" )) != 0 )
140- {
143+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "fs read /tmo/access_id.txt" )) != 0 ) {
141144 rc |= ret ;
142145 printf ("fs read /tmo/access_id.txt - SPI nor flash - shell command failed %d \n" , ret );
143146 } else {
144147 printf ("fs read /tmo/access_id.txt - SPI nor flash - shell command was successful\n" );
145148 }
146- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "fs rm /tmo/access_id.txt" )) != 0 )
147- {
149+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "fs rm /tmo/access_id.txt" )) != 0 ) {
148150 rc |= ret ;
149151 printf ("fs fs rm /tmo/access_id.txt - SPI nor flash - shell command failed %d \n" , ret );
150152 } else {
151153 printf ("fs rm /tmo/access_id.txt - SPI nor flash - shell command was successful\n" );
152154 }
155+
153156 if (strcmp (CONFIG_BOARD , "tmo_dev_edge" ) == 0 ) {
154- if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c scan " I2C_0 )) != 0 )
155- {
157+ /* Check for presence of On Semi LC709204F fuel gauge
158+ * (battery must be present for this to pass)
159+ */
160+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c read " I2C_1 " 0xb 0x15 2" )) != 0 ) {
161+ rc |= ret ;
162+ printf ("i2c read " I2C_1 "0xb 0x15 2 - LC709204F fuel gauge - shell command failed %d \n" , ret );
163+ } else {
164+ printf ("i2c read " I2C_1 "0xb 0x15 2 - LC709204F fuel gauge - shell command was successful\n" );
165+ }
166+
167+ /* Scan the secondary I2C bus (I2C_0) */
168+ if ((ret = shell_execute_cmd (shell_backend_uart_get_ptr (), "i2c scan " I2C_0 )) != 0 ) {
156169 rc |= ret ;
157170 printf ("i2c scan " I2C_0 " - shell command failed %d \n" , ret );
158171 } else {
0 commit comments