Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bootloader production mode fix #4195

Merged
merged 2 commits into from
Sep 20, 2024

Conversation

TychoVrahe
Copy link
Contributor

Fixes stuck bootloader when in production mode and touch is not present.

(some touch related typos fixed too)

@TychoVrahe TychoVrahe self-assigned this Sep 19, 2024
@TychoVrahe TychoVrahe requested review from cepetr and removed request for prusnak September 19, 2024 07:18
Copy link
Contributor

@matejcik matejcik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

#ifdef TREZOR_MODEL_T3T1
// on T3T1, tester needs to run without touch, so making an exception
// until unit variant is written in OTP
if (unit_variant_present()) {
ensure(touch_init(), "Touch screen panel was not loaded properly.");
secbool production_mode = unit_variant_present() ? secfalse : sectrue;
Copy link
Contributor

@cepetr cepetr Sep 19, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about something like this:

#ifdef USE_TOUCH
secbool touch_initialized = secfalse;
#ifdef TREZOR_MODEL_T3T1
secbool manufacturing_mode = unit_variant_present() ? secfalse : sectrue;
secbool allow_touchless_mode =  manufacturing_mode;
touch_initialized = touch_init();
if (allow_touchless_mode != sectrue) {
  ensure((touch_initialized, "Touch panel...");
}
#endif  // TREZOR_MODEL_T3T1
#endif // USE_TOUCH

..
..
..

if (touch_initialized != secfalse) {
  while (touch_ready() != sectrue) {
    hal_delay(1);
  }
}

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah its a bit better. Adjusted a bit to allow touch initialization for other models too, see 6187233

Copy link
Contributor

@cepetr cepetr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@TychoVrahe TychoVrahe force-pushed the tychovrahe/bootloader/production_mode_fix branch from 6187233 to ce47da9 Compare September 20, 2024 11:34
@TychoVrahe TychoVrahe merged commit c67d185 into main Sep 20, 2024
85 checks passed
@TychoVrahe TychoVrahe deleted the tychovrahe/bootloader/production_mode_fix branch September 20, 2024 13:13
@matejcik matejcik mentioned this pull request Sep 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: Approved
Development

Successfully merging this pull request may close these issues.

3 participants