ChanServ changed the topic of #rust-embedded to: Welcome to the Rust Embedded IRC channel! Bridged to #rust-embedded:matrix.org and logged at https://libera.irclog.whitequark.org/rust-embedded, code of conduct at https://www.rust-lang.org/conduct.html
Jonas[m]1 has quit [Quit: Idle timeout reached: 172800s]
IlPalazzo-ojiisa has quit [Quit: Leaving.]
JamesMunns[m] has quit [Quit: Idle timeout reached: 172800s]
GenTooMan has quit [Ping timeout: 252 seconds]
GenTooMan has joined #rust-embedded
luojia65[m] has quit [Quit: Idle timeout reached: 172800s]
brazuca has quit [Ping timeout: 245 seconds]
crabbedhaloablut has joined #rust-embedded
jsolano has quit [Ping timeout: 240 seconds]
jsolano_ has joined #rust-embedded
lehmrob has joined #rust-embedded
<ryan-summers[m]> <PhilMarkgraf[m]> "If no such driver is already..." <- I did a driver for a 4 channel ADC a while back, check out https://github.com/quartiq/booster/blob/main/ads7924/src/lib.rs for a reference design :)
<ryan-summers[m]> Many of the small, obscure ics don't really have drivers because they're small enough that spinning your own isn't hard
emerent has quit [Ping timeout: 258 seconds]
emerent_ has joined #rust-embedded
emerent_ is now known as emerent
lehmrob has quit [Ping timeout: 246 seconds]
Amanieu has quit [Server closed connection]
Amanieu has joined #rust-embedded
eldruin[m] has joined #rust-embedded
<eldruin[m]> <PhilMarkgraf[m]> "If no such driver is already..." <- You could also look at this driver I wrote a while back for a few ADC devices: https://crates.io/crates/ads1x1x
sjm42[m] has joined #rust-embedded
<sjm42[m]> Oh yeah, I have used that one myself for ads1115 with 8bit avr one day :D
<sjm42[m]> Fixed a stupid lab power supply that had broken V/A displays.
lehmrob has joined #rust-embedded
<eldruin[m]> <sjm42[m]> "Oh yeah, I have used that one..." <- > <@sjm42:matrix.org> Oh yeah, I have used that one myself for ads1115 with 8bit avr one day :D... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/VaMtSpxJgqbmIciKTQYXVdmT>)
IlPalazzo-ojiisa has joined #rust-embedded
mfiumara[m] has joined #rust-embedded
<mfiumara[m]> how to sleep in rust
brazuca has joined #rust-embedded
lehmrob has quit [Ping timeout: 252 seconds]
exark has quit [Quit: quit]
exark has joined #rust-embedded
<mfiumara[m]> Hey all, since I asked a lot of questions the past weeks in here I figure I write a small article about some of the basic questions on how to set up a debugging environment when coding for embedded targets using rust.
<mfiumara[m]> Hope it can be of some help for others around here!
<thejpster[m]> will you be revising the nested match loops or leaving-as is, as discussed on Linked In?
brazuca has quit [Quit: Client closed]
Guest7221 has left #rust-embedded [Error from remote client]
<mfiumara[m]> <thejpster[m]> "will you be revising the..." <- On GitHub yes, on medium I’m not sure I can still edit the article since it was published by Better Programming
Abhishek_ has quit [Server closed connection]
Abhishek_ has joined #rust-embedded
firefrommoonligh has joined #rust-embedded
<firefrommoonligh> <PhilMarkgraf[m]> "If no such driver is already..." <- I would go straight to the protocol section of the datasheet. A lot of these have a single register with a handful of bits to configure and command readings
<firefrommoonligh> > <@shakencodes:matrix.org> If no such driver is already available, is there an ADC driver you would recommend to use as an example? If I need to build this, I'd like to make the interface something that is expected and versatile (and ultimately, open source.)
<firefrommoonligh> * I would go straight to the protocol section of the datasheet. These often have have a single (or a few) register with a handful of bits to configure and command readings
<firefrommoonligh> Your interaction code is (after the appropriate bus is set up) likely to be a single function with a few lines
<firefrommoonligh> Possibly with some u8-repr config enums if you want to generalize it
dne has quit [Remote host closed the connection]
dne has joined #rust-embedded
<mfiumara[m]> thejpster Code samples updated
m5zs7k has joined #rust-embedded
Guest7221 has joined #rust-embedded
WSalmon has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
WSalmon has joined #rust-embedded
hyphened[m] has quit [Quit: Idle timeout reached: 172800s]
d3zd3z[m] has joined #rust-embedded
<d3zd3z[m]> Is anyone at RustConf2023?
<d3zd3z[m]> d3zd3z[m]: I've had them create a rust-embedded channel on the conference-specific Discord, for anyone present who may be interested in discussing.
dalepsmith[m] has quit [Quit: Idle timeout reached: 172800s]
<ilpalazzo-ojiis4> Is it possible to use The Compiler Explorer (aka “the Godbolt”) to see rustc's output for AVR targets?
<ilpalazzo-ojiis4> Thus far the options I've given are `-C opt-level=s -Z build-std=core --target=avr-unknown-gnu-atmega328 `, but it's telling me that... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/pDhVXFEMLWDlXAwRETtVTyHE>)
brazuca has joined #rust-embedded
dnm has quit [Server closed connection]
dnm has joined #rust-embedded
crabbedhaloablut has quit []
lehmrob has joined #rust-embedded
lehmrob has quit [Remote host closed the connection]
brazuca has quit [Quit: Client closed]
brazuca has joined #rust-embedded
<mfiumara[m]> Anyone experience with compiling a C project inside of build.rs using make?
JamesMunns[m] has joined #rust-embedded
<JamesMunns[m]> <mfiumara[m]> "Anyone experience with compiling..." <- like, specifically just shelling out to make? Or interacting with it more thoroughly?
<JamesMunns[m]> ah
<JamesMunns[m]> by default Command swallows the output, you have the choice to redirect it somewhere, or pipe it to the caller's stdout, BUT stdout in build-rs scripts is actually output to cargo itself, so you might need to forward to stderr or a file
<mfiumara[m]> Just handing it over to make it's a big project and I don't want to recreate the build process using cc::
brazuca has quit [Quit: Client closed]
<JamesMunns[m]> https://doc.rust-lang.org/stable/std/process/struct.Command.html has some examples for getting the output, you'd call output() instead of status()
GenTooMan has quit [Ping timeout: 252 seconds]
<JamesMunns[m]> Then Output can be used to obtain the status and all of the output to stdout/err: https://doc.rust-lang.org/stable/std/process/struct.Output.html
<mfiumara[m]> Ah that helps, then I can save the output to a file to see what's going on
<JamesMunns[m]> yep, or something like `panic!("{}", the_output);`
<mfiumara[m]> Yeah it's not doing anything it seems, make is just outputting `make[1]: Nothing to be done for `all'.
<mfiumara[m]> `
<mfiumara[m]> But when I go into the directory manually in a terminal it is definitely compiling. The path is correct
<JamesMunns[m]> I'd probably try making a small non-build-rs bin project, and mess with it there first, to make it easier to debug
<JamesMunns[m]> then when THAT works, move it over to a build-rs
<JamesMunns[m]> ah!
<JamesMunns[m]> > In addition to environment variables, the build script’s current directory is the source directory of the build script’s package.
<JamesMunns[m]> try printing your current dir, you might be in PROJECT/src instead of PROJECT
<mfiumara[m]> Yeah it works as a --bin
GenTooMan has joined #rust-embedded
<mfiumara[m]> I'm printing the folder name but it's correct
<JamesMunns[m]> did you print stdout and stderr? like did make complain more on stderr?
<mfiumara[m]> no there's nothing on stderr
<mfiumara[m]> I think the C project has to be located inside of src
<mfiumara[m]> But the documentation is not very clear
<mfiumara[m]> It's just this one sentence you quoted
<mfiumara[m]> I'll give that a shot
<mfiumara[m]> no luck 🙃
brazuca has joined #rust-embedded
brazuca has quit [Quit: Client closed]
<mfiumara[m]> Will try more tomorrow. I think I have to do something like copy the project into the OUT directory and then compile it from there
brazuca has joined #rust-embedded
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]