<ian_rees[m]>
I'm trying to track down a really strange bug on SAMD51 (Cortex M4): with a minimal firmware that just sets up a 100MHz CPU clock (hardware defaults to 48MHz) and does loop { cortex_m::asm::delay(100_000_000); defmt::debug!("Tick"); }, the speed of the log output sometimes runs 3-48 slower depending on enabling what I'd think are completely unrelated Cargo features. The only thing I think the features should change in this
<ian_rees[m]>
firmware is the presence of some global statics. Any ideas on what to look for?
<ian_rees[m]>
s//`/, s/,/`,/, s/48/4x/
ivche has quit [Ping timeout: 248 seconds]
ivche_ is now known as ivche
<ian_rees[m]>
So far, I've ruled out a difference in the clock tree, it actually does generate a 100MHz clock in either condition. Though it's interesting that in the slow condition the clock does seem a bit unstable in frequency - see https://github.com/atsamd-rs/atsamd/issues/819#issuecomment-2774752035 for some spectra of the normal/slow clocks
andrewmorrow[m] has quit [Quit: Idle timeout reached: 172800s]
ivmarkov[m] has joined #rust-embedded
<ivmarkov[m]>
I'm trying to shrink the `.rodata` section as much as possible (by using `defmt`). I've wrapped all (most?) of my `panic!`s and `.unwraps` using their `defmt` equivalents. Yet what I'm observing is that `.rodata` still contains tons of file locations. It is as almost as if `defmt::panic!` calls `core::panic!` which would then capture this info (in the absence of `panic_immediate_abort`).
<ivmarkov[m]>
The question is, am I missing something, or is it really that `defmt::panic!` (and friends) do call into `core::panic!`, and why would that be?
<ivmarkov[m]>
Given that `defmt::panic!` and so on are printing an error message with `defmt::error!`, can't these just generate some sort of trap, rather than calling `core::panic!`
therealprof[m] has quit [Quit: Idle timeout reached: 172800s]
Rahix has joined #rust-embedded
JomerDev[m] has quit [Quit: Idle timeout reached: 172800s]
jistr has quit [Remote host closed the connection]
jistr has joined #rust-embedded
<ivmarkov[m]>
<ivmarkov[m]> "I'm trying to shrink the `...." <- To answer my own question: no `defmt` works _just fine_ w.r.t. calling `core::panic!` as it does it by **not**-inlining the call to `core::panic!` and hiding it behind a global function. I replaced that function with another (with `avoid-default-panic`) which just does `loop {}` and the path strings are still there, in `.rodata`. Most likely (checking this ATM) these path strings
<ivmarkov[m]>
in `.rodata` come from array bounds' checks and overflow checks, which there is no way for `defmt` to currently intercept and fix.
<ivmarkov[m]>
If that turns out to be true, bloat due to bounds-checking and overflow-checking can only be removed with p-i-a, I guess :(.
<ivmarkov[m]>
* and overflow-checking (update: overflow checking can, * can be disabled with overflow-checks = false) can only be
M9names[m] has quit [Quit: Idle timeout reached: 172800s]
sourcebox[m] has quit [Quit: Idle timeout reached: 172800s]
RobertJrdens[m] has quit [Quit: Idle timeout reached: 172800s]
pcs38 has quit [Ping timeout: 276 seconds]
pcs38_ has joined #rust-embedded
korbin[m] has quit [Quit: Idle timeout reached: 172800s]
exark_ has quit [Quit: quit]
exark has joined #rust-embedded
ciakval[m] has quit [Quit: Idle timeout reached: 172800s]
rainingmessages2 has joined #rust-embedded
rainingmessages has quit [Ping timeout: 276 seconds]
rainingmessages2 is now known as rainingmessages
pcs38_ has quit [Ping timeout: 252 seconds]
pcs38 has joined #rust-embedded
Noah[m] has quit [Quit: Idle timeout reached: 172800s]
<phcoder_cat[m]>
Hello, all. I try to experiment with Rust in GRUB. I have 2 problems right now. First one is that -Zregparm=3 doesn't change call convention used by memcpy calls from Rust. Second one is that some platforms use stdcall and other ones use cdecl calling convention. So I wanted to be able to do something like unsafe extern grubcall!() .... rather than declaring every function twice. But when I try to do with the macro I get an
<phcoder_cat[m]>
error: "expected `fn`"
cinemaSundays has quit [Quit: Connection closed for inactivity]
GuineaWheek[m] has joined #rust-embedded
<GuineaWheek[m]>
has anyone successfully gotten dcache on an stm32h7 to work with the ethernet peripheral
<GuineaWheek[m]>
every time i try to use the mpu to not cache sram3 i just get unaligned access hard faults
adamgreig[m] has joined #rust-embedded
<adamgreig[m]>
Huh, weird to get unaligned access issues. I've definitely had h7 with dcache and mpu disabling caching on sram3 for ethernet dma buffers working before
<JamesMunns[m]>
balbi[m]: Yeah I've been enjoying it!
<dngrs[m]>
<phcoder_cat[m]> "Hello, all. I try to experiment..." <- your error is cut off at "expected `fn`", there should be a somewhat more verbose output, can you paste it in full? also potentially the piece of code triggering the error? (I probably won't be able to help you, but more context is useful to have)
Amit[m] has quit [Quit: Idle timeout reached: 172800s]
<balbi[m]>
<JamesMunns[m]> "https://github.com/jamesmunns/..." <- I should make full switch at some point. After 20+ years on LaTeX it's a little harder.
bartmassey[m] has quit [Quit: Idle timeout reached: 172800s]
<JamesMunns[m]>
balbi[m]: I never learned latex, which made the switch easier for me :D
Mathias[m] has quit [Quit: Idle timeout reached: 172800s]
pcs38 has quit [Quit: leaving]
<GuineaWheek[m]>
<adamgreig[m]> "Huh, weird to get unaligned..." <- yeah so it seems that whenever the sram3 gets handed to smoltcp as a &[u8] smoltcp does an unaligned access and this causes a fault
<GuineaWheek[m]>
whats more mysterious is why configuring the mpu causes unaligned accesses to fail to begin with
<adamgreig[m]>
yea I think there's something misleading going on there. how do you know it's an unaligned access?
whitequark[cis] has quit [Quit: Idle timeout reached: 172800s]