Code Monkey home page Code Monkey logo

Comments (5)

ivmarkov avatar ivmarkov commented on June 22, 2024 1

OK, so I've published a new version of cargo-pio so you can try it out by re-issuing:

  • cargo install cargo-pio

The following command line now works:

  • cargo pio new -b sipeed-longan-nano -p gd32v my_blink2 (please note the lowercase name of the platform; matching is case sensitive)

... however, I cannot test the build of the resulting crate, because of this issue in PlatformIO.

Hope that helps.

from embuild.

ivmarkov avatar ivmarkov commented on June 22, 2024 1

By the way... this board looks like a pretty simple thing - no WiFi, BLE or anything like that. And only 32KB RAM / 128KB flash.

So if you really want to code in Rust for it, I don't see the need to go the Cargo->PIO route. Why not just using this crate, and forget about PlatformIO?

from embuild.

ivmarkov avatar ivmarkov commented on June 22, 2024 1

Great! Thank you.
Now it works flawlessly. Yes, Longan Nano is super cute and it has a Risc-V processor. I am a "fan" of rust and Risc-V and wanted to play with this combination.
Thank you for the tip for seedstudio-gd32v. I will give it a try.

The longan-nano crate actually looks like even more appropriate for your board, so I guess you should keep using that.

I wrote some instructions how to setup a development environment for Longan Nano in Win10 + WSL2 Debian for the rust language:
https://github.com/LucianoBestia/longan_nano_rust_wsl2_platformio_setup

That's great and I'll put edition = "2018" by default in the autogenerated lib.rs by cargo-pio. However my point is: you don't need cargo-pio actually?
Your project relies on a pure-Rust crate (longan-nano) and it is not interfacing with any Vendor SDK and/or C APIs. So why bother with PlatformIO and cargo-pio at all?

Just turn your demo crate from "static lib" to a binary crate one, say !#[cfg(no_main)] and you should be good to go. The build will generate a regular .elf file instead of the .hex one you need for flashing, but I'm sure there are pure-Rust utilities, which can do .elf to .hex and then do the flashing for your board.

I read lately that the ESP32-C will have a Risc-V processor with Wi-Fi and Bluetooth 5. Sounds like a good future.

Yes. That's the ESP32-C3 chip which is on my desk as we speak. Now, the ESP32-C3 is a whole different beast compared to your board - 10x more RAM, 40x more flash, and very difficult to write the WiFi & BLE layer from scratch in Rust, so you have to interface with the ESP-IDF SDK APIs. That's a chip where cargo-pio (either in its cargо-first variant or PIO-first) is really useful.

from embuild.

ivmarkov avatar ivmarkov commented on June 22, 2024

Nothing missing really, it is just that the current resolution algorithm assumes that the board name is unique across platforms. Let me try to fix it. Once/if fixed, your command cargo pio new -b sipeed-longan-nano -p GD32V my_blink2 should be working.

from embuild.

bestia-dev avatar bestia-dev commented on June 22, 2024

Great! Thank you.
Now it works flawlessly. Yes, Longan Nano is super cute and it has a Risc-V processor. I am a "fan" of rust and Risc-V and wanted to play with this combination.
Thank you for the tip for seedstudio-gd32v. I will give it a try.
I wrote some instructions how to setup a development environment for Longan Nano in Win10 + WSL2 Debian for the rust language:
https://github.com/LucianoBestia/longan_nano_rust_wsl2_platformio_setup
I needed to solve some workarounds, but now it works.
I read lately that the ESP32-C will have a Risc-V processor with Wi-Fi and Bluetooth 5. Sounds like a good future.

from embuild.

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.