Code Monkey home page Code Monkey logo

Comments (10)

xobs avatar xobs commented on May 24, 2024 1

This functionality was implemented in API v2.0.

from toboot.

mithro avatar mithro commented on May 24, 2024

@xobs - FYI

from toboot.

xobs avatar xobs commented on May 24, 2024

We don't clear the entire application area for a number of reasons. First, we're not sure what's application and what's data. An application may want to save configuration data across firmware versions.

The proposed solution is to set the Configuration Value to disable the Toboot short-to-enter ability. Then when a user wants to update, the U2F program should clear its own keys, set the magic value, and reboot. That way an application can determine what areas to erase and what to keep.

from toboot.

gl-sergei avatar gl-sergei commented on May 24, 2024

OK. Then I need to come up with a good way to tell U2F firmware to reset itself. I think it may even be the same "short-at-boot"...

from toboot.

gl-sergei avatar gl-sergei commented on May 24, 2024

Second thought. What if we add another magic value to indicate that entering into bootloader via shorting pads should erase application area. I think there must be a way to get to bootloader even from locked device and adding it to application just makes things more complex and creates duplication of code and features. If we agree on that I volunteer to implement this feature.

from toboot.

gl-sergei avatar gl-sergei commented on May 24, 2024

Changed u2f firmware to

  1. turn off toboot short-to-boot feature
  2. added short-to-reset feature to erase secret keys and unlock toboot

im-tomu/chopstx@7aed937

There is now build option (turned off by default) to make u2f firmware to debug-lock the board on first start. It is not on by default because J Link required to unlock device.

Still I would happily throw this patch away if toboot allowed to erase application area.

from toboot.

xobs avatar xobs commented on May 24, 2024

The v2.0 API includes a 64-bit mask field in the header that allows you to request sectors to be erased. Is that sufficient to implement this request?

from toboot.

gl-sergei avatar gl-sergei commented on May 24, 2024

I guess yes. Just to make sure. If pages are erased during update, will toboot get the bitmask from the newly loaded program, or from the previous one?

from toboot.

xobs avatar xobs commented on May 24, 2024

It reads it from the previous image.

Toboot determines what the previous image is by looking at all blocks on the system and selecting the valid header that has the highest "generation" value. It will use that as an image to boot to.

Additionally, when performing an update it will use the existing header as a guideline for what blocks to erase. If you want to erase everything (except Toboot itself), set the value to 0xffffffff ffffffff.

from toboot.

gl-sergei avatar gl-sergei commented on May 24, 2024

Sounds good! Thank you for implementing that!

from toboot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.