sanitycheck: run custom pre script before open the serial port
In some cases it might be a good idea to reset the board for real to make sure it is completely recovered from some failed state (simple re-loading of the application binary or even Elf file contents doesn't affect most of internal CPU states so doesn't help in recovery, see https://github.com/zephyrproject-rtos/zephyr/issues/25022 & https://github.com/zephyrproject-rtos/zephyr/issues/26665). And so we may want to utilize some external utility which triggers the hard reset (in case of ARC boards it is https://github.com/foss-for-synopsys-dwc-arc-processors/rff-ftdi-reset ). So we need to have a way to execute an external command before each and every test. Now given we already have quite some call-backs we try to use them before re-inventing the wheel. And pre_script seem to be a good option with just on minor note - it is called after serial port gets open. And while in some cases it might be OK if serial port on the board is not affected by the board's reset, if it is affected we'll be losing connection on reset (and that's the case with ARC boards BTW as the FTDI USB-to-Serial IC is also wired to the reset signal on most of the boards). That said we just move invocation of pre_script before opening the serial port and everything should be good now. Signed-off-by:Watson Zeng <zhiwei@synopsys.com>
Loading
Please sign in to comment