Quantcast
Channel: Embedded - The Rust Programming Language Forum
Browsing all 48 articles
Browse latest View live

Rust book and lifetimes

After some programming I found that it was time to re-read the rust book, and stumbled across the following section: https://doc.rust-lang.org/book/ch10-03-lifetime-syntax.html Here, it says: The...

View Article



Get access to item behind blocking_mutex::Mutex

I have a global struct that I want to protect behind a blocking mutex. However, I am unable to access it. Here is a MWE: #![no_std] #![no_main] #![feature(type_alias_impl_trait)] use...

View Article

Twiggy reports join3 as garbage, but why and can this code be eliminated?

In an embedded project with embassy, I have an async fn that ends with async fn ..... { // .... let _ = join3(a_fut, b_fut, c_fut).await; } This is to get the async code parts to run, but they...

View Article

Which types to use for peripherals in function arguments

I am struggling with the rust type system and its use for embassy peripherals. In this specific case, I'd like to move a peripheral ref into a struct that then provides some functionality, using a...

View Article

Channel-based concurrency for bare metal applications

I'm writing no-std application for ESP32. Currently, in order to send data to another core, I use Mutex with Option, and check it each n millis when waiting for value. I wonder if there are any mpsc...

View Article


Image may be NSFW.
Clik here to view.

Moving value "into" async task

What I am trying to achieve is this: I have a display driver type that uses an SPI and a few Output pins (of a STM32 controller). This type is tested and works as it should. The code to initialize and...

View Article

Image may be NSFW.
Clik here to view.

What I Learned Making an embedded-hal Driver in Rust (for the MAX6675...

I wrote an article about what I learned while writing an embedded-hal driver for the MAX6675 thermocouple digitizer. Feel free to check it out! What I Learned Making an embedded-hal Driver in Rust...

View Article

Code size when printing floating point numbers

In an embedded project, I would like to print some f32 numbers. The way I do it now I have a lot of code in my build just to do that: ======================================== ROM...

View Article


Access Variables in build.rs

Hi, I'm looking at creating an ASAP2 (A2L) file for the program where it would to read information about types of variables, such name and type etc. What is the best method for getting this...

View Article


ESP32 non_std and digital v2 pins and Rust

Hi, I am new to Rust, probably count as new to embedded but really really old. That out of the way. I have started on my journey of banning myself from C and C++ so wanted to use rust instead. I have...

View Article

{solved} Noob need help with RPI Pico and SH1106 Display

Hello, could someone be so kind an explain a noob how to convert this Parameter from MicroPython Example into Rust Code ? MicroPython spi =...

View Article

Noob need help - RPI Pico - howto generate Sound / play mp3?

Hello, have a Raspberry Pi Pico with a Speaker at GPIO15. Did not understand how to generate Tones - could someone be so kind and explain with a Example please ? Is it possible to play mp3 files ?...

View Article

STK8BA58 acceleration sensor how to use?

Hello, is there a lib to use the STK8BA58 acceleration sensor ? 3 posts - 2 participants Read full topic

View Article


Uf2conv build uf2 File for RPI Pico?

Hi, tryed to build a uf2 File for RPI Pico but did not work Example uf2 file: $ file picopac.uf2 picopac.uf2: UF2 firmware image, family Raspberry Pi RP2040, address 0x10000000, 687 total blocks My...

View Article

Microbit change output dynamically

Hi community! I've been working on a Microbit v2 project that is a metronome - device that emits sounds periodically. Sound is emitted using PWM and it can be directed to build-in speaker pin (P0_01)...

View Article


Image may be NSFW.
Clik here to view.

Testing Your Embedded Rust (feat. embedded-hal-mock and explosions)

New article on how to test your Rusty embedded drivers! I didn't see much fanfare behind embedded-hal-mock, but it absolutely deserves some attention! I highly recommend giving it a try barretts.club...

View Article

PubSub channel in embassy

I have difficulties understanding how exactly the PubSub-Channel in Embassy works. My questions are: How exactly are the data in the channel queued?. In the docs, I find this definition: pub struct...

View Article


Image may be NSFW.
Clik here to view.

How can I make a wrapper function for a STM32 HAL library?

Hi, I am new to Rust, and I have a question about how I can create a function that wraps up 'block!(tx.write( b'\r' )).ok();' specifically in the code below. fn main() -> ! { //... let serial =...

View Article

Image may be NSFW.
Clik here to view.

Flashing a STM32F103

Hi, I am trying to get blink working on my bluepill which I bought off AliExpress. I can get the example blink.ino code to work on arduino IDE using "Generic STM32F103C6" using the stlink upload...

View Article

Implementing drivers via with some common functionality

I'm currently looking on how to improve existing phy drivers for lora-rs project. LoRa phy layer expects each driver to implement so called RadioKind trait which contains bunch of calls to configure...

View Article
Browsing all 48 articles
Browse latest View live




Latest Images