Code Monkey home page Code Monkey logo

Comments (5)

SuperCuber avatar SuperCuber commented on August 16, 2024 1

@9names thanks a lot, that works! Time to mess around with it :D

from rp-hal.

SuperCuber avatar SuperCuber commented on August 16, 2024

Might be related: I'm trying to build an example and I get this error

error: linking with `rust-lld` failed: exit code: 1
<lots of arguments>
\target\thumbv6m-none-eabi\debug\build\cortex-m-rt-eb0715ff362a68a0\o
ut\link.x:23: cannot find linker script memory.x
          >>> INCLUDE memory.x
          >>>         ^

from rp-hal.

9names avatar 9names commented on August 16, 2024

Might be, hard to say. I'm having trouble reproducing it or @jonathanpallant's issue with it only building from the root of the repo.
I just tried doing clean builds of blinky on linux and windows

  • in the root
  • in the rp2040-hal directory
  • in the rp2040-hal/examples directory

And builds of pico_blinky

  • in the boards directory
  • in the boards/pico/
  • in the boards/pico/examples directory

Successfully built and linked every time.

Can you provide any more information on OS, how you're building, rust version, etc?

from rp-hal.

SuperCuber avatar SuperCuber commented on August 16, 2024

Windows 10, cargo 1.56.0 (4ed5d137b 2021-10-04)

I copied .cargo/config to my project, and the pico_blinky.rs example to my main.rs, then ran cargo run from the root of the project.
dependencies mostly copied from pico/Cargo.toml:

[dependencies]
pico = { git = "https://github.com/rp-rs/rp-hal.git" }
cortex-m = "0.7.2"
rp2040-hal = "0.2"
cortex-m-rt = { version = "0.7"}
embedded-time = "0.12.0"
usb-device= "0.2.8"
usbd-serial = "0.1.1"
usbd-hid = "0.5.1"
panic-halt= "0.2.0"
embedded-hal ="0.2.5"
cortex-m-rtic = "0.6.0-alpha.5"
rp2040-boot2 = "0.2"
nb = "1.0"
i2c-pio = { git = "https://github.com/ithinuel/i2c-pio-rs", rev = "fb6167d02b7fbc46a83f344f5242823bcd16e271" }

from rp-hal.

9names avatar 9names commented on August 16, 2024

oh, in that case you will need a copy of memory.x in your project folder.
if you just want to run an example from the HAL, use this command from inside your rp-hal folder:

cargo build --release --example blinky

If you want something you can copy the examples into, can I suggest looking at https://github.com/rp-rs/rp2040-project-template?
It's configured by default to use a debugger (a second Pico will do, if you have one), but you could strip out a bunch of the dependencies and use the .cargo/config from the hal with it if you want to program over the USB bootloader.

from rp-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.