In the production process, the LPC is not flashed before the first boot.
The sanity_check then detects an error, which is confusing since it doesn't mean that the LPC is KO.
This version first checks if the LPC is present (meaning that a valid firmware is here). if it's not the case AND if the first_time_run flag is set to YES, it will automatically flash the firmware and try again.
This will ensure that the sanity_check will alert only on defective board (or at least on those without a running LPC, whatever the reason), but not because of an empty LPC.
In the production process, the LPC is not flashed before the first boot. The sanity_check then detects an error, which is confusing since it doesn't mean that the LPC is KO. This version first checks if the LPC is present (meaning that a valid firmware is here). if it's not the case AND if the first_time_run flag is set to YES, it will automatically flash the firmware and try again. This will ensure that the sanity_check will alert only on defective board (or at least on those without a running LPC, whatever the reason), but not because of an empty LPC.