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
rardiol has joined #rust-embedded
brazuca has joined #rust-embedded
<re_irc> <swedishhat> Is that jack line out or line in? If it's meant for audio out, it looks like you could pwm GP18 and GP19 to put "simulated" sine waves on those pins
<Darius> I doubt it's going to be very high quality though
<Darius> it is connected to an RC low pass filter
brazuca has quit [Quit: Client closed]
starblue has quit [Ping timeout: 248 seconds]
starblue has joined #rust-embedded
rardiol has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
emerent has quit [Ping timeout: 255 seconds]
emerent has joined #rust-embedded
explore has quit [Quit: Connection closed for inactivity]
explore has joined #rust-embedded
<re_irc> <jannic> Is the inductive load of a (small) speaker safe for a gpio pin?
<re_irc> <jannic> Or, more precisely, can the safe limits be easily deduced from the data sheets?
<Darius> jannic: sounds a bit to analogue for me to answer, I would cargo cult the solution from elsewhere or ask a real EEng :)
explore has quit [Quit: Connection closed for inactivity]
explore has joined #rust-embedded
gsalazar has joined #rust-embedded
<re_irc> <762spr> I'm having a hard time configuring both the clocks and SPI. Both require a freq, but I don't know what to put in.
<re_irc> I am trying the example here, using the partially completed HAL for the L4xx STM32's. For example configuring the clocks:
<re_irc> let clocks = rcc
<re_irc> .cfgr
<re_irc> <762spr> does not work because of the 80.Mhz() what should I use instead?
<re_irc> <matejcik> some time ago sometime here talked about running nightly cargo with stable rustc (in order to get "-Z build-std=core")
<re_irc> i tried it back then and it seemed to work ... but now I can't do it anymore? rustc complains that "-Z unstable-options" is only accepted by the nightly compiler. Any idea why cargo would pass that option? I didn't specify it, my invocation is this:
<re_irc> "cargo build -v --release --features model_tt,ui,micropython -Z build-std=core -Z build-std-features=panic_immediate_abort --target thumbv7em-none-eabihf"
<re_irc> <matejcik> (i'm on nixos with rust overlay, so maybe that could have something to do with it?)
<re_irc> <matejcik> the "-Z unstable-options" is there because cargo adds "--outdir" to build options when I enable "-Z build-std=core". it goes away if I don't specify build-std=core. even with nightly cargo.
<re_irc> <matejcik> ~~the "-Z unstable-options" is there because cargo adds "--outdir" to build options when I enable "-Z build-std=core". it goes away if I don't specify build-std=core. even with nightly cargo.~~
<re_irc> scratch that it's not --outdir, that is there anyway and works fine without unstable-options
<re_irc> <matejcik> scratch that it's not --outdir, that is there anyway and works fine without unstable-options
<re_irc> <matejcik> it seems that it's because build-std=core inserts a "noprelude" link. which is unstable.
<re_irc> now i'm wondering whether this ever worked.
starblue has quit [Ping timeout: 248 seconds]
starblue has joined #rust-embedded
explore has quit [Quit: Connection closed for inactivity]
explore has joined #rust-embedded
<re_irc> <diondokter> Cool! Nordic just announced a WiFi chip: https://www.nordicsemi.com/Products/nRF7002
<re_irc> It's not a full MCU, just a chip
<re_irc> <luojia65> Kuhan has released first industry grade PCIe 5.0 SSD controller chip, the Aurora(TM), it's using RISC-V architecture and it's taped out under 14nm process https://weibo.com/ttarticle/p/show?id=2309404800197397184584
brazuca has joined #rust-embedded
explore has quit [Quit: Connection closed for inactivity]
gsalazar has quit [Read error: Connection reset by peer]
gsalazar has joined #rust-embedded
causal has joined #rust-embedded
causal has quit [Quit: WeeChat 3.6]
<re_irc> <Mehmet Ali> Hi, If I am creating a struct that would use a type implementing an embedded-storage NorFlash + ReadNorFlash traits
<re_irc> <Mehmet Ali> Can I use the consts ERASE_SIZE
<re_irc> <Mehmet Ali> on compile time?
<re_irc> <Mehmet Ali> For example if I wanted to keep track of pages with an array
<re_irc> <Mehmet Ali> can I deduce page count for arbitrary types
<re_irc> <diondokter> I think that should be possible yeah
<re_irc> <Mehmet Ali> and on compile time have an array with the length of page count
<re_irc> <Mehmet Ali> diondokter: Yeah, I feel that too
<re_irc> <Mehmet Ali> sth like
<re_irc> <Mehmet Ali> struct Allocator <NF: NorFlash + ReadNorFlash> {
<re_irc> flash: NF,
<re_irc> }
<re_irc> pages: [u8;NF::ERASE_SIZE/8],
<re_irc> <Mehmet Ali> oh that is not right,
<re_irc> <Mehmet Ali> but still syntactically should be similiar
<re_irc> <Mehmet Ali> I expect this to return pages [u8,4096] in my flash
<re_irc> <Mehmet Ali> but when I make a constructor:
<re_irc> <Mehmet Ali> impl<NF> Allocator <NF>
<re_irc> {
<re_irc> where NF: NorFlash + ReadNorFlash,
<re_irc> pub fn new(flash: NF, page_count:u32) -> Self {
<re_irc> <Mehmet Ali> * [0x00;flash.ERASE_SIZE],
<re_irc> <Mehmet Ali> Well, just a moment, let me be sure of sth
<re_irc> <diondokter> "flash.ERASE_SIZE" should at least be "NF::ERASE_SIZE"
<re_irc> <Mehmet Ali> right?
<re_irc> <Mehmet Ali> error: constant expression depends on a generic parameter
<re_irc> 22 | pages: [0x00;NF::ERASE_SIZE],
<re_irc> |
<re_irc> --> flash-manager\src\lib.rs:22:26
<re_irc> <Mehmet Ali> That was my first idea
<re_irc> <diondokter> Oh, then that's still a limitation apparently
<re_irc> <diondokter> Yeah, const generics are not entirely done yet :P
<re_irc> <Mehmet Ali> AAAhh is this what it was all about?
<re_irc> <Mehmet Ali> That long missed feat
<re_irc> <Mehmet Ali> that everyone was talkin about.
<re_irc> <Mehmet Ali> Any idea how to do this in a native fashion?
<re_irc> <Mehmet Ali> through a Trait implementing consts?
<re_irc> <Mehmet Ali> Okay, so did this with const generics feature flag.
<re_irc> <Mehmet Ali> Hope that it is stablish.
<re_irc> <diondokter> The syntax probably is. Real question is if the compiler is stable :P
<re_irc> <Mehmet Ali> Yep, I see.
<re_irc> <Mehmet Ali> Will think it through.
<re_irc> <Mehmet Ali> But it is so convenient in cases where size is needed in compile time
<re_irc> <Mehmet Ali> or I am missing a very obvious solution
<re_irc> <diondokter> Yep! I'd say try it out and see if it's stable
<re_irc> <Mehmet Ali> (:
brazuca has quit [Quit: Client closed]
GenTooMan has quit [Ping timeout: 255 seconds]
<re_irc> <adamgreig> hi room, meeting time again! agenda is coming in a sec...
GenTooMan has joined #rust-embedded
<re_irc> <adamgreig> sorry, just dealing with some spam in another channel, one sec...
<re_irc> <adamgreig> ok, let's start!
<re_irc> <adamgreig> announcements first; critical-section 1.0 is released as part of the wg HAL team 🎉 and cortex-m 0.7.6 is also released adding a critical-section implementation (though its interrupt::free is the same as before to avoid breaking)
<re_irc> <adamgreig> I haven't had much time to go through emails from the week but I think that's it for announcements, did anyone have anything else?
<re_irc> <James Munns> If anyone is starting a commercial rust project, I'd love to chat with you about mnemOS :)
<re_irc> More details in this tweet thread: https://twitter.com/bitshiftmask/status/1559300833464008706
<re_irc> <James Munns> (tl;dr: looking for a company as an early adopter to sponsor dev, and work on it along side a commercial project, instead of developing in a vacuum)
<re_irc> <James Munns> * dev and/or contract me to work on OS + the actual project),
<re_irc> <James Munns> (end hashtag ad)
<re_irc> <adamgreig> 👍️
<re_irc> <adamgreig> cool, anything for embedded HAL this week?
<re_irc> <adamgreig> the new i2c PR and the split nb PR are still drafts, but it looks like dirbaio isn't around atm to discuss them, don't think there's been particular updates since last week anyway?
<re_irc> <therealprof> I think there was a bit of discussion but I didn't watch too closely (sorry).
<re_irc> <eldruin> not from my side. I adapted an spi driver to the new SpiDevice interface and it went very smoothly. the hal impl part was merged into stm32f4xx-hal.
<re_irc> <adamgreig> nice, I guess hopefully push forward on those two and then we're very close to e-h 1.0
<re_irc> <eldruin> we can bikeshed a name for the crate where ExclusiveDevice could go
<re_irc> <eldruin> and/or think about what could go in there
<re_irc> <adamgreig> I li
<re_irc> <adamgreig> * liked "embedded-hal-extras" 😅
<re_irc> <eldruin> :D
<re_irc> <adamgreig> 🚲️
<re_irc> <adamgreig> there wasn't a bikeshed emoji...
<re_irc> <adamgreig> so there's ExclusiveDevice, either blocking or blocking+async versions, there's maybe RefCell based bus sharing...
<re_irc> <adamgreig> I'm not sure what the mutex/cs it refers to is, like a mutex-based bus sharing?
<re_irc> <eldruin> yes
<re_irc> <adamgreig> in chibios for example it has an optional mutex you can acquire to share the bus, but it has pre-empted multithreading so you don't necessarily deadlock
<re_irc> <adamgreig> and then maybe it could contain some adapters for e.g. async to blocking or something?
<re_irc> <eldruin> maybe, yes
<re_irc> <adamgreig> I guess they don't all need to live in the same crate, though
<re_irc> <eldruin> it kind of becomes a big bag of stuff
<re_irc> <eldruin> exactly
<re_irc> <adamgreig> so could have embedded-hal-bus and embedded-hal-adaptors or something
<re_irc> <eldruin> also possible
<re_irc> <emilgardis> what would be the plan for hosting the source code for those crates, same workspace as e-h?
<re_irc> <emilgardis> (I don't like how it ended up with svd2rust 😄)
<re_irc> <eldruin> yeah I think we can keep it like e-h-async
<re_irc> <emilgardis> * 😄, scattered repos)
<re_irc> <adamgreig> yea, having it all in embedded-hal repo seems fine
<re_irc> <eldruin> they are all quite related so I think it is easier that way
<re_irc> <jannic> One small disadvantage would be that it becomes difficult to assign good git tags.
<re_irc> <adamgreig> yea, we do have that issue a but in the cortex-m repo - it also makes the github releases a bit confusing
<re_irc> <adamgreig> but on balance it doesn't seem too bad and definitely saves a lot of faff having a ton of repos
<re_irc> <emilgardis> (not to mention desync issues)
<re_irc> <adamgreig> I'd just keep the v1.0 tags for embedded-hal, then have prefixed tags like e-h-shared-1.0 or whatever for other crates
<re_irc> <adamgreig> even if you just keep the github releases only for the main embedded-hal crate it still works fine
<re_irc> <emilgardis> actually though, could go the way cargo, clippy etc has done it now, subtrees
<re_irc> <eldruin> Ok I think I like having a e-h-bus crate for the exclusive device and refcell and whatever bus/device related and after that we can think of another crate for adaptors and whatever, but -bus would get us going
<re_irc> <emilgardis> +(instead of submodules)
<re_irc> <eldruin> adamgreig: yeah that is what I did for e-h-async
<re_irc> <eldruin> the name just gets long :D
<re_irc> <emilgardis> I have something to ping for resources, https://github.com/rust-embedded/cargo-binutils/issues/120#issuecomment-1128592870. there's an example in the e-nomicon https://docs.rust-embedded.org/embedonomicon/smallest-no-std.html that doesn't work, code sample 6
<re_irc> <adamgreig> oh, weird
<re_irc> <adamgreig> I'll try and take a look later, can't think of anything obvious that should cause it
<re_irc> <adamgreig> next up on the agenda is critical-section; there's an open PR for adding a std impl which I guess can be 1.1 :P https://github.com/rust-embedded/critical-section/pull/22
<re_irc> <adamgreig> I haven't had a chance to look at the impl yet, sorry, will try and do later tonight
<re_irc> <adamgreig> the other related point is if we cut a new bare-metal release that re-exports the c-s types and calls itself deprecated
<re_irc> <adamgreig> I think "yes" but maybe we can do it in a few weeks once some things have swapped to using critical-section and we've had a better feel for it
<re_irc> <adamgreig> I think that's about all I had then, anyone else have anything to discuss?
<cr1901> I'm trying to convert msp430 to use critical_section today
<cr1901> does that count as news?
<cr1901> (Oh right, bridge still dead?)
<re_irc> <adamgreig> ok, let's finish a bit early today then! thanks everyone 👋
<cr1901> agg: Bridge still dead :(
<agg> ugh :(((
<agg> why does it still work for some users... i'm sort of out of good ideas to fix it
<agg> (for everyone in matrix we're discussing how the bridge is half dead)
<agg> I think I'll delete my homeserver entirely and restart it, it seems to be a homeserver problem
<cr1901> I could come to Matrix for meetings, but I can't partition my bandwidth across multiple clients
<cr1901> continuously* anyway
codes03 has joined #rust-embedded
<cr1901> agg: While you're here... what was the rationale for not providing interrupt::free as a wrapper over critical_section::with?
<cr1901> in the cortex-m crate*
<agg> I just left to drive home actually but the idea is operating without interrupts is a thing someone might want to do separately to being in a critical section
<re_irc> <dirbaio> 👋
* cr1901 nods
<re_irc> <dirbaio> sorry had some unexpected issues and couldn't attend the meeting :|
<re_irc> <dirbaio> but yeah, no updates from me on the i2c stuff
<re_irc> <dirbaio> and on the "split nb" PR, is it just waiting on me to remove the "-can" crate, or was there stuff left to discuss?
<re_irc> <dirbaio> * crate (so it can go back to its original repo),
brazuca has joined #rust-embedded
brazuca has quit [Quit: Client closed]
codes03 has quit [Quit: Client closed]
GenTooMan has quit [Ping timeout: 255 seconds]
GenTooMan has joined #rust-embedded
starblue has quit [Ping timeout: 248 seconds]
starblue has joined #rust-embedded
emerent has quit [Ping timeout: 256 seconds]
emerent has joined #rust-embedded