<re_irc>
I've been looking at `cortex-m-rt` and `riscv-rt` and I don't get why you use the `Vector` union thing instead of an `Option<extern "C" fn()>`, which seems more rustacean, when dealing with exceptions and interrupts. Could anyone illuminate me?
<re_irc>
<@datdenkikniet:matrix.org> I think it's because you need it for control of the size
<re_irc>
<@datdenkikniet:matrix.org> and "Option<extern "C" fn()>" probably has a size that is not "core::mem::size_of::<usize>()"
<re_irc>
<@datdenkikniet:matrix.org> while the union does
<re_irc>
<@datdenkikniet:matrix.org> "Option<extern "C" fn()>" probably has a size that is not "core::mem::size_of::<usize>()"
<re_irc>
<@romancardenas:matrix.org> Hmmm I see... I guess that there is no niche optimization with function pointers not being null?
<Shell>
the niche optimisation is guaranteed for Option<extern "C" fn()> in fact.
dreamcat4 has quit [Quit: Connection closed for inactivity]
<re_irc>
<@jamesmunns:beeper.com> I'm guessing no meeting this week? I think folks were still busy, just confirming. If y'all are busy next week too, I can run that meeting.
<re_irc>
<@therealprof:matrix.org> I could have run as well, but I was somehow expecting Adam to be back so I didn't prepare. 😕
<re_irc>
<@jamesmunns:beeper.com> (if you two DIDNT get that email, from jan-erik, please dm me and I will forward)
<re_irc>
<@therealprof:matrix.org> I did get it. So did , who brought it here a while ago.
<re_irc>
<@jamesmunns:beeper.com> There was another email on Apr 23rd, but the same distro list, so we all probably got it too (questionable whether I should have, but yeah)
<re_irc>
<@therealprof:matrix.org> Well, he pinged the whole WG.
<re_irc>
<@thejpster:matrix.org> He pinged a magic email which goes to … some people via the magic of GitHub?
<re_irc>
<@thejpster:matrix.org> I can’t remember how we set that up.
<re_irc>
<@thejpster:matrix.org> I am consider nominating myself but some colleagues wish to talk me out of it.
<re_irc>
<@therealprof:matrix.org> It would be great to have a voice in the leadership council which has previously been rather tough since WGs haven't been deemed an important part of the Rust community.
<re_irc>
<@therealprof:matrix.org> I know I won't have time so I'm not going to pretend I would.
<re_irc>
<@therealprof:matrix.org> : I would definitely support that.
<re_irc>
<@dirbaio:matrix.org> what mailing list is that? I didn't receive anything
<re_irc>
<@therealprof:matrix.org> Hm, I thought this was going via the teams definition.
<re_irc>
<@therealprof:matrix.org> Sorry about that, will rectify immediately.
<re_irc>
<@eldruin:matrix.org> I did not get an email about it either though
<re_irc>
<@therealprof:matrix.org> [WARN rust_team] the person is missing the email on GitHub, leaving the field empty
<re_irc>
[INFO rust_team] written data to people/Dirbaio.toml
<re_irc>
<@dirbaio:matrix.org> oh! I hid it because I had people email me about OSS issues etc :(
<re_irc>
<@dirbaio:matrix.org> it's "dirbaio@dirbaio.net". is it manually settable? or should I make it public?
<re_irc>
<@therealprof:matrix.org> I can add it, no problem.
<re_irc>
<@therealprof:matrix.org> Currently checking who else is missing.
<re_irc>
<@therealprof:matrix.org> : Your email is also not present.
<re_irc>
<@eldruin:matrix.org> hmm, I have it in my github profile though
<re_irc>
<@eldruin:matrix.org> anyway it is my nickname @gmail.com
<re_irc>
<@therealprof:matrix.org> : Maybe not at the time of creation.
<re_irc>
<@jamesmunns:beeper.com> Would throw my name in if we can't find anyone else, but very supportive of anyone on the WG and who isn't/hasn't been on the core team :D
<re_irc>
<@eldruin:matrix.org> I would not have time for it at the moment
<re_irc>
<@dirbaio:matrix.org> same :(
<re_irc>
<@thejpster:matrix.org> JT suggested you’d need five hours per week.
<re_irc>
<@therealprof:matrix.org> : Yeah, and others have disputed that... 😛
<re_irc>
<@thejpster:matrix.org> Which is about what I did as Mayor of St Ives. I mean, that’s a lot for a free thing you do outside of work.
<re_irc>
<@jamesmunns:beeper.com> I can forward the email chain on to anyone is being added to the mailing list now (dm me please), the tl;dr is "the embedded WG is being added to a catch-all group for misfit WGs, but we should nominate a representative to represent us in the in-progress leadership council"
<re_irc>
<@jamesmunns:beeper.com> The email thread is basically that explainer, plus the link to the issue I mentioned, plus 'reminder you still need to nominate someone'
<re_irc>
<@eldruin:matrix.org> we are a misfit WG 😢
<re_irc>
<@thejpster:matrix.org> I understand any WG can nominate any number of candidates and Jan Erik will run a process to find one through consensus.
<re_irc>
<@thejpster:matrix.org> You can also self nominate. But I think it’s better if there’s a discussion here first.
<re_irc>
<@jamesmunns:beeper.com> I mean, misfit in the sense that WGs aren't really a thing anymore, but we predate and are larger and more functional than many rust teams
<re_irc>
<@thejpster:matrix.org> Because consensus. If you can’t beat the other candidate from here, you won’t make it all the way to the council.
<re_irc>
<@jamesmunns:beeper.com> The concept of WGs has really just fallen out of fashion, save for us and very few others.
<re_irc>
<@jamesmunns:beeper.com> Teams in our "misfit" cohort:
<re_irc>
Initial Launching Pad Subteams
<re_irc>
- community (and its subteams)
<re_irc>
- wg-async
<re_irc>
- twir
<re_irc>
- wg-cli
<re_irc>
- wg-embedded (and subgroups)
<re_irc>
- wg-gamedev
<re_irc>
- wg-rust-by-example
<re_irc>
- wg-secure-code
<re_irc>
- wg-security-response
<re_irc>
- wg-wasm
<re_irc>
<@eldruin:matrix.org> no worries, I was just joking
<re_irc>
<@thejpster:matrix.org> The technical name is the Launchpad WG. I hope our new rep pushes for us to get full WG status.
<re_irc>
<@thejpster:matrix.org> Yeah, what James said. I’m on my phone so typing slowly.
<re_irc>
<@jamesmunns:beeper.com> Good to explain for folks that don't catch my (hard to convey through text) tongue in cheek joking :)
<re_irc>
<@eldruin:matrix.org> so is it now all "teams"?
<re_irc>
<@jamesmunns:beeper.com> I do appreciate they thought of us for representation despite being an "odd" case!
<re_irc>
<@jamesmunns:beeper.com> : Whatcha mean?
<re_irc>
<@eldruin:matrix.org> are they changing the organization so that there are no WGs anymore but are calling it something else?
<re_irc>
<@eldruin:matrix.org> +(because of poor fitting)
<re_irc>
<@jamesmunns:beeper.com> There haven't been any "official" WGs in like the last 3-4 years
<re_irc>
<@jamesmunns:beeper.com> Even before then, _most_ WGs were "work on a thing until it's done then wrap up
<re_irc>
<@jamesmunns:beeper.com> * up"
<re_irc>
<@eldruin:matrix.org> I see
<re_irc>
<@thejpster:matrix.org> > The Leadership Council is composed of representatives from all top-level teams. There are currently a few existing teams and working groups that do not fit into the new organization structure. The RFC establishes a new top level team called "launching pad" to account for those existing teams and working groups and provide them with a representative on the Leadership Council. The long term goal for teams under the...
<re_irc>
... launching pad umbrella is to move those teams and working groups under a more appropriate team in the future.
<re_irc>
<@thejpster:matrix.org> So a new Team (capital T) is being created so people who are in a WG (which is not a Team) still get a voice on the new Leadership Council
<re_irc>
<@jamesmunns:beeper.com> But yeah, we persist, and as mentioned, are of a larger scale and greater functionality/autonomy than many project teams, but don't fit in the "working directly on the compiler" template.
<re_irc>
<@jamesmunns:beeper.com> So our first rep will likely need to help carve out a space for us as a seat at the table with the "works on the compiler" folks :)
<re_irc>
<@thejpster:matrix.org> Along with CLI add all the other Not A Teams.
<re_irc>
<@thejpster:matrix.org> * and
<re_irc>
<@jamesmunns:beeper.com> : (gonna repeat tho, many of those WGs are largely inactive, or are like 2-3 people nowadays)
<re_irc>
<@shakencodes:matrix.org> Can someone share their preferences on crates for calculating CRCs in an embedded system? Does this change when working with a µProc with a CRC unit? (In my case an STM32WL55.) P.S. If working with a hardware CRC unit, what crate is used on the host side?
<re_irc>
<@dirbaio:matrix.org> "crc" works fine and supports nostd
<re_irc>
<@dirbaio:matrix.org> it's a bit overengineered, I've sometimes opted for impementing it manually for simplicity
<re_irc>
<@dirbaio:matrix.org> > Does this change when working with a µProc with a CRC unit?
<re_irc>
in that case you'd use the CRC driver from the HAL (or the PAC if no such driver), so it delegates to the hardware
<re_irc>
<@dirbaio:matrix.org> > If working with a hardware CRC unit, what crate is used on the host side?
<re_irc>
"crc" (or any other crate) should work, as long as you configure it to use the same polynomial and bit order and byte order and polarity etc, which is often endless fun
<re_irc>
<@dirbaio:matrix.org> it's a bit overengineered, I've sometimes opted for impementing it manually for simplicity
<re_irc>
EDIT: and it uses big lookup tables, which is not great for flash usage
<re_irc>
<@dirbaio:matrix.org> it's a bit overengineered, I've sometimes opted for impementing it manually for simplicity
<re_irc>
<@thejpster:matrix.org> I find pycrc quite good for experimenting
<re_irc>
EDIT: and it uses big lookup tables, which is not great for flash usage if you're short
<re_irc>
<@jamesmunns:beeper.com> +1 to the CRC crate, recently added support for that in postcard. Definitely verify your host with "software CRC" works the same as your MCU hardware accelerated CRC (and whether the peripheral is actually faster than also going it in software)
<re_irc>
<@dirbaio:matrix.org> you can make software go pretty fast with big lookup tables. hardware usually wins in speed at a given fixed flash size.
<re_irc>
<@shakencodes:matrix.org> Is the postcard CRC support pushed? I had missed that when I last looked (and the big part of this is using postcard.)
<re_irc>
<@thejpster:matrix.org> Hardware is nice if it can calculate whilst you’re asleep and the data is coming in via SPI and DMA?
jcroisant has joined #rust-embedded
<re_irc>
<@jamesmunns:beeper.com> : It's merged to main, but not released. Could do sooner than later if you need :)
<re_irc>
<@jamesmunns:beeper.com> Very recent tho (thanks to !)
<re_irc>
<@shakencodes:matrix.org> : That is awesome. I will start using it today, if its ready!
<re_irc>
<@jamesmunns:beeper.com> : Lemme know if it isn't :D
<re_irc>
<@huntc:matrix.org> Just to add re the crc crate, you can optimise it’s use of tables when you declare an instance.
lehmrob has joined #rust-embedded
lehmrob has quit [Ping timeout: 265 seconds]
<re_irc>
<@shakencodes:matrix.org> Is there an example of using the COBS and CRC flavors together in Postcard serialization or deserialization? (I tried mixing what I saw with the two flavors example using COBS and Slice, but had no luck.)
<re_irc>
<@huntc:matrix.org> : I guess you can compose them although be sure to have cobs compose crc ie cobs is the composer. There are no helper functions for this though.
<re_irc>
It’s an odd combo. COBs shouldn’t require a CRC, right?
<re_irc>
<@shakencodes:matrix.org> For me, COBS' main function is giving you a consistent end of packet character (the 0x00), simplifying framing. It generates a nearly consistent packet size (+1/-0), which is good for consistent processor load. I wasn't aware of any property that provides data integrity, unless one of the zero-displacement bytes is corrupt and blows your packet size.
<re_irc>
Am I missing something?
<re_irc>
<@shakencodes:matrix.org> (Or is it always +2 bytes? I've forgotten.)
IlPalazzo-ojiisa has quit [Quit: Leaving.]
<re_irc>
<@firefrommoonlight:matrix.org> : I just follow the protocol guide
<re_irc>
<@firefrommoonlight:matrix.org> Its sometimes a const fn to populate a LUT, then a normal fn to calc the CRC
<re_irc>
<@firefrommoonlight:matrix.org> Will put it in a shared lib as required eg if I have multiple devices that use a given protocol, or am communicating between Rust firmware and Rust PC program eg with USB
<re_irc>
<@firefrommoonlight:matrix.org> To keep the DRY issues down