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
<thalesfragoso[m]> <adamgreig[m]> "Huh, weird to get unaligned..." <- Didn't we explicit ask people to place it somewhere specific?
<adamgreig[m]> not sure where you mean exactly but sram3 is generally the preferred location for ethernet dma buffers in h7
<adamgreig[m]> but you need to mark sram3 as non-cacheable in the mpu
<thalesfragoso[m]> Hmm, found the issue:
<thalesfragoso[m]> Basically yeah, somewhere non-cacheable, but there we suggest SRAM2, which iirc is non-cacheable by default.
<adamgreig[m]> on h7 sram3 is better I think, and stm32-eth doesn't support h7 so won't be what's used here
<adamgreig[m]> but yea, same deal exactly
<adamgreig[m]> unaligned access faults don't make sense though, smoltcp does byte access which can't be aligned
<adamgreig[m]> so I guess the error is being interpreted wrong and it's probably some other access fault due to mpu settings
<adamgreig[m]> (the ref man for h7 specifically suggests sram3 for ethernet and usb buffers, and those peripherals can directly master the bus to sram3)
<thalesfragoso[m]> Indeed, just remembered that we didn't support h7 there, and instead the HAL did.
<adamgreig[m]> yea, different peripheral, st finally paid synopsys for a new licence i guess
<thalesfragoso[m]> Still synopsys though, heh. I wonder if they finally added a DMB to their HAL driver.
ivche_ has joined #rust-embedded
ivche has quit [Ping timeout: 276 seconds]
ivche_ is now known as ivche
<thalesfragoso[m]> If I have two nested ldrex and strex to the same address, does the inner one succeed?
pcs38 has joined #rust-embedded
<thejpster[m]> <ian_rees[m]> "I'm trying to track down a..." <- is it the clock speed that’s changing or the number of instructions per loop in asm::delay? IIRC it’s fairly crude. Certainly in debug mode it’ll be calling a nop function instead of inlining it. I wonder if we shouldn’t just write it in assembly.
<RobinMueller[m]> Does anyone here know how to retrieve RTT content from a SEGGER JLink GDB server? It mentions that I can use telnet port 19021, but I don´t get any output when trying `nc localhost 19021` or `telnet... (full message at <https://catircservices.org/_irc/v1/media/download/AcHnAtOM3eNoBA68H9rkh4SZDwCg2WKRU4DhH5dj6rdMNgN8htrr9Leoeh4G7BG9kuVBFWNvoaOQn7NLk1IvQ4q_8AAAAAAAAGNhdGlyY3NlcnZpY2VzLm9yZy90RFJodmZjaVdnY01YZHNmZE5FZWFpZEk>)
<RobinMueller[m]> i have to connect once with the JLinkRTTViewer, and then it works when I connect with other tools
M9names[m] has joined #rust-embedded
<M9names[m]> the socket interface will accept configuration settings if you pipe them into it in the first few milliseconds.
<M9names[m]> i wrote a client that does this, maybe this will work for you? you might have to adjust the channel number if you're using a different up-channel.
<RobinMueller[m]> ahh maybe it has to do something with not having specified the RTT ctrl block base address? Your solution might work for me and I can probably easily extend it to print defmt frames as well.
<RobinMueller[m]> hmm, a SEGGER tools update seems to solve this as well
<JamesMunns[m]> oooh, rad hardened stuff?
<RobinMueller[m]> hmm.. I guess the only cavaet is that the full path to the binary has to be specified. integrated tools like probe-rs really are nice, but the debugging is still problematic unfortunately, so I still need to use JLink GDB Server + GDB mulitarch for debugging
<RobinMueller[m]> but defmt works now, amazing
<RobinMueller[m]> yeah. it is also too expensive. they don't even have a cheap development version 😅
<JamesMunns[m]> Very cool :D
<RobinMueller[m]> i am looking forward too developing firmware for these things with probe-rs / defmt etc. It was tons of work to add Rust support for those 😅 but it is so much better than the C libs / ecosystem provided by the vendor
<RobinMueller[m]> s/firmware/OBSW/
<JamesMunns[m]> I totally get how you get the name in German, but it is somewhat funny to me that y'all ended up with "US-IRS" :D
diondokter[m] has quit [Quit: Idle timeout reached: 172800s]
Kaspar[m] has quit [Quit: Idle timeout reached: 172800s]
mkj[m] has quit [Quit: Idle timeout reached: 172800s]
<phcoder_cat[m]> <dngrs[m]> "your error is cut off at "..." <- Here is the piece of code and the full error: https://pastebin.com/vZwHdfgn
<ian_rees[m]> thejpster: As far as I can tell, the clock is running the same* speed, and the compilation of `delay()` is the same, yet the firmware definitely goes a lot slower. This strange behaviour was noticed in the context of a rework of the ATSAMD HAL clocking, so initially I suspected that the clock tree was being misconfigured but AFAICT it's all fine and I can't imagine a mechanism that would make eg the `usb` feature affect the clock
<ian_rees[m]> tree setup. * One odd symptom I can't explain is that the clock is a bit unstable/jittery when the micro is running in the slow condition
<ian_rees[m]> * thejpster: As far as I can tell, the clock is running the same\* speed, and the compilation of `delay()` is the same, yet the debug output definitely goes a lot slower. This strange behaviour was noticed in the context of a rework of the ATSAMD HAL clocking, so initially I suspected that the clock tree was being misconfigured but AFAICT it's all fine and I can't imagine a mechanism that would make eg the `usb` feature affect the
<ian_rees[m]> clock tree setup. \* One odd symptom I can't explain is that the clock is a bit unstable/jittery when the micro is running in the slow condition
<ian_rees[m]> It's really puzzling, my leading theory is that there's some miscompilation/uninitialized variable that somehow puts the chip in to a bad state but it's very handwavy
<ian_rees[m]> The clock setup has a 48MHz open-loop PLL (the default that the chip starts up with), divided down to 2MHz, then multiplied by 50x to be 100MHz. The slowdown depending on enabled features is like 3.3x or 4.7x, and the set of enabled features that changes it between slow and fast conditions changes depending on what seem like inconsequential changes to the rest of the program. Maybe something relating to how the firmware
<ian_rees[m]> initializes RAM?
<ian_rees[m]> * or 4.7x (has varied when I've measured it,, * , not obviously related to the PLL ratios), and the
Foxyloxy has quit [Quit: Textual IRC Client: www.textualapp.com]
Foxyloxy has joined #rust-embedded
<thejpster[m]> Try turning interrupts off.
<ian_rees[m]> no change, using cortex_m::interrupt::disable(); as the first line in main()
<ian_rees[m]> another thing I've noticed is that the jittery clock symptom goes away when I break execution in a debugger, returns when the target resumes execution
<ian_rees[m]> It's past bedtime here so GTG, but I'm thinking to try producing "fast" and "slow" firmwares that differ in some smaller way than enabling HAL features - I'm pretty sure that all that is changing is the RAM initialization but could be something else there. Also we've only investigated on one board so will see if I have a different one that uses the same micro
Ralph[m] has quit [Quit: Idle timeout reached: 172800s]
sroemer has quit [Ping timeout: 248 seconds]
Socke has quit [Ping timeout: 245 seconds]
kaoD has quit [Quit: Ping timeout (120 seconds)]
kaoD has joined #rust-embedded
Socke has joined #rust-embedded
kaoD has quit [Quit: Ping timeout (120 seconds)]
kaoD has joined #rust-embedded
pcs38 has quit [Quit: leaving]
GrantM11235[m] has joined #rust-embedded
<GrantM11235[m]> <thejpster[m]> "is it the clock speed that’s..." <- btw, `asm::delay` is already written in assembly
joelsa[m] has quit [Quit: Idle timeout reached: 172800s]
ckrenslehner[m] has quit [Quit: Idle timeout reached: 172800s]
<thejpster[m]> Oh cool. I’m old enough to remember when we needed feature gates on nightly to use inline assembly.
<thejpster[m]> The socket is open regardless of which segger tool you use. At embedded world I was using defmt-print whilst debugging in Ozone (which is great, btw)
pcs38 has joined #rust-embedded
kaoD has quit [Quit: Ping timeout (120 seconds)]
kaoD has joined #rust-embedded
ana_briated has joined #rust-embedded
pcs38 has quit [Quit: leaving]