GithubHelp home page GithubHelp logo

Comments (5)

jessebraham avatar jessebraham commented on July 27, 2024 1

Since the issue of bootloaders is likely rather complex, I'm thinking for the time being we should just default to the standard boot mode supported by all chips and put direct boot behind a feature instead. This keeps the default configuration consistent across devices. We can always change this again in the future if needed, but for right now unless anybody has any objections I think this is probably the correct choice.

from esp-hal.

MabezDev avatar MabezDev commented on July 27, 2024

Controversial take, maybe we should ignore direct boot all together.

Ideally, we'd like to run all our chips without a second stage boot loader, and currently we are basically using the boot loader for two things:

  • Setting up the flash mappings and cache
  • Reading the partition table and booting the main app

Given that for our no_std use case we only have one "partition", the app partition, that then leaves us with the boot loader only setting up the flash and instruction cache. Maybe we should look at doing that for all our chips?

Maybe this isn't such an easy task, but it seems like MMU is documented in the reference manual (and there are some registers in DPORT to do with the MMU too). At the very least we could cheat for a while and use the ROM functions, until we have a pure Rust solution.

Thoughts?

from esp-hal.

bjoernQ avatar bjoernQ commented on July 27, 2024

I probably don't know enough about the first stage boot loader - I thought it can only load code into RAM and executes that?

Long term my concern would be how to handle OTA updates and encryption. Haven't looked into encrypted firmware image handling yet

from esp-hal.

ducktec avatar ducktec commented on July 27, 2024

Maybe this isn't such an easy task, but it seems like MMU is documented in the reference manual (and there are some registers in DPORT to do with the MMU too). At the very least we could cheat for a while and use the ROM functions, until we have a pure Rust solution.

I remember trying to figure out setting up the cache for the C3 variant and struggling with it:

For the ESP32-C3 there appears to be a dedicated peripheral that is responsible for the cache and the peripheral was not yet documented in the TRM. I just checked again and with ESP32-C3 TRM v0.6 that still seems to be the case: While the dedicated peripheral is mentioned in the peripheral mapping table (address 0x600C_4000), there's no corresponding description. AFAIK, the only way to access the external memory is through the cache, so we also can't just bypass it for the time being.

The official SVD already has the registers and even field descriptions, but their register description reads
<description>This description will be updated in the near future.</description>.

In general (assuming that the peripheral gets eventually documented or with just using the ROM functions), I like the idea to switch to normalboot for the ESP32-C3 by default. That'll probably allow for doing more things in the future (secure boot, flash encryption etc.) and would establish consistency among the variants.

from esp-hal.

bjoernQ avatar bjoernQ commented on July 27, 2024

+1 for defaulting to the standard boot for C3, also naming the feature is much easier: "direct-boot" even matches what is used by espflash

from esp-hal.

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.