A basic rp2040-hal project with blinky and rtt logging example code.

Overview

Project template for rp2040-hal

This template is intended as a starting point for developing your own firmware based on the rp2040-hal.

It includes all of the knurling-rs tooling as showcased in https://github.com/knurling-rs/app-template (defmt, defmt-rtt, panic-probe, flip-link) to make development as easy as possible.

probe-run-rp is configured as the default runner, so you can start your program as easy as

cargo run --release

Requirements

  • The standard Rust tooling (cargo, rustup) which you can install from https://rustup.rs/

  • Toolchain support for the cortex-m0+ processors in the rp2040 (thumbv6m-none-eabi)

  • flip-link - this allows you to detect stack-overflows on the first core, which is the only supported target for now.

  • probe-run. Upstream support for RP2040 is not finished yet, so this template uses probe-run-rp for now. probe-run-rp is a version of probe-run using a probe-rs fork with support for the RP2040 chip. Note that this installs the binary with name probe-run-rp, so you can still have the original probe-run installed in parallel.

    This is important because probe-run-rp ONLY works with the RP2040 chip.

  • A CMSIS-DAP probe. (JLink probes sort of work but are very unstable. Other probes won't work at all)

    You can use a second Pico as a CMSIS-DAP debug probe by installing the following firmware on it: https://github.com/majbthrd/DapperMime/releases/download/20210225/raspberry_pi_pico-DapperMime.uf2

    More details on supported debug probes can be found in debug_probes.md

Installation of development dependencies

rustup target install thumbv6m-none-eabi
cargo install --git https://github.com/rp-rs/probe-run --branch rp2040-support
cargo install flip-link

Running

For a debug build

cargo run

For a release build

cargo run --release

License

This project is licensed under either of

at your option.

Comments
  • Linking: Can't compile

    Linking: Can't compile

    error: linking with `flip-link` failed: exit code: 1
      |
      = note: "flip-link" "-flavor" "gnu" "D:\\Dev\\rp2040-project-template\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_project_template-1198b80032431cff.rp2040_project_template.9c75850d-cgu.0.rcgu.o" "--as-needed" "-L" "D:\\Dev\\rp2040-project-template\\target\\thumbv6m-none-eabi\\release\\deps" "-L" "D:\\Dev\\rp2040-project-template\\target\\release\\deps" "-L" "D:\\Dev\\rp2040-project-template\\target\\thumbv6m-none-eabi\\release\\build\\rp2040-project-template-ff201362c93239a8\\out" "-L" "D:\\Dev\\rp2040-project-template\\target\\thumbv6m-none-eabi\\release\\build\\cortex-m-edb3200537960378\\out" "-L" "D:\\Dev\\rp2040-project-template\\target\\thumbv6m-none-eabi\\release\\build\\cortex-m-rt-44339646bd76ccef\\out" "-L" "D:\\Dev\\rp2040-project-template\\target\\thumbv6m-none-eabi\\release\\build\\defmt-4ae0c0a354199f32\\out" "-L" "D:\\Dev\\rp2040-project-template\\target\\thumbv6m-none-eabi\\release\\build\\rp2040-pac-6d37e37f505878c4\\out" "-L" "C:\\Users\\yallxe\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib" "-Bstatic" "C:\\Users\\yallxe\\AppData\\Local\\Temp\\rustcxHD7yj\\libcortex_m_rt-de909aa96899d9be.rlib" "--start-group" "C:\\Users\\yallxe\\AppData\\Local\\Temp\\rustcxHD7yj\\libcortex_m-f1aabfc11535f99f.rlib" "--end-group" "C:\\Users\\yallxe\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib\\libcompiler_builtins-8800918f309bcb9b.rlib" "-Bdynamic" "--eh-frame-hdr" "-znoexecstack" "-L" "C:\\Users\\yallxe\\.rustup\\toolchains\\nightly-x86_64-pc-windows-msvc\\lib\\rustlib\\thumbv6m-none-eabi\\lib" "-o" "D:\\Dev\\rp2040-project-template\\target\\thumbv6m-none-eabi\\release\\deps\\rp2040_project_template-1198b80032431cff" "--gc-sections" "-O1" "--nmagic" "-Tlink.x" "-Tdefmt.x"
      = note: rust-lld: error: duplicate symbol: __aeabi_uidivmod
              >>> defined at rp2040_project_template.9c75850d-cgu.0
              >>>            D:\Dev\rp2040-project-template\target\thumbv6m-none-eabi\release\deps\rp2040_project_template-1198b80032431cff.rp2040_project_template.9c75850d-cgu.0.rcgu.o:(.text+0x1)
              >>> defined at arm.rs:14 (/cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.66/src\arm.rs:14)
              >>>            compiler_builtins-8800918f309bcb9b.compiler_builtins.14216641-cgu.174.rcgu.o:(.text.__aeabi_uidivmod+0x1) in archive C:\Users\yallxe\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\thumbv6m-none-eabi\lib\libcompiler_builtins-8800918f309bcb9b.rlib
              
              rust-lld: error: duplicate symbol: __aeabi_idivmod
              >>> defined at rp2040_project_template.9c75850d-cgu.0
              >>>            D:\Dev\rp2040-project-template\target\thumbv6m-none-eabi\release\deps\rp2040_project_template-1198b80032431cff.rp2040_project_template.9c75850d-cgu.0.rcgu.o:(.text+0x35)
              >>> defined at arm.rs:82 (/cargo/registry/src/github.com-1ecc6299db9ec823/compiler_builtins-0.1.66/src\arm.rs:82)
              >>>            compiler_builtins-8800918f309bcb9b.compiler_builtins.14216641-cgu.174.rcgu.o:(.text.__aeabi_idivmod+0x1) in archive C:\Users\yallxe\.rustup\toolchains\nightly-x86_64-pc-windows-msvc\lib\rustlib\thumbv6m-none-eabi\lib\libcompiler_builtins-8800918f309bcb9b.rlib
              
              flip-link: the native linker failed to link the program normally; please check your project configuration and linker scripts
              
    

    Getting this error very often, but sometimes it manages to compile and flash successfully.

    opened by yallxe 12
  • Failed to get information for AP ApAddress

    Failed to get information for AP ApAddress

    Running template:

    cargo run
    

    Used second Pico as probe. Set it up like it states in the readme. How must the target one be set up?

    Got following error:

    Error: Failed to get information for AP ApAddress { dp: Multidrop(1002927), ap: 0 }
    
    Stack backtrace:
       0: <unknown>
       1: <unknown>
       2: hid_write
       3: <unknown>
       4: <unknown>
       5: <unknown>
       6: <unknown>
       7: <unknown>
       8: <unknown>
       9: <unknown>
      10: hid_write
      11: BaseThreadInitThunk
      12: RtlUserThreadStart
    error: process didn't exit successfully: `probe-run-rp --chip RP2040 target\thumbv6m-none-eabi\debug\rp2040-project-template` (exit code: 1)
    
    opened by teamplayer3 9
  • typo: fix misspelled elf2uf2-rs

    typo: fix misspelled elf2uf2-rs

    In README.md, elf2uf2-rs has been misspelled as elf2usb2-rs in installation commands. In .cargo/config.toml, a quotation mark need to be added. For users who use VS Code with Rust Analyzer, setting target architecture could help them to avoid warning like no tests module.

    opened by KernelErr 7
  • when trying to build or run template: rust-lld: error: memory.x:2: region 'BOOT2' already defined

    when trying to build or run template: rust-lld: error: memory.x:2: region 'BOOT2' already defined

    im on fedora linux 5.17, just trying to get a template running to get started but i keep running into this error, can't figure out how to fix it:''

    note: rust-lld: error: memory.x:2: region 'BOOT2' already defined >>> BOOT2 : ORIGIN = 0x10000000, LENGTH = 0x100 >>> ^

         flip-link: the native linker failed to link the program normally; please check your project configuration and linker scripts
    

    the only thing i altered was the .cargo/config.toml, commenting out the probe-run and uncommenting the elf2uf2 runner. i have all the prerequisites installed.

    opened by osimmac 3
  • Flash problem

    Flash problem

    Hello,

    I'm using windows 10 and I have this problem:

    cargo run --release
        Finished release [optimized + debuginfo] target(s) in 0.11s
         Running `probe-run --chip RP2040 'target\thumbv6m-none-eabi\release\rp2040-project-template'`
    (HOST) WARN  (BUG) location info is incomplete; it will be omitted from the output
    Error: no probe was found.
    
    Common reasons for this are faulty cables or missing permissions.
    For detailed instructions, visit: https://github.com/knurling-rs/probe-run/tree/2f138c3#troubleshooting
    error: process didn't exit successfully: `probe-run --chip RP2040 'target\thumbv6m-none-eabi\release\rp2040-project-template'` (exit code: 1)
    

    could you help me?

    Thanks!

    opened by simeondmr 3
  • Failed to read register DRW at address 0x0000000c

    Failed to read register DRW at address 0x0000000c

    Hello, Please redirect me if this is the wrong resource to post this kind of issue, but I've found no place better than this issue tracker as I use this template to run Rust on my RPi Pico;

    With the guide in the Readme I connected two Picos, making one of them a probe and run debug build like this:

    DEFMT_LOG=trace cargo run
    

    It seems working, but it lasts only for a few seconds:

         Running `probe-run --chip RP2040 target/thumbv6m-none-eabi/debug/rp2040-project-template`
    (HOST) INFO  flashing program (4 pages / 16.00 KiB)
    (HOST) INFO  success!
    ────────────────────────────────────────────────────────────────────────────────
    INFO  Program start
    └─ rp2040_project_template::__cortex_m_rt_main @ src/main.rs:28
    INFO  on!
    └─ rp2040_project_template::__cortex_m_rt_main @ src/main.rs:60
    INFO  off!
    └─ rp2040_project_template::__cortex_m_rt_main @ src/main.rs:63
    INFO  on!
    └─ rp2040_project_template::__cortex_m_rt_main @ src/main.rs:60
    INFO  off!
    └─ rp2040_project_template::__cortex_m_rt_main @ src/main.rs:63
    INFO  on!
    └─ rp2040_project_template::__cortex_m_rt_main @ src/main.rs:60
    INFO  off!
    └─ rp2040_project_template::__cortex_m_rt_main @ src/main.rs:63
    INFO  on!
    └─ rp2040_project_template::__cortex_m_rt_main @ src/main.rs:60
    INFO  off!
    └─ rp2040_project_template::__cortex_m_rt_main @ src/main.rs:63
    INFO  on!
    └─ rp2040_project_template::__cortex_m_rt_main @ src/main.rs:60
    RTT error: Error communicating with probe: A core architecture specific error occured
    ────────────────────────────────────────────────────────────────────────────────
    Error: A core architecture specific error occured
    
    Caused by:
        0: Failed to read register DRW at address 0x0000000c
        1: An error specific to a probe type occured
        2: Error handling CMSIS-DAP command Transfer
        3: Timeout in USB communication.
    
    

    If I re-run this command, it won't even start (and blinky stops work as well):

         Running `probe-run --chip RP2040 target/thumbv6m-none-eabi/debug/rp2040-project-template`
    (HOST) INFO  flashing program (4 pages / 16.00 KiB)
    Error: Error while flashing
    
    Caused by:
        0: Something during the interaction with the core went wrong
        1: A core architecture specific error occured
        2: Failed to write register DRW at address 0x0000000c
        3: An error specific to a probe type occured
        4: Error handling CMSIS-DAP command TransferBlock
        5: Timeout in USB communication.
    

    However, when I reconnect the target Pico, it flashes and runs for a sec as before, then the same issue starts again.

    opened by fominok 2
  • Set DEFMT_LOG to

    Set DEFMT_LOG to "debug" from .cargo/config.toml

    This is for discussion: Since changing to defmt 0.3.0, most of the time I run a new firmware for the first time, I forget to set DEFMT_LOG. And during development, I usually want more logging than the default. So I wonder if it would be good to set this by default on rp2040-project-template.

    Pro:

    • it's usually a better choice when starting a new project
    • easier for new users (avoids questions like "why doesn't info!(...) work?")

    Con:

    • quite invisible, so new users don't learn about DEFMT_LOG
    opened by jannic 2
  • Fix BSP name: pico to rp-pico, rp_pico

    Fix BSP name: pico to rp-pico, rp_pico

    Since BSP rp-pico has been renamed from pico (https://github.com/rp-rs/rp-hal/pull/245/commits/8f0a2788eb05813f61c38eb502fc88b5bba749b7), we cannot build this template. This commit will fix it.

    opened by ochaochaocha3 2
  • Use pico bsp

    Use pico bsp

    The template is currently based around the HAL directly. BSP's help remove a bunch of boilerplate that never changes (configuring boot2, providing xtal freq, etc), and are generally more newbie-friendly - we should encourage ourselves and others to use them instead! This PR sets the BSP to Pico, with a few commented lines on how to switch this to the pro_micro_rp2040.

    Do not merge this until the boot2 changes are merged into the BSPs (https://github.com/rp-rs/rp-hal/pull/153) Resolves #9.

    opened by 9names 2
  • link fails with: undefined reference to `__delay'

    link fails with: undefined reference to `__delay'

    I attempted to use this template as the starting point for an Adafruit Macropad project. I copied he source from the template to my own directory: cp -r *.toml src build.rs debug_probes.md memory.x ~/src/adafruit-macropad/display-exp1/

    I then did a cargo run, but I got the following error:

       Compiling rp2040-hal-macros v0.1.0
       Compiling rp2040-hal v0.5.0
       Compiling rp-pico v0.4.1
    error: linking with `cc` failed: exit status: 1
      |
      = note: "cc" "-m64" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/rp2040_project_template-5c9295fd632a3622.rp2040_project_template.d805f0ac-cgu.0.rcgu.o" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/rp2040_project_template-5c9295fd632a3622.5cfu30hisiausn4a.rcgu.o" "-Wl,--as-needed" "-L" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps" "-L" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/build/rp2040-project-template-0f93619ec231a7e5/out" "-L" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/build/cortex-m-rt-d6878ed5c3ed57d0/out" "-L" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/build/defmt-97332e4df6d56af0/out" "-L" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/build/rp2040-pac-cc685785000e4137/out" "-L" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-Wl,-Bstatic" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/librp_pico-7a30f498d6ae53e0.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/librp2040_boot2-dda4ca584bdee45f.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/librp2040_hal-3c715a33b946e7dc.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libitertools-54688f651905effd.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libeither-bf5c634271f6a417.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/librand_core-de62b4be814e9d93.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libusb_device-b86dd6f6ceebaedd.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libpio-656ab518164bf189.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libnum_enum-e6812baaabe4edf0.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libarrayvec-7d5129ae8f91a3ce.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/librp2040_pac-a853b4a08b2f46c0.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libcortex_m_rt-48920c8c0169ffcf.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libcortex_m-b13ed367a85b02c4.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libvolatile_register-7c6a362789327219.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libvcell-067e3642933c0051.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libbare_metal-a1ced9fde106b5d1.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libpanic_probe-b3902792751d116e.rlib" "-Wl,--start-group" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd-05b39ac0cb4c5688.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libpanic_unwind-ccaa149b737d6503.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libobject-a94a6388c153126b.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libmemchr-1ecfa264246b85c6.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libaddr2line-ee710154a50440b8.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libgimli-f09986d873ea8592.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_demangle-f3521e20c99619ab.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libstd_detect-df6036c77d75ce21.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libhashbrown-24f91c1a1dfc7e13.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libminiz_oxide-bffcc61991adb202.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libadler-cf22313353d8663e.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_alloc-c45fb100f99430e9.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libunwind-0cdc47a8a81950ea.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcfg_if-f1e158606c4c82f6.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liblibc-0b608b5ef4df0ec4.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/liballoc-b8438dc0bcbbcc08.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libembedded_time-4c9f185abc615c7f.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libnum-c31b8324b35fc835.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libnum_iter-b71ef318aa5bbe47.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libnum_rational-661e4de1b7acdbfc.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libnum_integer-e1c4d47cf4f32bd9.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libnum_complex-05bb463d996234fe.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libnum_traits-1d988b2876c51126.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libembedded_hal-a51dd0984629f250.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libvoid-cdb416ea1e5022e2.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libnb-9b6e1f0f35a4812e.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libnb-f9931c59ff5c5690.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libdefmt_rtt-04342893eeb5d2a5.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libcritical_section-b4df06f7f2ab530c.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libcfg_if-4e50e8db9714af8c.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libbare_metal-31e1a91196489ace.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libdefmt-4bcd8875c69dc2d3.rlib" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/libbitflags-f22295ab5cd151fd.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/librustc_std_workspace_core-70e2ae036775ff2f.rlib" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcore-815d281f7068a893.rlib" "-Wl,--end-group" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib/libcompiler_builtins-377835cfab8dae0d.rlib" "-Wl,-Bdynamic" "-lgcc_s" "-lutil" "-lrt" "-lpthread" "-lm" "-ldl" "-lc" "-Wl,--eh-frame-hdr" "-Wl,-znoexecstack" "-L" "/home/thoth/.rustup/toolchains/stable-x86_64-unknown-linux-gnu/lib/rustlib/x86_64-unknown-linux-gnu/lib" "-o" "/home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/rp2040_project_template-5c9295fd632a3622" "-Wl,--gc-sections" "-pie" "-Wl,-zrelro,-znow" "-Wl,-O1" "-nodefaultlibs"
      = note: /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/rp2040_project_template-5c9295fd632a3622.rp2040_project_template.d805f0ac-cgu.0.rcgu.o: in function `cortex_m::register::primask::read':
              /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.5/src/register/primask.rs:29: undefined reference to `__primask_r'
              /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/rp2040_project_template-5c9295fd632a3622.rp2040_project_template.d805f0ac-cgu.0.rcgu.o: in function `cortex_m::interrupt::disable':
              /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.5/src/interrupt.rs:38: undefined reference to `__cpsid'
              /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/rp2040_project_template-5c9295fd632a3622.rp2040_project_template.d805f0ac-cgu.0.rcgu.o: in function `cortex_m::register::primask::read':
              /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.5/src/register/primask.rs:29: undefined reference to `__primask_r'
              /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/rp2040_project_template-5c9295fd632a3622.rp2040_project_template.d805f0ac-cgu.0.rcgu.o: in function `cortex_m::interrupt::disable':
              /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.5/src/interrupt.rs:38: undefined reference to `__cpsid'
              /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/rp2040_project_template-5c9295fd632a3622.rp2040_project_template.d805f0ac-cgu.0.rcgu.o: in function `cortex_m::interrupt::enable':
              /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.5/src/interrupt.rs:48: undefined reference to `__cpsie'
              /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.5/src/interrupt.rs:48: undefined reference to `__cpsie'
              /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/thoth/src/adafruit-macropad/display-exp1/target/debug/deps/librp2040_hal-3c715a33b946e7dc.rlib(rp2040_hal-3c715a33b946e7dc.rp2040_hal.2024d92b-cgu.0.rcgu.o): in function `cortex_m::asm::delay':
              /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.5/src/asm.rs:29: undefined reference to `__delay'
              /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.5/src/asm.rs:29: undefined reference to `__delay'
              /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.5/src/asm.rs:29: undefined reference to `__delay'
              /usr/lib/gcc/x86_64-pc-linux-gnu/11.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /home/thoth/.cargo/registry/src/github.com-1ecc6299db9ec823/cortex-m-0.7.5/src/asm.rs:29: undefined reference to `__delay'
              collect2: error: ld returned 1 exit status
              
      = help: some `extern` functions couldn't be found; some native libraries may need to be installed or have their path specified
      = note: use the `-l` flag to specify native libraries to link
      = note: use the `cargo:rustc-link-lib` directive to specify the native libraries to link with Cargo (see https://doc.rust-lang.org/cargo/reference/build-scripts.html#cargorustc-link-libkindname)
    

    I expected it to at least generate the "binary" and fail at the install step, since I have not studied the exact procedure for getting firmware onto the RP2040 (The arduino IDE can send a sketch over the USB cable, but I have read other articles talking about holding the boot button while copying a file over USB)

    Did I fail to copy something, or has there been some API drift that broke the sample app?

    opened by mutantbob 1
  • Add cargo embed config + docs

    Add cargo embed config + docs

    We previously only had probe-run as a debug configuration. Now that cargo embed supports defmt, gdb and a bunch of other stuff we should document that as well. Need to use a git version, since the latest release does not support rp2040

    opened by 9names 1
  • repo / crate name

    repo / crate name

    This was originally intended to be used like https://github.com/knurling-rs/app-template, so an end-user would create a new project from this repo using cargo-generate and it would rename the crate, add authors, etc That's not how it currently works - and I'm not sure we even want that. Beginners are way more likely to clone/download this repo and then wonder why nothing works if they needed to run cargo-generate. And not everyone is comfortable around the terminal, we should want to support IDE-only users..

    So maybe this should be named rp2040-quickstart, or something more accurate and obvious.

    opened by 9names 0
  • Mention + document other runners

    Mention + document other runners

    Currently assume everyone wants probe-run. Need to add how-to if for other runners to the docs, .cargo/config etc elf2uf2 is added to the docs in https://github.com/rp-rs/rp2040-project-template/pull/14

    opened by 9names 0
Owner
rp-rs
Rust on the RP series of microcontrollers. https://matrix.to/#/#rp-rs:matrix.org
rp-rs
An example project demonstrating integration with Rust for the ESP32-S2 and ESP32-C3 microcontrollers.

Rust ESP32 Example An example project demonstrating integration with Rust for the ESP32-S2 and ESP32-C3 microcontrollers.

Espressif Systems 303 Jan 4, 2023
Help project managers and project owners with easy-to-understand views of github issue dependencies.

Help project managers and project owners with easy-to-understand views of github issue dependencies.

nasa 56 Dec 15, 2022
Create That Project. Project Creation That Rocks 🎸🧱.

Create That Project Config Example Install $ cargo install ctp Basic Info In any file or even in the commands sections of your config file you can pla

Will 5 Dec 20, 2021
Alternative basic focus movement for the sway and i3 window managers.

sway-overfocus Alternative basic focus movement for the sway and i3 window managers. The primary goal of this program is to create one set of keybinds

null 42 Oct 23, 2022
basic multiple package manager

baka basic multiple package manager Docs Env baka_root_setting Windows: %USERPROFILE%/.baka/config Linux, Mac: $HOME/.baka/config baka_plugins (Just u

null 8 Dec 29, 2021
Basic Rust I2C demo on the TI Launchpad

msp430-i2c-oled-example An example project to talk to an SSD1306 OLED (Adafruit PiOLED) with an MSP430G2553 Launchpad via I2C.

Edward Shin 3 Jul 9, 2021
Edgelord is a library for Cloudflare Workers. You can scaffold a basic bot for discord, slack, etc.

Edge Computing + chūnibyō = Edgelord ✨ ?? Edgelord Edgelord is now working. You can contribute for it. Edgelord is a Rust library for cloudflare worke

null 23 Dec 26, 2022
Basic ActivityPub Server (in Rust)

Basic ActivityPub Server (in Rust) This is a deep-dive on this blog post: https://blog.joinmastodon.org/2018/06/how-to-implement-a-basic-activitypub-s

Mat 10 Nov 24, 2022
Simplistic complier~virtual-machine that transforms AST into a Rust function, with basic type checking

rast-jit-vm rast-jit-vm is a simplistic, proof-of-concept~ish compiler / virtual machine that transforms syntax tree into a Rust function, type-checki

Patryk Wychowaniec 4 Oct 23, 2022
A CLI tool to convet Hex color code or RGB to color code, RGB, HSL and color name(if exists)

iro -色- A CLI tool to convert the hex color code or RGB to color code, RGB, HSL, color name(if exists, according to jonathantneal/color-names). Usage

Kyohei Uto 3 Dec 9, 2022
The Voting example based on MoonZoon and Solana.

Voting example The Rust-only Voting example based on MoonZoon and Solana. MoonZoon is a Rust Fullstack Framework. Solana is a decentralized blockchain

Martin Kavík 26 Dec 8, 2022
An example Kibana plugin written in Rust and Typescript

An example Kibana plugin written in Rust and Typescript

Aleh Zasypkin 3 Dec 24, 2022
unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

unflow 是一个低代码、无代码设计语言。unFlow is a Design as Code implementation, a DSL for UX & backend modeling. DSL to Sketch file, Sketch to DSL, DSL to code.

Inherd OS Team (硬核开源小组) 70 Nov 27, 2022
Rust / C / Cgo example

whatever How to build (This has been tested on Linux & macOS) Build the Rust code: $ cargo build The library is in ./target/debug/libwhatever.a Build

Amos Wenger 6 Jun 21, 2022
An example of Brainf*** JIT-compiler with only the standard library.

jit-compiler An example of Brainf*** JIT-compiler with only the standard library. Prerequisite Rust(1.56.0-nightly or later, but it must work kind of

Akihito KIRISAKI 18 Jan 22, 2022
A variation of the solana helloworld program example with a client written in Rust instead of Typescript

Simple Solana Smart Contract Example This repository demonstrates how to create and invoke a program on the Solana blockchain. In Solana the word prog

zeke 56 Dec 26, 2022
Example of structuring a proc macro crate for testability

testing-proc-macros Example of structuring a proc macro crate for testability. See accompanying blog post for details. License Licensed under either o

Ferrous Systems 12 Dec 11, 2022
A example bevy application using bevy-kajiya for its renderer

☀️ bevy-kajiya playground A example bevy application using bevy-kajiya for its renderer NOTE: only tested on Windows. For more context, check out the

Sebastian Hamel 20 Dec 5, 2022
Example of reading the BME280 sensor on an ESP32-C3 using Rust

Rust ESP32-C3 BME280 Example of reading the BME280 sensor on an ESP32-C3 using Rust Hardware: ESP32-C3 microcontroller BME280 sensor Breadboard Jump w

Wei-ying Chen 21 Mar 9, 2024