GenTooMan has quit [Ping timeout: 250 seconds]
Shell has quit [Quit: ZNC 1.8.2 -]
Shell has joined #rust-embedded
GenTooMan has joined #rust-embedded
GenTooMan has quit [Excess Flood]
GenTooMan has joined #rust-embedded
fabic has joined #rust-embedded
tokomak has joined #rust-embedded
<re_irc> <@w​00tspeaks:m​> I'm looking at the cortex-m-semihosting crate. The version published to appears to be a very old version from before the code was moved to the same repo as the cortex-m crate. Has it been intentionally held back, or is it okay to use?
fabic has quit [Ping timeout: 250 seconds]
<re_irc> <@w​00tspeaks:m​> Also, I'm very unclear about how to use it with my board. Is there anything I could look at to help me? I have a cortex-m33 board (lcpxpresso55s16-evk). I'd love to use rust instead of C with it.
<re_irc> <@w​00tspeaks:m​> If anyone has pointers, I'd love to get them.
<re_irc> <@9​names:m​> i think the general advice is to use RTT instead of semihosting if you can
<re_irc> <@f​irefrommoonlight:m​> An interrupt with a lower priority should be allowed to fire in the ISR of a higher one right? (Cortex-M) I'm running into an issue where a sub-interrupt of a higher priority isn't firing if the programs polling in an ISR of lower pri. If I move this code to the main loop, it works. So, something's...
<re_irc> ... blocking the higher-pri from firing if it's in an ISR
<re_irc> <@f​irefrommoonlight:m​> Any ideas on what I could be doing wrong?
<re_irc> <@f​irefrommoonlight:m​> Wren T: use Probe-run
<re_irc> <@f​irefrommoonlight:m​>
<re_irc> <@f​irefrommoonlight:m​> Use this target: thumbv8m.main-none-eabihf
<re_irc> <@j​orgeig:m​> > An interrupt with a lower priority should be allowed to fire in the ISR of a higher one right? (Cortex-M) I'm running into an issue where a sub-interrupt of a higher priority isn't firing if the programs polling in an ISR of lower pri. If I move this code to the main loop, it works. So, something's blocking the...
<re_irc> ... higher-pri from firing if it's in an ISR
<re_irc> <@j​orgeig:m​> is there a confusion of lower/higher in this message? 😅 If I understand it right, in Cortex-M, the higher priority (as expressed by a higher priority value, not meaning that it has higher priority) will not interrupt a lower priority ISR
<re_irc> <@f​irefrommoonlight:m​> SOrry, I used confusing words
<re_irc> <@f​irefrommoonlight:m​> Higher pri = lower number
<re_irc> <@f​irefrommoonlight:m​> Btw... When I set the low priority interrup to 32 just now, it worked ?
<re_irc> <@f​irefrommoonlight:m​> I noticed a comment in the cortex-m `get_priority` doc statement: "*NOTE* NVIC encodes priority in the highest bits of a byte so values like `1` and `2` map
<re_irc> <@f​irefrommoonlight:m​> /// to the same priority. "
<re_irc> <@f​irefrommoonlight:m​> Could be related?
<re_irc> <@j​orgeig:m​> yes
<re_irc> <@f​irefrommoonlight:m​> cp.NVIC.set_priority(pac::Interrupt::RTC0, 2); // or any val through 31 doesn' twork
<re_irc> <@f​irefrommoonlight:m​> ```rust
<re_irc> <@f​irefrommoonlight:m​> cp.NVIC.set_priority(pac::Interrupt::TIMER1, 1);
<re_irc> <@j​orgeig:m​> if you set the value to 1 or 2 or 4, it's all the same
<re_irc> <@f​irefrommoonlight:m​> but if I set the RTC interrupt to `32` or higher, the pri 1 interrupt is allowed to fire within the pri 32 interrupt's ISR??
<re_irc> <@j​orgeig:m​> it's the highest 3 or 4 bits if I remember right
<re_irc> <@f​irefrommoonlight:m​> Why's that? `0b01` and `0b10` have different bits in both positions
<re_irc> <@f​irefrommoonlight:m​> I could just trial and error this
<re_irc> <@j​orgeig:m​> which cortex-m are you using?
<re_irc> <@f​irefrommoonlight:m​> Ie my thing works now. Maybe I need to look at the cortex-m RM. The Nordic one (This is on nrf52) has very little info on NVIC. The STM32 manuals have detailed tables, but not an answer for htis conundrum
<re_irc> <@f​irefrommoonlight:m​> Cortex-M4
<re_irc> <@j​orgeig:m​> oh then it has 256 levels, it's all the bits
<re_irc> <@j​orgeig:m​> I've never worked with nrf52, but got curious
<re_irc> <@j​orgeig:m​> are you working with the soft device too?
<re_irc> <@9​names:m​> Which has 256 levels? Don't nrf52's only have 16?
<re_irc> <@j​orgeig:m​> AFAIU cortex-m4 itself has 256 priorities (a full byte per interrupt), nrf might have something different on top
<re_irc> <@j​orgeig:m​> I was looking at their softdevice C code and they only allow three interrupt priorities in there
<re_irc> <@j​orgeig:m​> jorgeig: or this might be completely wrong, I just found a few lines of code that restrict the priority levels so it looks like you can't just set whatever you want when you use their API
<re_irc> <@j​orgeig:m​> not applicable here, I guess, since he was just using the Rust PAC methods
<re_irc> <@f​irefrommoonlight:m​> Nope. I'm doing ESB stuff
<re_irc> <@f​irefrommoonlight:m​> Taking a reading with an IR thermometer, and sending to another board. WOrking now that I by chance tried a very high interrupt number
<re_irc> <@f​irefrommoonlight:m​> I'm also confused by that - found some info on interrupts re soft device, but the manual is oddly blank about normal interrrupts
<re_irc> <@f​irefrommoonlight:m​> Compared to ST's
<re_irc> <@f​irefrommoonlight:m​> (ESB is a simple RF protocol that doesn't need softdevice)
<re_irc> <@9​names:m​> Says there are only 8 levels
<re_irc> <@9​names:m​> so only the top 3 bits matter
<re_irc> <@f​irefrommoonlight:m​> That appears to be for softdevice
<re_irc> <@f​irefrommoonlight:m​> Perhaps it's more broadly applicable though?
<re_irc> <@j​orgeig:m​> It says it's for the SoC
<re_irc> <@f​irefrommoonlight:m​> Ohh
<re_irc> <@f​irefrommoonlight:m​> Wait does top 3 bits mean in this context?
<re_irc> <@j​orgeig:m​> So even though it's in the softdevice docs, it might be for everybody!
<re_irc> <@f​irefrommoonlight:m​> Ie, `0b001` and `0b010` have differnet top 3 bits
<re_irc> <@9​names:m​> "The nRF52 SoC has eight configurable interrupt priorities ranging from 0 to 7 (with 0 being highest priority). On reset, all interrupts are configured with the highest priority (0)."
<re_irc> <@9​names:m​> that does not sound remotely softdevice specific
<re_irc> <@f​irefrommoonlight:m​> You're right
<re_irc> <@f​irefrommoonlight:m​> I'm curious how this maps to NVIC bits
<re_irc> <@f​irefrommoonlight:m​> And what's special about the 6th bit being significant (Why I need to set the low-priority interrupt to 32 in NVIC to allow it to be overridden)
<re_irc> <@j​orgeig:m​> If you look at the cortex m4 manual, each interrupt has a byte in a 32 bit register5
<re_irc> <@j​orgeig:m​> So in the nrf implementation, they're only using the 3 MSBits
<re_irc> <@j​orgeig:m​> Looks like
<re_irc> <@j​orgeig:m​> Which matches with what you're seeing
<re_irc> <@f​irefrommoonlight:m​> Thank you. I'll dive into that manual
<re_irc> <@j​orgeig:m​> It's weird that you have to do that manually though
<re_irc> <@j​orgeig:m​> I would expect the PAC to take care of it?
<re_irc> <@f​irefrommoonlight:m​> Maybe it's in there. I'm using the `cortex-m` crate to do this
<re_irc> <@f​irefrommoonlight:m​> Maybe thi sis differnet?
<re_irc> <@f​irefrommoonlight:m​> Found the Cortex-M table you referred to:
<re_irc> <@f​irefrommoonlight:m​> Total number of interrupt lines in groups of 32:
<re_irc> <@f​irefrommoonlight:m​> 0b0010 = 65...96
<re_irc> <@f​irefrommoonlight:m​> 0b0001 = 33...64
<re_irc> <@f​irefrommoonlight:m​> 0b0000 = 0...32
fabic has joined #rust-embedded
<re_irc> <@w​00tspeaks:m​> firefrommoonlight: Is this a tip for using my board, or an alternative to cortex-m-semihosting?
<re_irc> <@t​hejpster:m​> dkhayes117: No, just an introduction to rust in general
<re_irc> <@f​irefrommoonlight:m​> cortex-m semihosting
<re_irc> <@w​00tspeaks:m​> Looks neat. Thx.
GenTooMan has quit [Ping timeout: 250 seconds]
GenTooMan has joined #rust-embedded
GenTooMan has quit [Ping timeout: 250 seconds]
dcz has joined #rust-embedded
<dcz> hi! anyone here who maintains the sd-mmc library? my change seems stalled
GenTooMan has joined #rust-embedded
<re_irc> <@t​herealprof:m​> thejpster already approved it, eldruin could also merge it I think.
<dcz> I'm somewhat disappointed by merge requests lingering when the project is in the official rust-embedded community. Is there a way to help this? Join the group perhaps?
<re_irc> <@e​ldruin:m​> @dcz PR looks good. will merge once CI is through. thanks!
<dcz> seems I have to cargo fmt this
<re_irc> <@t​herealprof:m​> dcz: Just NB: This is *not* part of the official Rust Embedded WG, it's a community project.
<dcz> oh, is it the -community namespace?
<re_irc> <@e​ldruin:m​> I will rename the org to rust-embedded-unofficial, just haven't found the time yet
<re_irc> <@e​ldruin:m​> yes
<dcz> this one is official Rust Team project though, right :)?
<re_irc> <@e​ldruin:m​> the official repositories for RISCV are limited to riscv and riscv-rt:
<dcz> that's weird judging by the copyright note in the readme, but maybe someone copy-pasted it thoughtlessly
<re_irc> <@e​ldruin:m​> hmm, the readme hints at the riscv team within rust-embedded
<re_irc> <@d​isasm-ewg:m​> dcz: I've received your ping, will try to review the PR in ~8 hours
<dcz> cool! no hurry, I just want to be sure that someone actually cares about the projects I contribute to
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
fabic has quit [Ping timeout: 240 seconds]
<re_irc> <@d​khayes117:m​> dcz: I'm a new riscv team member, and I had planned on reviewing your PR. Currently, I am working on getting ADC and PWM PRs merged for gd32vf103xx-hal, which is why I hadn't yet 🙂
<re_irc> <@h​egza:m​> I'm teaching a short seminar course on embedded Rust at Tampere University, do you think it would be alright to include the embedded Rust logo (also this channel's logo) in 'marketing'? The course involves a small set of exercises to give an overview of what's available, and the students making a small embedded...
<re_irc> ... Rust project in groups.
<re_irc> <@h​egza:m​> I find it kind of sketchy because I don't represent the Rust Embedded WG -team, but I thought to ask anyway since it's pretty convenient.
<re_irc> <@h​argonix:m​> adamgreig: should know or should know someone who knows the answer
<re_irc> <@a​damgreig:m​> the policy to follow is
<re_irc> <@a​damgreig:m​> the rust embedded logo contains the rust trademark (with permission), so that's what applies
<re_irc> <@h​egza:m​> I think it might be better to use something else for my purpose here, perhaps a microcontroller or something. In my context it might be interpreted as "an endorsement by the Rust project".
<re_irc> <@j​platte:f​> Just added this room to the (unofficial) Rust Matrix Space: (following xiretza's suggestion)
fabic has joined #rust-embedded
<re_irc> <@a​damgreig:m​> heksa: if it's non-commercial (i.e. at a university) and you just use it to identify that it's rust I think would be fine, as in "Using the Rust trademarks (even in modified form) for social events like meetups, tutorials, and the like is allowed for events that are free to attend. "
<re_irc> <@a​damgreig:m​> (that latter is explicitly permitted)
<re_irc> <@a​damgreig:m​> I guess you might debate whether free to attend applies to university courses :/
<re_irc> <@a​damgreig:m​> jplatte: cool! I guess we should transition the embedded community to a space...
<re_irc> <@h​egza:m​> adamgreig: Yeah! I actually just tried to make it (nationally...) public via FiTech, but the thing got lost in bureaucracy and I can't reach the person responsible. You get used to it at the university though and it's mostly amusing 🥲
<re_irc> <@a​damgreig:m​> hehe, I understand
<re_irc> <@j​platte:f​> adamgreig: Not sure how that would fit into the current space hierarchy where there's a libraries and an applications sub-space and a few rooms like this one that are just in the top-level space, but if you do add another space let me know and I can add it as a sub-space :)
<re_irc> <@a​damgreig:m​> there's a bunch of other embedded rooms
<re_irc> <@a​damgreig:m​> and also the nrf and riscv and other ones I'm not in
<re_irc> <@a​damgreig:m​>
<re_irc> <@j​platte:f​> If you want them in the current hierarchy I can give you rights to manage the existing spaces (you seem to be well-established in the community)
<re_irc> <@j​platte:f​> Or you create a space and I add it as a sub-space
fabic has quit [Ping timeout: 240 seconds]
<re_irc> <@a​damgreig:m​> I've created
<re_irc> <@y​atekii:m​> is a thing too :)
<re_irc> <@j​platte:f​> adamgreig: Added as a sub-space 👍️
<re_irc> <@a​damgreig:m​> thanks!
<re_irc> <@a​damgreig:m​> I guess removed this channel from the top-level too?
<re_irc> <@j​platte:f​> Yeah, just did that now
<re_irc> <@a​damgreig:m​> thanks
<re_irc> <@a​damgreig:m​> added the other rust-community rooms to the new rust-embedded-space
<re_irc> <@a​damgreig:m​> if anyone knows of any other rooms that should be there please shout :)
<re_irc> <@a​damgreig:m​> hm, if I'm in rust-space it folds it into the rust-embedded-space and I only get one sidebar icon?
<re_irc> <@a​damgreig:m​> ah I see, if I expand the sidebar they're nested, fair enough
<re_irc> <@y​atekii:m​> yep :)
<re_irc> <@y​atekii:m​> quite neat the feature :)
<dcz> dkhayes: nice, I want to add better RTC support at some point. Also USB would be nice but I'd need some help, judging by my attempts with another micro
fabic has joined #rust-embedded
richardeoin has quit [*.net *.split]
jasperw has quit [*.net *.split]
richardeoin has joined #rust-embedded
jasperw has joined #rust-embedded
zBeeble has quit [Read error: Connection reset by peer]
zBeeble has joined #rust-embedded
GenTooMan has quit [Ping timeout: 250 seconds]
GenTooMan has joined #rust-embedded
<re_irc> <@n​ewam:m​> Anyone got rust code for a STM32 SPI bus running as a slave?
<re_irc> <@n​ewam:m​> I got the STM32WL end-to-end latency down to 75ms, but majority of that is server-side ECDSA verification which I want to offload to a faster CPU.
<re_irc> <@n​ewam:m​> SPI seems like the fastest bus this thing has.
<re_irc> <@n​ewam:m​> (actual end-to-end latency is like 5ms if you skip signing/encryption)
<re_irc> <@l​uojia65:m​> How to set a feature gate for RISC-V targets to test if the platform supports atomic instructions?
<re_irc> <@n​ewam:m​> There is this if you can use nightly:
<re_irc> <@n​ewam:m​> Otherwise I don't know 😕
<re_irc> <@l​uojia65:m​> Thanks! Nightly is enough for this issue
<re_irc> <@h​argonix:m​> Well only riscv targets with the A extension should have atomics and rust supports:
<re_irc> <@h​argonix:m​> riscv32i-unknown-none-elf
<re_irc> <@h​argonix:m​> riscv32imac-unknown-none-elf
<re_irc> <@h​argonix:m​> riscv32imc-unknown-none-elf
<re_irc> <@l​uojia65:m​> Thanks
<re_irc> <@l​uojia65:m​> I'm writing an UEFI-like bootloader environment in Rust
<re_irc> <@l​uojia65:m​> So I guess it's correct to look into bare metal Rust targets to find out what I need to know
<re_irc> <@a​lmindor:m​> > this one is official Rust Team project though, right :)?
<re_irc> <@a​lmindor:m​> LGTM, I'm afraid i don't have write on that repo tho
<re_irc> <@d​khayes117:m​> almindor: dcz: disasm said he'd look at it later. If he is unable to, I will get it merged.
<re_irc> <@j​orgeig:m​> has anyone used ?
<re_irc> <@j​orgeig:m​> I will try it next week but just wanted to get some impressions if someone has used it
<re_irc> <@d​khayes117:m​> That looks neat.
<re_irc> <@n​ewam:m​> jorgeig: I have not used that specifically, but I did something similar before.
<re_irc> <@n​ewam:m​> it worked well, but I needed to put the githash into the firmware to make the matching of specific firmware to ELF file easier.
<re_irc> <@j​orgeig:m​> thanks!
<re_irc> <@m​athias_koch:m​> jorgeig: I am the author of it, and it is still wip. But any kind of contribution would be more than welcomed! It's on our Todo to incorporate it into our production iot devices soon 😅
<re_irc> <@j​orgeig:m​> awesome! hopefully we can add some PRs to help
fabic has quit [Ping timeout: 240 seconds]
<re_irc> <@a​damgreig:m​> @room meeting time again! agenda is, please add anything you'd like to discuss, we'll start in about 5min
<re_irc> <@a​damgreig:m​> please do add anything you'd like to discuss because I'm not sure of anything to put on the agenda this week 😓 just checked all my rust-embedded emails over the last 7 days but it's not been too noisy
<re_irc> <@h​argonix:m​> Just a little announcement, I'm basically through with the discovery book except that there is a bug in the nrf51-hal regarding Countdown timers I have to fix aaaand that on my micro bit v1 the magnetometer is strongly convinced that the X value of the magnetic field of hte earth is always negative for some...
<re_irc> ... reason but apart from that its all PRed in at the discovery repo \o/
<re_irc> <@e​ldruin:m​> Great work! I'll go through the PRs in the next few days
<re_irc> <@h​argonix:m​> Oh and I convinced some guy at work who hasnt done anything with embedded yet but knows rust to go and try it out so we even got ourselves somewhat of a lab rat i guess xd
<re_irc> <@e​ldruin:m​> hahaha nice
<re_irc> <@e​ldruin:m​> we could discuss how to go about the different versions
<re_irc> <@e​ldruin:m​> since the F3 is back on business but the book is outdated in several regards (cargo-embed, differing magnetometer/accelerometer)
<re_irc> <@a​damgreig:m​> yea, swapping over to the probe-rs tools instead of openocd and gdb would make it a lot easier for new users i bet
<re_irc> <@d​khayes117:m​> Are the micro bit PRs separate chapters, exclusively for the micro bit, or re-written to be sort of universal with the discovery board?
<re_irc> <@a​damgreig:m​> just use rtt instead of all the painstaking gdb operations perhaps
<re_irc> <@a​damgreig:m​> ok, well, let's "start" the meeting :P
<re_irc> <@h​argonix:m​> dkhayes117: they live on a seperate branch and provide code etc. for the micro bit v1 v2...but its largely dependent on embedded HAL really so it should be *tm* easy to switch between
<re_irc> <@a​damgreig:m​> so yea, we're soon to have the new micro:bit version of discovery, at the time we started the idea was to swap completely over to it, replacing the f3disco one, since that seemed to be out of production
<re_irc> <@a​damgreig:m​> now of course it's seemingly back in production... but i think the arguments at the time about microbit being a possibly better introductory board still apply
<re_irc> <@a​damgreig:m​> and it's a bunch cheaper and millions of people already have one
<re_irc> <@e​ldruin:m​> yeah I agree
<re_irc> <@t​herealprof:m​> Same.
<re_irc> <@a​damgreig:m​> (millions? i remember at the time it was advertised that 1 million UK schoolkids would get one, I don't know if that fully happened or what)
<re_irc> <@e​ldruin:m​> how about promoting the microbit rewrite to default and keep the f3 somewhere else?
<re_irc> <@e​ldruin:m​> but also published I mean
<re_irc> <@a​damgreig:m​> yea
<re_irc> <@h​argonix:m​> yeah we could host it at e.g. and the other version at or something
<re_irc> <@h​mvp:m​> adamgreig: Doesn't this also apply for the rp2040 (pico)
<re_irc> <@t​herealprof:m​> Running into the risk of repeating myself: I'm still not too happy with the name discovery for a book not about an STM discovery board. 😉
<re_irc> <@a​damgreig:m​> Hmvp: the pico board doesn't seem ideal since it doesn't come with any onboard peripherals
<re_irc> <@h​argonix:m​> its about discovery of embedded rust! therealprof
<re_irc> <@e​ldruin:m​> therealprof: yeah, valid point, but we get into bikeshedding
<re_irc> <@a​damgreig:m​> yea, we lose the pun of it being both about the discovery board and the discovery process, but I don't think it's the end of the world, plus we'll still have the discovery-board-based version too
<re_irc> <@t​herealprof:m​> Hmvp: Yes, but it not only is way less supported, it also has pretty much no external peripherals on board.
<re_irc> <@t​herealprof:m​> hargonix: Heh, fair!
<re_irc> <@a​damgreig:m​> the additional thing is the talk last week of a risc-v version of the discovery book though
<re_irc> <@a​damgreig:m​> I don't really know how that would best fit in, though, should it be the same target audience but with risc-v or would it be more useful to be an introduction to risc-v and rust rather than to embedded in general?
<re_irc> <@a​damgreig:m​> much higher maintenance too of course
<re_irc> <@e​ldruin:m​> yeah but I think the books are so different that it does not make sense to have some sort of small switch between f3/microbit/riscv versions
<re_irc> <@a​damgreig:m​> having "the discovery book" be the micro:bit one, with a link from the front page to "the old discovery book using the f3 discovery board", means we don't have to keep both fully up-to-date or anything
<re_irc> <@e​ldruin:m​> more like full-on separate builds
<re_irc> <@a​damgreig:m​> yea
<re_irc> <@a​damgreig:m​> right, I don't think it makes sense to have like little tabs on each code snippet or anything, enough things are quite different between the devices
<re_irc> <@t​hejpster:m​> Fyi, I have an invite in my diary from the Raspberry Pi Foundation to talk to them about Rust.
<re_irc> <@e​ldruin:m​> so it would be something like hargonix proposed. publish to /discovery, /discovery-f3 /discovery-riscv or whatever
<re_irc> <@a​damgreig:m​> thejpster: you should let jamesmunns know, he'll be jealous :P
<re_irc> <@a​damgreig:m​> eldruin: should it be /discovery-microbit ?
<re_irc> <@t​hejpster:m​> I think the RP2040 is going to flatten the Arduino Uno and a bunch of other boards. It has performance, availability and price on its side.
<re_irc> <@a​damgreig:m​> and probably instead of -riscv it should be the board name (but idk what board one would pick?)
<re_irc> <@t​hejpster:m​> Oh he knows ;)
<re_irc> <@d​khayes117:m​> So would you expect the RISC-V version to mirror the other discovery versions?
<re_irc> <@t​hejpster:m​> For the price of a Disco you can put a Pico on any number of carrier boards full of fun things.
<re_irc> <@d​khayes117:m​> chapters wise
<re_irc> <@e​ldruin:m​> hmm, we could also publish an index to /discovery with the links to the different versions, then publish the books in /discovery-microbit,...
<re_irc> <@a​damgreig:m​> because it's a separate book I don't think it would have to mirror the others at all
<re_irc> <@a​damgreig:m​> eldruin: if we do this they could stay in one repo too perhaps? /discovery, /discovery/microbit, etc
<re_irc> <@h​argonix:m​> thejpster: Yeah sure you can do that but then beginners have to put circuits together as well and buy lots more components, thats just unnecessarily hard and adds more possibilities for errors.
<re_irc> <@h​argonix:m​> After all the target audience for the discovery book is "has never done embedded before"
<re_irc> <@d​khayes117:m​> I was thinking of targeting the FE310-G002 riscv chip since it is on several dev boards...Hifive1, Lowfive, Red-V (both versions), Dr. Who inventor board...
<re_irc> <@a​damgreig:m​> yea, I could imagine one day in the future there will be some dev board with an rp2040 and some peripherals on it and we write a discovery book using it, perhaps
<re_irc> <@e​ldruin:m​> adamgreig: one repo may be a good idea
<re_irc> <@a​damgreig:m​> dkhayes117: for the other books it's quite focussed on a single dev board with some peripherals on, so the users just get that dev board and follow through, since the objective is to teach embedded from 0
<re_irc> <@a​damgreig:m​> single repo is probably easier for us to manage and deploy and all the rest of it
<re_irc> <@d​khayes117:m​> adamgreig: fair
<re_irc> <@h​mvp:m​> adamgreig: Yeah there are already some quite complete plug and play boards...
<re_irc> <@a​damgreig:m​> dkhayes117: but maybe there's not such an obvious single board to pick, or you want to be slightly wider-ranging in what you cover, I guess the question is whether it's a "discovery" book or a "riscv-embedded-rs" book or what
<re_irc> <@t​hejpster:m​> What prompted the change? Is the F3 Disco EOL or something? The incremental benefit of switching boards otherwise seems small.
<re_irc> <@t​heunkn0wn1:m​> hargonix: perhaps, but at the same time it may be more friendly to beginners; who could potentially mix and match the parts they want to learn about.
<re_irc> <@t​heunkn0wn1:m​> I, for one, found the existing books difficult to work with for, among other reasons, it used hardware I didn't have (I had a nucleo, the books used something more complete) and hardware I didn't have much use for.
<re_irc> <@t​heunkn0wn1:m​> IMHO, having the user build the circuit off a breadboard would be more beneficial, from my beginners point of view
<re_irc> <@a​damgreig:m​> thejpster: it was out of production and not in stock anywhere when the microbit rewrite began, which was before the rp2040 came out
<re_irc> <@l​ulf_:m​> hargonix: Just to add to this point. I think the Discovery book should not necessarily keep up with the latest and greatest of boards, but go for the commonly available ones. Time will tell how popular and commonly available risk-v or pico will be.
<re_irc> <@d​khayes117:m​> I think a lot of the discovery book skills are very much transferable to risc-v, so maybe not a full-on start from zero point
<re_irc> <@t​hejpster:m​> Ah, I see. I'm fine with the Microbit by the way. It's fine.
<re_irc> <@a​damgreig:m​> thejpster: yea, perhaps if we were doing the same thing a year from now an rp2040 board would be the obvious choice, and like you I expect to see it become extremely widespread in hobbyist stuff
<re_irc> <@a​damgreig:m​> but it wasn't on the table at all back then, and even today I don't think the support is fully fledged enough to make sense to write a new book on it? or in any event people wanted to write a book using the micro:bit and have done so, so...
<re_irc> <@t​herealprof:m​> thejpster: And it has BLE built-in which ups the game quite a bit (not that we can really utilize it at the moment...).
<re_irc> <@a​damgreig:m​> micro:bit is also extremely available worldwide, cheap, has a range of fun peripherals onboard, etc
<re_irc> <@d​khayes117:m​> Longan Nano wouldn't be a bad choice for risc-v, super cheap and got a cool LCD attached. Could include embedded graphics :)
<re_irc> <@a​damgreig:m​> even in the face of the rp2040 it seems like a decent choice for an introduction to embedded
<re_irc> <@t​hejpster:m​> No one gets fired for buying BBC.
<re_irc> <@a​damgreig:m​> dkhayes117: ooh, I have one of these :)
<re_irc> <@a​damgreig:m​> embedded graphics, USB, couple of buttons...
<re_irc> <@a​damgreig:m​> anyway
<re_irc> <@t​herealprof:m​> adamgreig: There's also variants like the sino:bit and the other one the name of which I forgot. At some point we could also support those variants. I've heard the sino:bit is really popular in China (not sure whether that's accurate info though).
<re_irc> <@a​damgreig:m​> so for a concrete proposal, basically what eldruin suggested: we keep a single "discovery" repo, put each book into its own subfolder /f3, /microbit, and put an index landing page that introduces the concept and book and has the links?
<re_irc> <@a​damgreig:m​> we might need some thought around maintaining old URLs and the like
<re_irc> <@t​hejpster:m​> Do we target micro bit V2 or V1?
<re_irc> <@h​argonix:m​> therealprof: we have someone here from china, maybe luojia65 knows?
<re_irc> <@h​argonix:m​> thejpster: both
<re_irc> <@t​herealprof:m​> thejpster: Both. 🕺
<re_irc> <@t​hejpster:m​> A toofer. Nice.
<re_irc> <@a​damgreig:m​> and we advertise the micro:bit as the one to look at over the f3, I think?
<re_irc> <@a​damgreig:m​> i.e. "here's the latest version of the book, using a micro:bit, but if you have an f3 discovery, the previous version is available here"
<re_irc> <@a​damgreig:m​> once there's a risc-v book on the scene we can reword that a bit
<re_irc> <@n​ewam:m​> The microbit is also (partially) implemented in QEMU if I recall correctly.
<re_irc> <@e​ldruin:m​> yeah that sounds good to me
<re_irc> <@h​argonix:m​> oh i sort of removed all remarks to the f3 but sure we could get that in
<re_irc> <@t​hejpster:m​> Edition, not Version.
<re_irc> <@a​damgreig:m​> hargonix: oh, I mean this would be on the front page that links to the microbit book, so the microbit book doesn't need to include it
<re_irc> <@t​hejpster:m​> "micro:bit edition - new and updated!"
<re_irc> <@e​ldruin:m​> hargonix: that is fine, we only add info on the different versions in the index page, outside of the books
<re_irc> <@d​khayes117:m​>
<re_irc> <@t​herealprof:m​> dkhayes117: lol, the shape. 😀 Also BBC supported, sweet!
<re_irc> <@a​damgreig:m​> haha is that, like, a micro:bit risc-v?
<re_irc> <@h​argonix:m​> RGB LEDs even, micro:bit cant keep up with that shit
<re_irc> <@a​damgreig:m​> thanks BBC :D
<re_irc> <@d​khayes117:m​> Pricey though, the kit is $75 from adafruit
<re_irc> <@h​mvp:m​> dkhayes117: I'd rather have this then:
<re_irc> <@h​argonix:m​> but the rp2040 is not riscv is it?
<re_irc> <@d​khayes117:m​> Hmvp: That is RP though not riscv
<re_irc> <@n​ewam:m​> Hmvp: Adafruit is unfortunately restrictive for many parts of the world, the shipping can be difficult for non-US folks.
<re_irc> <@d​khayes117:m​> It is BBC thing, its not adafruit exclusive
<re_irc> <@n​ewam:m​> dkhayes117: Yeah, I was replying to the Adafruit MacroPad which as far as I know is an adafruit exclusive.
<re_irc> <@t​herealprof:m​> I find the marketing a little bit too much on the BS side.
<re_irc> <@d​khayes117:m​> Oh, I see
<re_irc> <@d​khayes117:m​> There isn't a ton of RISC-V dev boards to choose from, mostly SiFive or GD32V based
<re_irc> <@t​herealprof:m​> As in, too many weird claims and very light on any details, especially compared to a RP Pico or micro:bit.
<re_irc> <@e​ldruin:m​> I think the microbit and f3 versions are solid choices for now
<re_irc> <@h​argonix:m​> I mean in the end the Rust Embedded eco system is sort of trying to abstract away whether we are dealing with RISCV, Cortex M-X etc. apart from a few details right? So the RISCV specific things to teach for beginners shouldnt be too many if we are doing a good job with that
<re_irc> <@a​damgreig:m​> I'd love to read some kind of "intro to risc-v" and rust on it, but yea, for me it doesn't need to be a "intro to embedded" at the same time
<re_irc> <@a​damgreig:m​> where that ends up living, then, idk
<re_irc> <@a​damgreig:m​> I can see the appeal of having complete introductory material for risc-v too though
GenTooMan has quit [Ping timeout: 250 seconds]
<re_irc> <@t​hejpster:m​> if it's an open ISA, it should be an open PCB too though (and ideally an open SoC, but that's going to take a while, even if I complete this ASIC design course)
<re_irc> <@a​damgreig:m​> so I think in some sense it's up to what you want to write dkhayes117; we can have another discovery book alongside micro:bit if there's some suitable cheap dev board people can use, or it could be more of an addendum; "you've learnt some embedded and rust on the discovery book, here's how things work on...
<re_irc> ... risc-v"
<re_irc> <@d​khayes117:m​> I see the RISC-V part as exntension chapters to the discovery portion
<re_irc> <@a​damgreig:m​> cool
<re_irc> <@a​damgreig:m​> that sounds nice, and I guess it could go as a third book linked from the front page
<re_irc> <@a​damgreig:m​> "discovery: the X chapters"
<re_irc> <@a​damgreig:m​> s/X/V :P
<re_irc> <@e​ldruin:m​> exactly
<re_irc> <@d​khayes117:m​> I'm okay with that, less to maintain too
GenTooMan has joined #rust-embedded
<re_irc> <@d​khayes117:m​> I would do a brief overview with links in a "RISC-V book shelf" for in-depth research (no need to reinvent the wheel) then continue with risc-v specific examples in rust like the privileged specs
<re_irc> <@e​ldruin:m​> yeah, maybe something like: remember that example for the microbit? here is what you need to change for the hifive
<re_irc> <@a​damgreig:m​> cool, thanks everyone! so I think hargonix press on with the last bits, and then when it's all ready we'll reorganise the file structure to serve both from the same repo, with a new front page
<re_irc> <@h​argonix:m​> 👍️
<re_irc> <@a​damgreig:m​> anyone have anything else to discuss for the last few minutes?
<re_irc> <@e​ldruin:m​> 1. 2 times in this chat somebody from a company has come and say, we would like to help, what can we do
<re_irc> <@e​ldruin:m​> there have been a couple things I wanted to bring up here
<re_irc> <@e​ldruin:m​> 2. there was a suggestion for more detailed commercial testimonials in the awesome-e-r repo
<re_irc> <@e​ldruin:m​> but we can discuss these next week
<re_irc> <@e​ldruin:m​> too big topics I guess
<re_irc> <@a​damgreig:m​> yea, makes sense
<re_irc> <@a​damgreig:m​> for the testimonials, thinking of links to people talking about using rust commercially, or actually asking companies to write something up to put on a-e-r?
<re_irc> <@d​khayes117:m​> That is a vaild point (and important)
<re_irc> <@d​khayes117:m​> Ha, that is exactly what you said @eldruin, I just read it lol
<re_irc> <@a​damgreig:m​> cool, let's discuss them further next week
<re_irc> <@a​damgreig:m​> thanks everyone!
<re_irc> <@d​irbaio:m​> I've always found the "I want to help, what can I do" strange
<re_irc> <@d​irbaio:m​> you want to do X? then do it, then if you find Y is missing you contribute it
<re_irc> <@d​irbaio:m​> that's what drives opensource forward :P
<re_irc> <@j​axter184:m​> i feel like thats a question that comes from people who have never contributed to a project before
<re_irc> <@j​axter184:m​> ive definitely had that sentiment in the past, but im not sure if ive ever said it
<re_irc> <@t​herealprof:m​> Guidance is very important. Especially when you have limited or expensive resources you don't want to spend that on fruitless discovery or just implement something noones cares deeply enough (or worse: goes into an undesireable direction) to get it merged before it bitrots...
<re_irc> <@j​axter184:m​> yeah, it seems like if someone asks you that, the best thing to do is give them a small task, or even a useless task that will get them in the groove
GenTooMan has quit [Ping timeout: 250 seconds]
<re_irc> <@j​axter184:m​> the goal being to help guide them to more autonomy in future contributions
<re_irc> <@j​axter184:m​> if that makes any sense
<re_irc> <@t​herealprof:m​> Never hand out useless tasks, that's quite demotivating.
<re_irc> <@j​axter184:m​> well not like "go twiddle your thumbs", and more like "go mess around with this part of the library"
<re_irc> <@j​axter184:m​> immediately useless, but useful in the grand scheme of things
<re_irc> <@n​ewam:m​> The clap repo (command line argument parsing) is good at onboarding new contributors.
<re_irc> <@n​ewam:m​> The downside is that there is quite a bit of work involved in writing up a formal description of the work to be done.
<re_irc> <@j​axter184:m​> maybe im just making an erroneous assumption about the kinds of people that ask for stuff to do?
<re_irc> <@n​ewam:m​> It's the whole "a problem well stated is a problem half solved" thing.
<re_irc> <@n​ewam:m​> Stating the problem well enough to hand it off to a newcomer is 50% of the work :P
<re_irc> <@j​axter184:m​> im just thinking theyre like college CS first years who have the interest and the time and the energy, but not necessarily the expertise or understanding of the ecosystem
GenTooMan has joined #rust-embedded
<re_irc> <@t​herealprof:m​> newam: If you say so. I'm super annoyed that they still haven't managed to release v3. How long has that been after they managed to distract the excellent work on `structopt` by announcing the integration? And still making a lot of fuss about it...
<re_irc> <@n​ewam:m​> therealprof: You can be good at on-boarding newcomers while still being bad at other things 😉
<re_irc> <@d​irbaio:m​> how dare they not release v3 for free and fast
<re_irc> <@t​herealprof:m​> dirbaio: That is *NOT* what I said.
GenTooMan has quit [Ping timeout: 250 seconds]
<re_irc> <@t​herealprof:m​> The best beginner tasks are those easy ones you're stoked about yourself but just couldn't get to due to being too far down the priority list...
GenTooMan has joined #rust-embedded
GenTooMan has quit [Ping timeout: 240 seconds]
dcz has quit [Ping timeout: 250 seconds]
<re_irc> <@d​avidgoodenough:m​> adamgreig: you might want to look at the esp32-c3, risc-v and under 10 dollars.
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
<re_irc> <@d​khayes117:m​> David Goodenough: Hows the support? Last I checked it needed a compiler fork and relied heavily on ESP-IDF stuff.
<re_irc> <@b​obmcwhirter:m​> That was the xtensa variant.
<re_irc> <@a​damgreig:m​> ah yea it's pretty cool seeing all the esp32 risc-v stuff come along for sure
<re_irc> <@a​damgreig:m​> though again for discovery it's really about having a single readily available hardware platform suitable for total newcomers to rust _and_ embedded, that has enough toys onboard to make it interesting
<re_irc> <@t​herealprof:m​> Has anyone checked out
<re_irc> <@t​herealprof:m​> The Chinese is above my paygrade I'm afraid.
<re_irc> <@a​damgreig:m​> it was linked here a day or two ago iirc
<re_irc> <@t​herealprof:m​> Yes it was. But that didn't quite answer my question. 😉
<re_irc> <@a​damgreig:m​>!$eJJQeWE2Snmb4P1Ga30gcC-XzMbNSBA5jclq0N7uWYE?
<re_irc> <@a​damgreig:m​> ah, indeed, I cannot read it either
<re_irc> <@a​damgreig:m​> sounds cool tho >;o
<re_irc> <@d​irbaio:m​> looked biefly through the code, seems like a hybrid async/threaded kernel?
<re_irc> <@d​irbaio:m​> like, each task has a future but also its own stack? with kernelspace/userspace switching and al
<re_irc> <@n​ewam:m​> Machine translation of their intro paragraph:
<re_irc> <@n​ewam:m​> > The operating system kernel has gone through several major development stages, from bare metal applications, batch processing systems to multi-tasking systems, and has evolved into the mainstream threaded operating system so far. This system is based on thread switching to schedule tasks; in order to further...
<re_irc> ... improve performance, some modern programming languages ​​reuse thread resources at the application layer, and propose 协程concepts to save task scheduling overhead.
<re_irc> <@n​ewam:m​> In this project, we propose a new kernel development idea: schedulers are shared by different resources, and coroutines are provided at the operating system level. We hope that this newly designed kernel will not only meet the ease of use of traditional kernels, but also possess the high-performance characteristics...
<re_irc> ... of proprietary kernels, "fast as the wind", hence the name hurricane kernel - tornado-os .
<re_irc> <@d​irbaio:m​> it's not clear whether they do preemptive scheduling.. can't find anything
<re_irc> <@d​irbaio:m​> but if it doesn't preempt then why allocate a stack per task..
<re_irc> <@n​ewam:m​> preemptive scheduling kind of defeats the purpose of `async`, no?
<re_irc> <@d​irbaio:m​> mostly
<re_irc> <@d​irbaio:m​> certainly defeats the advantage of "tasks are light": in cooperative async you don't need a stack per task, because the task saves all its state inside its future
<re_irc> <@d​irbaio:m​> if you do preempt, you do need a stack per task
<re_irc> <@d​irbaio:m​> you may still want preemption if you want one task to have priority over others
<re_irc> <@d​irbaio:m​> for example in embassy you can create multiple executors: a low prio one using wfe/sev and higher-prio ones using software interrupts
<re_irc> <@d​irbaio:m​> so the higher-prio tasks can preempt lower-prio tasks, but within each prio it's all cooperative
<re_irc> <@d​irbaio:m​> and since it's "strictly nested" preemption you can still use a single stack for all prios
<re_irc> <@d​irbaio:m​> but yea
<re_irc> <@d​irbaio:m​> hard to tell what the execution model of tornado-os is without english docs 🤣
<re_irc> <@d​khayes117:m​> Im almost convinced that dirbaio is actually a brain in a jar in some scientist's lab pushing the boundaries of biological possibilities.
<re_irc> <@d​irbaio:m​> what 😂
<re_irc> <@n​ewam:m​> Every-time someone uninstalls IEs he gets faster.
<re_irc> <@d​khayes117:m​> You always have 3 conversations going at once
tokomak has quit [Read error: Connection reset by peer]
GenTooMan has joined #rust-embedded
<re_irc> <@j​axter184:m​> does anyone have any experience with ethernet on the stm32?
<re_irc> <@j​axter184:m​> i just flashed the stm_ethernet example, and it looks like it worked, but idk what to do now
<re_irc> <@j​axter184:m​> the stm32-eth crate also seems to be like something i should be looking into
<re_irc> <@j​axter184:m​> like how should i be testing to make sure that it works?
<re_irc> <@j​axter184:m​> i can see the device in nmap, but pinging the ip works regardless of whats flashed on the chip
<re_irc> <@j​axter184:m​> like i flashed a blinky at one point and still got ping responses, which seems like it shouldnt work
<re_irc> <@a​damgreig:m​> yea, sounds like you're pinging the wrong IP in that case
<re_irc> <@a​damgreig:m​> (or two devices have the same IP and the other one is responding, something like that)
<re_irc> <@n​ewam:m​> ICMP (ping) can be weird, when starting low-level Ethernet things I usually try sending out junk to the UDP broadcast address, easy to capture with wireshark.
<re_irc> <@a​damgreig:m​> the other thing to test is implement some network functionality on your firmware, like a UDP server that just responds with whatever you sent it, and then you can try that out (e.g. using netcat on linux: `nc -u <ip address> <port>` to open a console, any line you type is sent to that IP/port in a UDP packet,...
<re_irc> ... any packets received are printed)
<re_irc> <@a​damgreig:m​> yea, that's good too, easier to get right at first
<re_irc> <@a​damgreig:m​> but if you're pinging the IP and it's responding even with blinky firmware (or, presumably, with no firmware at all?) then something's wrong
<re_irc> <@a​damgreig:m​> which stm32? what board is it on?
<re_irc> <@j​axter184:m​> stm32f429 nucleo
<re_irc> <@j​axter184:m​> i think f429ZI?
<re_irc> <@a​damgreig:m​> cool
<re_irc> <@j​axter184:m​> im seeing the ip disappear and reappear when i unplug and reconnect the ethernet
<re_irc> <@j​axter184:m​> the broadcast address is, right? or am i thinking about something else?
<re_irc> <@a​damgreig:m​> should work fine with stm32-eth then, which `stm_ethernet` example are you using?
<re_irc> <@j​axter184:m​> uhhh i just picked a random one lol
<re_irc> <@j​axter184:m​> just to see if it would flash
<re_irc> <@a​damgreig:m​> right, what one?
<re_irc> <@j​axter184:m​> mesygen
<re_irc> <@a​damgreig:m​> the ip disasppearing and reappearing when you unplug and reconnect the ethernet is possibly the local IP of your own computer
<re_irc> <@n​ewam:m​> is broadcast; it's handy because you can use it without an IP
<re_irc> <@a​damgreig:m​> (though is also a broadcast for that subnet if you're on that subnet)
<re_irc> <@a​damgreig:m​> but maybe you need to give your computer a static IP on the wired interface you're plugging in to, and hardcode another static IP in the same subnet to the stm32 firmware
<re_irc> <@a​damgreig:m​> unless you know otherwise, your computer is probably not running a DHCP server that can give out IP addresses, and the STM32 firmware is probably not asking for a DHCP-assigned IP address
<re_irc> <@j​axter184:m​> ah i see, that makes sense
<re_irc> <@j​axter184:m​> it did seem a little fishy
<re_irc> <@j​axter184:m​> ill try the broadcast stuff really quick
<re_irc> <@a​damgreig:m​> but it's hard to say for sure without knowing which example you're using exactly.. you might try the stm32-eth example, it should work on the f429 nucleo board
<re_irc> <@r​yan-summers:m​> Yeah, you need to start your own DHCP server to auto-assign addresses if you're running some of the stm32 ethernet examples via a USB-ethernet dongle. I use that setup daily for a project
<re_irc> <@r​yan-summers:m​> Like adam said, assign static IPs at first to make sure things are working right
<re_irc> <@r​yan-summers:m​> Once you have that working, you can try out using smoltcp's DHCP server to auto-assign things - I use it extensively and it appears to work quite well, but you should definitely get your network stack debugged before jumping into it
<re_irc> <@d​irbaio:m​> Smoltcp dhcp server?
<re_irc> <@r​yan-summers:m​> Sorry, DHCP client*
<re_irc> <@d​irbaio:m​> I was like "👀 I want that 👀"
<re_irc> <@d​irbaio:m​> 🤣
<re_irc> <@n​ewam:m​> What's the usecase for an embedded DHCP server? 👀
<re_irc> <@d​irbaio:m​> +5 coolness points
<re_irc> <@n​ewam:m​> Accurate.
<re_irc> <@d​irbaio:m​> Jk, you could do fun stuff like having devices talk to each other without a router
<re_irc> <@d​irbaio:m​> But I guess there's easier ways to do that
<re_irc> <@r​yan-summers:m​> Or you know, making a router
<re_irc> <@d​irbaio:m​> Heh thatd require multi-interface and routing in smoltcp
<re_irc> <@n​ewam:m​> Router SoCs are pretty hard to beat for cost/power anyway :P
<re_irc> <@r​yan-summers:m​> Just pointing out the (probably biggest) use case for an embedded DHCP server ;)
<re_irc> <@r​yan-summers:m​> But a router SoC wouldn't be managed, would it?
<re_irc> <@r​yan-summers:m​> I guess that's a massive "it depends"