Other Parts Discussed in Thread: TPS65218
I am a embedded engineer. I use Ti SDK to develop product.
hardware: TMDSEVM437X
hardware link: https://www.ti.com/tool/TMDSEVM437X
soc: Ti am437x
sdk: ti-processor-sdk-linux-am437x-evm-06.03.00.106
sdk link: https://www.ti.com/tool/PROCESSOR-SDK-AM437X
sdk u-boot version: u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3
host PC: Debian 10
I enable CONFIG_AUTOBOOT_KEYED and set CONFIG_AUTOBOOT_DELAY_STR as NULL and set CONFIG_AUTOBOOT_STOP_STR as NULL.
CONFIG_AUTOBOOT_KEYED: 1
CONFIG_AUTOBOOT_DELAY_STR: “”
CONFIG_AUTOBOOT_STOP_STR: “”
I add some print logs to file “u-boot-2019.01+gitAUTOINC+333c3e72d3-g333c3e72d3/common/autoboot.c”. When i start up the board, the terminal conncted to board show some logs and it’s normal.
But I find a problem. When u-boot autoboot is ongoing (the boot timeout time has not expired), if i press any key, the process will hang and the printout will stop. I think the process don’t exit “do while“ loop.
Because there is no “passwd end” log that i add. I think it has been in the “tstc” function and did not exit. So i think it’s error. I think it should be when u-boot autoboot is ongoing (the boot timeout time has not expired), if i press any key, the process will continues and the print log will continues to output until the boot timeout time is reached.
The terminal log is as follows:
U-Boot SPL 2019.01-g5dac0286d2-dirty (Jun 18 2020 - 15:36:12 +0800)
Trying to boot from MMC1
SPL: Please implement spl_start_uboot() for your board
SPL: Direct Linux boot not active!
U-Boot 2019.01-g5dac0286d2-dirty (Jun 18 2020 - 15:36:12 +0800)
CPU : AM437X-GP rev 1.2
Model: TI AM437x GP EVM
DRAM: 2 GiB
PMIC: TPS65218
NAND: 512 MiB
MMC: OMAP SD/MMC: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment
Net:
Warning: ethernet@4a100000 using MAC address from ROM
eth0: ethernet@4a100000
Autoboot in 30 seconds
delay key:<>
stop key:<>
presskey_len: 0, presskey_max: 0
time: 544812, end time: 90523059
time: 553707, end time: 90523059
time: 562603, end time: 90523059
time: 571498, end time: 90523059
The print logs that i add is as follows:
static int passwd_abort(uint64_t etime)
{
debug_bootkeys("presskey_len: %d, presskey_max: %d\n", presskey_len, presskey_max); // wl.yan, display: “presskey_len: 0, presskey_max: 0 ”; it’s right
/* In order to keep up with incoming data, check timeout only
* when catch up.
*/
do {
if (tstc()) {
if (presskey_len < presskey_max) {
presskey[presskey_len++] = getc();
} else {
for (i = 0; i < presskey_max - 1; i++)
presskey[i] = presskey[i + 1];
presskey[i] = getc();
debug_bootkeys("presskey: %c\n", presskey[0]); // wl.yan
}
debug_bootkeys("1presskey: %c\n", presskey[0]); // wl.yan
}
//debug_bootkeys("presskey_len: %d, time: %llu, end time: %llu\n", presskey_len, get_ticks(), etime); // wl.yan
debug_bootkeys("time: %llu, end time: %llu\n", get_ticks(), etime); // wl.yan, it will continue to print log before the boot timeout time is reached
for (i = 0; i < sizeof(delaykey) / sizeof(delaykey[0]); i++) {
if (delaykey[i].len > 0 &&
presskey_len >= delaykey[i].len &&
memcmp(presskey + presskey_len -
delaykey[i].len, delaykey[i].str,
delaykey[i].len) == 0) {
debug_bootkeys("got %skey\n",
delaykey[i].retry ? "delay" :
"stop");
/* don't retry auto boot */
if (!delaykey[i].retry)
bootretry_dont_retry();
abort = 1;
}
}
} while (!abort && get_ticks() <= etime);
debug_bootkeys("passwd end\n"); // wl.yan
}