esp rs progress
This commit is contained in:
parent
45e474726f
commit
922f2415a4
3 changed files with 21 additions and 3 deletions
|
|
@ -2,8 +2,11 @@
|
|||
# runner = "probe-rs run --chip RP2040"
|
||||
runner = "sudo picotool load -u -v -x -t elf"
|
||||
|
||||
[target.xtensa-esp32-none-elf]
|
||||
runner = "espflash flash --monitor"
|
||||
|
||||
[build]
|
||||
target = "thumbv6m-none-eabi" # Cortex-M0 and Cortex-M0+
|
||||
target = "xtensa-esp32-none-elf"
|
||||
|
||||
[env]
|
||||
DEFMT_LOG = "debug"
|
||||
|
|
|
|||
|
|
@ -2,6 +2,7 @@
|
|||
inputs = {
|
||||
nixpkgs.url = "github:NixOS/nixpkgs";
|
||||
rust-overlay.url = "github:oxalica/rust-overlay";
|
||||
esp-rs.url = "github:leighleighleigh/esp-rs-nix";
|
||||
};
|
||||
|
||||
outputs =
|
||||
|
|
@ -9,6 +10,7 @@
|
|||
self,
|
||||
rust-overlay,
|
||||
nixpkgs,
|
||||
esp-rs,
|
||||
}:
|
||||
let
|
||||
overlays = [ (import rust-overlay) ];
|
||||
|
|
@ -20,11 +22,16 @@
|
|||
{
|
||||
packages.x86_64-linux.elf2uf2-rs = pkgs.callPackage ./elf2uf2.nix { };
|
||||
devShell.x86_64-linux = pkgs.mkShell {
|
||||
buildInputs = [
|
||||
buildInputs = with pkgs; [
|
||||
espflash
|
||||
esptool
|
||||
(pkgs.rust-bin.selectLatestNightlyWith (
|
||||
toolchain:
|
||||
toolchain.default.override {
|
||||
targets = [ "thumbv6m-none-eabi" ];
|
||||
targets = [
|
||||
"thumbv6m-none-eabi"
|
||||
"xtensa-esp32-none-eabi"
|
||||
];
|
||||
extensions = [ "rust-src" ];
|
||||
}
|
||||
))
|
||||
|
|
|
|||
|
|
@ -37,11 +37,19 @@ async fn logger_task(usb: embassy_rp::Peri<'static, embassy_rp::peripherals::USB
|
|||
|
||||
embassy_usb_logger::run!(1024, log::LevelFilter::Info, driver);
|
||||
}
|
||||
#[embassy_executor::task]
|
||||
async fn periodic_log() {
|
||||
loop {
|
||||
info!("periodic log");
|
||||
Timer::after_millis(1000).await;
|
||||
}
|
||||
}
|
||||
|
||||
#[embassy_executor::main]
|
||||
async fn main(spawner: Spawner) {
|
||||
let p = embassy_rp::init(Default::default());
|
||||
spawner.spawn(unwrap!(logger_task(p.USB)));
|
||||
spawner.spawn(unwrap!(periodic_log()));
|
||||
|
||||
info!("Hello World!");
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue