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

no port for risc-v #27

Open
elderbig opened this issue Oct 9, 2022 · 4 comments
Open

no port for risc-v #27

elderbig opened this issue Oct 9, 2022 · 4 comments

Comments

@elderbig
Copy link

elderbig commented Oct 9, 2022

Is there some plan support for port risc-v ?

@bradjc
Copy link
Contributor

bradjc commented Oct 9, 2022

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.

@elderbig
Copy link
Author

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,.

@bradjc
Copy link
Contributor

bradjc commented Oct 10, 2022

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:

let bootloader = static_init!(
bootloader::bootloader::Bootloader<
'static,
bootloader::uart_receive_multiple_timeout::UartReceiveMultipleTimeout<
'static,
VirtualMuxAlarm<'static, nrf52::rtc::Rtc>,
>,
bootloader::flash_large_to_small::FlashLargeToSmall<'static, nrf52::nvmc::Nvmc>,
>,
bootloader::bootloader::Bootloader::new(
recv_auto_cdc,
flash_adapter,
&bootloader_exit,
pagebuffer,
&mut bootloader::bootloader::BUF
)
);

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.

@gentooza
Copy link
Contributor

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants