tock-bootloader icon indicating copy to clipboard operation
tock-bootloader copied to clipboard

no port for risc-v

Open elderbig opened this issue 3 years ago • 4 comments

Is there some plan support for port risc-v ?

elderbig avatar Oct 09 '22 12:10 elderbig

In theory, the bootloader shouldn't need any modifications to support RISC-V, but would just need to be ported to a specific RISC-V chip/board. I think the main issue is that a suitable board needs:

  • Some way to automatically enter the bootloader
  • Flash HIL support
  • UART receive HIL support
  • Enough flash space to hold the bootloader

which I'm not sure there are any RISC-V boards that are really suitable. So, to answer your question, I don't think there are any short-term plans to port the bootloader to a RISC-V platform.

bradjc avatar Oct 09 '22 13:10 bradjc

Thanks! In actually, I want build bootloader for esp-c3-M1-kit,but I do not know how to do,it seems a lot of things to do,.

elderbig avatar Oct 10 '22 14:10 elderbig

The basic idea is you are creating a version of the Tock kernel that runs the bootloader code. You would want to combine the main esp-c3 board with a version of the bootloader configuration from one of the boards in this repo.

One issue we always have with bootloaders is having some method for telling the bootloader to actually run, rather than jump to the main kernel. We have used a few options in the past:

  • Using the DTR/CTS pins on the UART FTDI chip to indicate that the bootloader should run.
  • Pressing a button during boot.
  • Checking for a change in baud rate and rebooting into the bootloader.

I'm guessing that for the esp-c3-M1-kit the only option will be to have the user hold the button, but I'm not 100% sure.

Beyond that really the "only" task is to be able to create the Bootloader object:

https://github.com/tock/tock-bootloader/blob/7062d743885e91642d9a5f0bd9cf5c3219c3e30d/boards/nano33ble-bootloader/src/main.rs#L263-L279

I say "only" because it requires a few resources. If those are not already implemented then they will need to be implemented for that chip.

bradjc avatar Oct 10 '22 15:10 bradjc

I'm interested too!

It seems the only way to have a pure rust system, isn't it? Rust OS + Rust app

I have no idea about bootloaders, but I'll give your instructions, @bradjc, a try!

Another question: the 'normal' esp32 bootloader boots up when powered up, this behavior is not possible using tock?

Cheers!

gentooza avatar Jan 15 '24 16:01 gentooza