<windsurf_>
I've got a blocker that I can't figure out and AI has been no help. Any genius out there wanna take a stab at it?
<windsurf_>
I'm using an nrf52840 and nrf-softdevice. I've modified my memory.x with the appropriate offsets for my firmware since the softdevice wants to be at 0x0 for flash and ram. Without the offsets my firmware overwrites the softdevice but I can connect via j-link cable to RTT to get logging. With the memory offsets in place, I can't connect to RTT, it times out
windsurf_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rmsyn[m] has quit [Quit: Idle timeout reached: 172800s]
<thejpster[m]>
<balbi[m]> "trying to understand what you..." <- Previous the code said "if shift { keycode } else if alt { keycode } else { keycode }" and now it says "if alt { keycode } else if shift { keycode } else { keycode }". The difference comes when alt and shift are both pressed.
<thejpster[m]>
For some keys, Alt + Shift does a unique thing (like where Alt + Shift + E should give you É rather than é) but when Alt + E gives you €, what should Alt + Shift + E give you? E or €?
<thejpster[m]>
I say Alt, I mean AltGr, also known as Right Alt. It acts differently to Alt (or Left Alt).
<thejpster[m]>
I'm cursed/blessed with only having 105 key UK English keyboards, so I can't test any of this - I can only look at pictures online. If anyone wants to post me a PS/2 Norwegian, Swedish, Finnish, Japanese, German or French keyboard - DM me.
<thejpster[m]>
is it possible to get probe-rs to write the raw defmt data received over RTT to a file?
<diondokter[m]>
thejpster[m]: Not sure! But I feel like that's one of those options that `cargo embed` would support
<JamesMunns[m]>
rtt-host uses probe-rs as a lib and prints to stdout which you could pipe to a file
<JamesMunns[m]>
dunno if you can make "plain" probe-rs-cli do it tho
<diondokter[m]>
It can at least stream to a TCP socket
<diondokter[m]>
* Scroll all the way down here:
<thejpster[m]>
uhh, I'll just use the QEMU firmware. I can pipe stdout to a file.
<thejpster[m]>
feels like a useful addition for probe-rs though - to capture the raw logs.
<Ralph[m]>
<thejpster[m]> "I'm cursed/blessed with only..." <- can't you simulate a keyboard? i just quickly googled and this was the first hit: https://github.com/harvie/ps2dev
<Ralph[m]>
(i didn't check if this supports simulating different layouts, but i guess you could add that if needed?)
<thejpster[m]>
me adding layouts to a keyboard emulator unfortunately does not answer the question "what Unicode character does Windows produce when I press this key combination on this keyboard".
<thejpster[m]>
Technically all I need is a Windows PC, both an ISO and an ANSI keyboard, and the ability to imagine what the keycaps have printed on them, but that's actually non-trivial. It's much easier to actually have the keyboard so you can see the two/three/four symbols on each keycap.
<thejpster[m]>
Also I don't have an ANSI keyboard, and I was doing most of the development on my laptop, which is neither ANSI nor ISO but some horrific Dell specific thing where none of the keys are where you wish them to be, and the Numpad is missing.
mameluc[m] has joined #rust-embedded
<mameluc[m]>
I am trying to get my device to reset on panic but it seems to hang. I have my fw set up to blink a led on start and then I panic directly after that (just to test). My expectations is that the device would restart and blink again but that doesn't seem to be the case. Any idea what I am doing wrong? This is on STM32WLE
Hallo124 has quit [Remote host closed the connection]
Hallo124 has joined #rust-embedded
socrates1298 has joined #rust-embedded
Hallo124 has quit [Remote host closed the connection]
Hallo124 has joined #rust-embedded
socrates1298 has quit [Client Quit]
socrates1298 has joined #rust-embedded
socrates1298 has quit [Client Quit]
socrates1298 has joined #rust-embedded
reto[m] has joined #rust-embedded
<reto[m]>
@thejpster i might have a french keyboard i can post you, will check next week. Any interest in swiss one? There are for sure some of those laying around :)
socrates1298 has quit [Ping timeout: 272 seconds]
mabez[m] has joined #rust-embedded
<mabez[m]>
I think I recall reading that Adam is on vacation, should I (or someone else) create the discussion for next Tuesday's meeting?
<JamesMunns[m]>
Ah, he was for the last meeting, and I didn't make one. Let me do that real quick
<thejpster[m]>
reto: yes, sure. Both would be great!
<thejpster[m]>
Do Swiss French and Swiss German have different layouts?
<reto[m]>
Swiss French and Swiss German keyboards have slightly different layouts and are different from German and French layouts too. I'll check on Tuesday what I can find and will let you know.
<Ralph[m]>
<thejpster[m]> "Do Swiss French and Swiss German..." <- Swiss French and Swiss German are physically the same keyboard. you have keys labelled with e.g. "éö/öé" and depending on which keyboard layout you have active in your OS it'll either pick "ö" by default (CH_DE) or "é" (CH_FR) and the other with shift as a modifier. most keys are the same on both, however.
<Ralph[m]>
(not sure how PS/2 keyboards behave here - the last time i saw one was a few decades ago...)
extrafofo has quit [Ping timeout: 248 seconds]
jason-kairos[m] has joined #rust-embedded
<jason-kairos[m]>
silly question: sometimes when a hardfault occurs a backtrace can be generated. Other times it can't. Does anyone have any insight into the whys and horws of this?
<jason-kairos[m]>
I know it often is possible to manually unwind the stack, but it sure is a pain
<JamesMunns[m]>
in an svcall handler, you'll switch to the msp, I don't know if gdb knows how to unwind by switching back to the psp to inspect the svc initiator
<jason-kairos[m]>
hmm... that sounds promising. How do you switch between the two in gdb?
<JamesMunns[m]>
no idea, never tried
<JamesMunns[m]>
you can get the psp in info regs I think, not sure if you can initiate a bt from a specific start addr
<ejpcmac[m]>
Hello, has anyone already managed to enable cross-language LTO in a Rust-based firmware with a C dependency compiled with clang?
<ejpcmac[m]>
I see no difference when I add -flto to the CFLAGS.
<JamesMunns[m]>
I think there was one more thing you had to enable, something something linker plugin in the RUSTFLAGS?
<JamesMunns[m]>
(if Rust is running the linking)
<JamesMunns[m]>
-Clinker-plugin-lto it seems?
<JamesMunns[m]>
"xlto" used to be what cross language lto was called, which might help in searching
<ejpcmac[m]>
Context: I’m doing a little size benchmark on verbatim-ported code between C and Rust. I can swap implementations with a feature flag. Without LTO my firmware has the exact same size. With LTO both shrink, but the Rust one is still bigger than the C one, and I can clearly see that C functions called from Rust are not inlined.
<JamesMunns[m]>
ah, I think setting -fuse-ld=lld was also necessary to force lld-style linking instead of gcc-style linking (otherwise it might not use the llvm bitcode which enables xlto?)
<ejpcmac[m]>
Other strange thing: when I pass -C linker-plugin-lto to the RUSTFLAGS, this also decreases the size even in the pure-Rust implementation.
<JamesMunns[m]>
what lto setting are you using for the just-rust impl?
<JamesMunns[m]>
(fat/thin/?)
<ejpcmac[m]>
But then, the one with the C library is still bigger, and still not inlined.
<JamesMunns[m]>
it wouldn't entirely surprise me if xlto COULD make your binary bigger: if you are inlining C code multiple times into your rust fns, they will be bigger
<JamesMunns[m]>
vs if they are external symbols, they will never be inlined
<JamesMunns[m]>
like, for non-trivial functions, inlining makes code faster but larger, though there are exceptions when inlining allows for better optimization (like squishing down iterator chains and such)
<ejpcmac[m]>
I don’t really understand why RUSTFLAGS="-C linker-plugin-lto" would reduce the size in the pure-Rust firmware.
<JamesMunns[m]>
what lto setting are you using for the just-rust impl?
<JamesMunns[m]>
iirc l-p-lto makes the linker to the lto (like lto=fat), instead of the compiler (like lto=thin), which could cause different (better or worse) results.
<ejpcmac[m]>
(Sorry for the lag, it seems the PostgreSQL server used by my Matrix server has currently a huge performance issue.)
ouilemur has quit [Quit: WeeChat 4.6.3]
<ejpcmac[m]>
<JamesMunns[m]> "Check out https://doc.rust-lang..." <- I’ve followed this steps, and it does no change anything. Tried to set `-Clinker=lld` directly as well. No change.
<JamesMunns[m]>
<ejpcmac[m]> "I’ve followed this steps, and it..." <- I'm out of ideas then! I tried it out a couple years ago for some embedded stuff, but have not used it actively since.
<ejpcmac[m]>
(My Matrix server is still not keeping up with events, I’m receiving messages from 1h ago. I bet I’m just good to do some PostgreSQL maintenance…)
<jason-kairos[m]>
alternative question: is there any way to teach GDB the type/register definitions without defining a static pointer?
DavidGoodenough[ has quit [Quit: Idle timeout reached: 172800s]
pcs38 has joined #rust-embedded
Hallo124 has quit [Remote host closed the connection]
Hallo124 has joined #rust-embedded
pcs38 has quit [Quit: leaving]
<jason-kairos[m]>
how do you turn a cortex_m::peripheral::SYST::PTR into a SYST to access the set_reload() function?
M9names[m] has quit [Quit: Idle timeout reached: 172800s]
ouilemur has joined #rust-embedded
Foxyloxy has quit [Read error: Connection reset by peer]