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
_whitelogger_ has joined #rust-embedded
cr1901 has quit [*.net *.split]
Guest7282 has quit [*.net *.split]
Amanieu has quit [*.net *.split]
richardeoin has quit [*.net *.split]
_whitelogger has quit [*.net *.split]
Guest7282 has joined #rust-embedded
dkhayes117[m] has joined #rust-embedded
<dkhayes117[m]> Dipping my toes into embedded-hal. I'm looking at updating a driver, that I want to use in the future, from eh-0.2 to eh-1. Are there any examples of crates that already have migrated, specifically i2c/spi.
<dkhayes117[m]> Making some progress looking closer at the docs along with the migration guide πŸ™‚
cr1901 has joined #rust-embedded
emerent has quit [Ping timeout: 260 seconds]
emerent has joined #rust-embedded
spinfast[m] has joined #rust-embedded
<spinfast[m]> <d3zd3z[m]> "byteorder needs std to..." <- I believe nom could do it?
<spinfast[m]> If the format is simple
<spinfast[m]> Enough
<spinfast[m]> s/Enough/enough /
notgull has joined #rust-embedded
M762spr[m] has quit [Quit: Idle timeout reached: 172800s]
notgull has quit [Ping timeout: 264 seconds]
rjmp[m] has quit [Quit: Idle timeout reached: 172800s]
eldruin[m] has joined #rust-embedded
<eldruin[m]> <dkhayes117[m]> "Dipping my toes into embedded-..." <- My [BMI160](https://github.com/eldruin/bmi160-rs) IMU is an example of a driver updated to e-h 1.0 supports allows both SPI and I2C.
<eldruin[m]> Alternatively, the [LM75](https://github.com/eldruin/lm75-rs) driver is simpler as this device supports only I2C
<eldruin[m]> I recently published version 1.0.0 for both πŸŽ‰
romancardenas[m] has quit [Quit: Idle timeout reached: 172800s]
thejpster[m] has joined #rust-embedded
<thejpster[m]> It is possible to write a #[cfg(...)] which knows if you specified thumbv6m-none-eabi or thumbv7m-none-eabi as your target?
<dirbaio[m]> not out of the box
<dirbaio[m]> then you can do cfg(armv6m) etc
<thejpster[m]> ahh, that could work
<thejpster[m]> weird that target_arch gets collapsed to arm for all the various Cortex-M targets
<thejpster[m]> * weird that target_arch gets collapsed to arm for all the various ~~Cortex-M targets~~ M-Profile Arm targets
<thejpster[m]> > Note that this does not affect Cargo’s dependency resolution. This cannot be used to enable an optional dependency, or enable other Cargo features.
<thejpster[m]> boo
<thejpster[m]> I also want to optionally include a package depending on the chosen target
<JamesMunns[m]> thejpster[m]: the issue with build-rs is that it runs AFTER all deps, BEFORE the target package
<thejpster[m]> yeah makes sense
<thejpster[m]> maybe target_arch is enough
<JamesMunns[m]> afaik there's no way to affect feature decisions other than a full wrapping tool like just
<JamesMunns[m]> (e.g., change what you pass to cargo itself)
<thejpster[m]> it's weird that you can't, say, depend on a soft-float library but only on Arm chips that don't have an FPU. You have to always build it and then only optionally use it.
<JamesMunns[m]> I'm trying to think of metaphors for this, maybe crates that have multiplatform support for targets?
<JamesMunns[m]> like different OS deps
<JamesMunns[m]> I guess you can do that for target_os but not for FPU presence: https://github.com/kevinmehall/nusb/blob/main/Cargo.toml#L22-L31
<JamesMunns[m]> so, lobby for a stable "target has hard fpu" cfg field?
<JamesMunns[m]> thejpster riscv has extension flags under target feature attrs: https://doc.rust-lang.org/reference/attributes/codegen.html#the-target_feature-attribute
<JamesMunns[m]> honestly, you could totally make a case for adding "has fpu" as a target feature for cortex-m targets. Just nobody has done it.
<thejpster[m]> I also have an issue with tying FPU support to being able to use FPU registers for parameter passing
<thejpster[m]> eabihf is about the latter, but you can use a Cortex-M4F with just eabi and still use the FPU.
<thejpster[m]> If, say, you wanted ABI compatibility with some C code, but still to do Fast Maths in Rust land.
<JamesMunns[m]> I imagine that is going to break a lot of assumptions and cause a ton of problems. It probably shouldn't, but I bet it totally would, across both rustc and llvm
<JamesMunns[m]> but, idk.
<thejpster[m]> well it breaks cortex-m-rt to start, because the has-fpu flag is set based on the name of the target, and not the enabled CPU options.
<JamesMunns[m]> that's a hack, because there was no other way to determine it
<JamesMunns[m]> if it WAS exposed via target-features, cmrt should switch to that
<thejpster[m]> it's one of those things I feel like I want to fix, but at the same time I'd rather Arm fixed it because they know their CPU archtecture and the permutations of the IP they sell better than I do.
<JamesMunns[m]> I guess there's two things going on here:
<JamesMunns[m]> * "hard vs soft float shouldn't be as magic/special cased": whew probably agree personally but whew
<JamesMunns[m]> * rustc should expose stuff like "has fpu"/"is a hard float target": within the scope of rust, could happen IMO
<JamesMunns[m]> https://2024.rustnl.org
<JamesMunns[m]> πŸ‘€πŸ‡³πŸ‡±
lulf[m] has joined #rust-embedded
<lulf[m]> Delft ❀️
FreeKill[m] has joined #rust-embedded
<FreeKill[m]> Yoooo I can so go to that
<adamgreig[m]> and the couple day embedded workshop afterwards πŸ‘€ we discussed it a little late last year
<adamgreig[m]> (details on that are still tbc, as far as i know)
<JamesMunns[m]> > Following the conference RustNL will facilitate a multi day unconference for Rust maintainers in the mobile and embedded space. Contact us at 2024@rustnl.org if you're interested in sponsoring the conference or unconference.
<JamesMunns[m]> yeah, haven't seen more details than that yet.
IlPalazzo-ojiisa has joined #rust-embedded
crabbedhaloablut has quit [Read error: Connection reset by peer]
crabbedhaloablut has joined #rust-embedded
Guest7282 has left #rust-embedded [Error from remote client]
Guest7282 has joined #rust-embedded
cmaiolino has joined #rust-embedded
<thejpster[m]> ah, weirdly, I was looking that up on my phone whilst out at lunch .... at the exact same time .... without having seen the tweet
diondokter[m] has quit [Quit: Idle timeout reached: 172800s]
onsdag[m] has quit [Quit: Idle timeout reached: 172800s]
ryan-summers[m] has joined #rust-embedded
<ryan-summers[m]> Anyone know if they're looking for talks etc?
<JamesMunns[m]> I emailed them asking the same :D
JomerDev[m] has joined #rust-embedded
<JomerDev[m]> Does anybody know if there is a way to do something on panic (e.g. enabled an led) while still using panic-probe?
<adamgreig[m]> I don't think panic-probe has any hooks, but you could write your own panic handler and do an rtt print inside it, it's only a few loc
<adamgreig[m]> `#[panic_handler] fn panic(info: &core::panic::PanicInfo) -> ! { cortex_m::interrupt::disable(); my_led.turn_on(); defmt::println!("panicked") }`
<JomerDev[m]> Yeah, I saw that it wasn't much, but wanted to avoid just cloning the code for that if I could
<adamgreig[m]> you can skip the parts of that to do with picking which rtt/defmt and probably which target and so forth, so all you really need is a few lines
<adamgreig[m]> but nothing in those few lines lets you hook your own function on a panic
<dirbaio[m]> panic-probe does udf to escalate to a hardfault, you can put your custom code in the hardfault handler
<adamgreig[m]> oh, yea, do that
<adamgreig[m]> has the bonus of also triggering on a non-panic hardfault
firefrommoonligh has joined #rust-embedded
<firefrommoonligh> Does anyone know of any tricks re stm32H7 ADCs, other than enabling PLL2P or a/r? I am having a struggle! Ty
<firefrommoonligh> Of note, I do ADC ops on G4 all the time
<dirbaio[m]> tricks to make it work?
<JomerDev[m]> <dirbaio[m]> "panic-probe does udf to..." <- If you could tell/link me to how I can do that? πŸ˜…
<JomerDev[m]> Thank you!
<JomerDev[m]> Oh right, but I can't make the led blink without the peripherals anyway and I don't think I can share them over a panic and/or a hard fault 🀦
<dirbaio[m]> you can steal them from thin air
<JomerDev[m]> Can I?
<JomerDev[m]> Ohh, I see
RobertJrdens[m] has joined #rust-embedded
<RobertJrdens[m]> <JomerDev[m]> "Can I?" <- turning ond leds in panic/hardfault etc handler: https://github.com/quartiq/stabilizer/blob/c9d74ed9b67d9a2c50526660bccb9bbb840c566e/src/hardware/mod.rs#L157
notgull has joined #rust-embedded
potato[m] has quit [Quit: Idle timeout reached: 172800s]
<firefrommoonligh> <dirbaio[m]> "tricks to make it work?" <- Well, for example, the default-disabled default clock. I'm just kind of hitting a wall with the "it should work but it doesn't"
<dirbaio[m]> yeah.. i'm not sure if there's anything else
<dirbaio[m]> set ADCSEL to PLL2_P, then make PLL2 output something on P
<dirbaio[m]> then set ADC12EN or ADC3EN
<firefrommoonligh> Thank you. I will try that. Trying the stm32h7xx-hal example now
<dirbaio[m]> the shared ADC12EN bit is a common gotcha
<dirbaio[m]> enable ADC1, enable ADC2, disable ADC1 and boom ADC2 stops working πŸ’©
<firefrommoonligh> What's kind of interesting is I'm running into this problem on both my own flight control firmware and the OSS Betaflight, but it works in Ardupilot
<firefrommoonligh> (This measures battery voltage as a proxy for life remaining)
<firefrommoonligh> I was sure I had a hardware problem at first!
<dirbaio[m]> if you make the HAL do "enable/disable RCC bit" automatically :(
<firefrommoonligh> dirbaio[m]: Actually you helped me with this issue on a G4 board recently! (Diff use case; that was 14 separate ADC channels across 2 ADCs, and only one ADC would work at a time until we chatted)
<dirbaio[m]> embassy refcounts the bit now
<firefrommoonligh> OK - the STM32h7xx hal example works. So something my code is forked
<firefrommoonligh> This is a great baseline
RockBoynton[m] has joined #rust-embedded
<RockBoynton[m]> I have a issue I thought I should post here since it seems to go deeper than just Embassy:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/LAQUWyjHgoSATNfIrjOsbaYL>)
notgull has quit [Ping timeout: 264 seconds]
<JamesMunns[m]> It might be worth running from RAM as a demo, to rule out flash latency
<JamesMunns[m]> it might not be a SOLUTION, but would help you eliminate flash latency, icache, and wait states as a cause (or reveal it as a big part).
<JamesMunns[m]> You almost certainly should not be seeing latencies that high if you aren't critical sectioning or similar. ISR latencies on cortex-m are like 10-20 cycles, at 480x20 that's nearly 10k cycles which means something is very weird.
<JamesMunns[m]> (I think external flash and wait states could bring that number higher than 10-20, I think that's spec'd at zero flash wait states, which isn't achieveable at 480mhz usually, but it should be way closer to 10 than 10k)
<RockBoynton[m]> are there examples for loading the app into ram?
<JamesMunns[m]> it's mostly changing your linker script to pretend that the FLASH section is actually in the RAM range
<JamesMunns[m]> dirbaio will correct me, I thought that probe-rs/probe-run could support this, so it should just be changing the linker script to totally ignore the flash regions, then do a cargo run
<JamesMunns[m]> if probe-rs can't do it, you definitely can do it with gdb and calling load
<dirbaio[m]> they can "flash" to RAM, but they can't boot from ram. teleprobe can
<JamesMunns[m]> ah, that's annoying. I've definitely done this in the past, but it's been a while
<JamesMunns[m]> it probably was with gdb, which I think does handle it gracefully, e.g. doing:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/aogzJKucvCsqROyxqIjJElSY>)
<dirbaio[m]> "reset" boots from the chip default, which is from flash, I think?
<JamesMunns[m]> I don't think I had to manually set the pc, but maybe I did?
<RockBoynton[m]> > if you aren't critical sectioning or similar.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/SxFLhXhppBSOGuynmtNCACpg>)
<RockBoynton[m]> * > if you aren't critical sectioning or similar.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/hkahiccmQrvKbifrWDvTcbrq>)
<thejpster[m]> <JamesMunns[m]> "I don't think I had to manually..." <- Sometimes gdb or openocd does it for you. Caught me out recent because it was bypassing my boot Rom. An extra monitor reset halt after flashing did the trick.
<JamesMunns[m]> JamesMunns[m]: > <@jamesmunns:beeper.com> ```... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/PjIBJubftxWHygATzHntZUDA>)
<JamesMunns[m]> you'd probably want a 1ghz scope to resolve a pulse that triggers on a 480MHz clock, assuming that gpio ops can be done in a single cycle.
<JamesMunns[m]> also if you don't clear an interrupt, it'll keep retriggering forever, are you sure it isn't just pulsing and it takes some time for you to see it on your scope Rock Boynton?
<JamesMunns[m]> what happens if you just set the LED high the first time the pulse occurs ("latching"), or until you press a button to clear or something?
<RockBoynton[m]> JamesMunns[m]: > <@jamesmunns:beeper.com> ```... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/DhFUDtXeJDIvEyNsBYToXKXd>)
<JamesMunns[m]> logic pro can sample up to 500ms/s, is it set that high for you? Or at a lower sample rate?
<JamesMunns[m]> (16 cpu cycles sounds a little high but not awful, the peripheral bus might have a slower access time)
<RockBoynton[m]> It was set at 125 MS/s, but I just tried 500 and it was 36 ns pulse
<JamesMunns[m]> fair! at 125ms/s you're in increments of 8ns :D
<RockBoynton[m]> I set the clock for 400 for the bare metal test and I believe the perif clock is half that
<JamesMunns[m]> Still, it'd be interesting to see if it behaves the same using a latching signal rather than a quick pulse like that
<JamesMunns[m]> maybe I'm just being paranoid :)
<RockBoynton[m]> > also if you don't clear an interrupt, it'll keep retriggering forever,
<RockBoynton[m]> I do clear the button pending bit in the irq as I shared
<RockBoynton[m]> I also trigger the salae on the first pulse of the LED pin so it is latching
<JamesMunns[m]> sorry, I'm using trigger twice:
<JamesMunns[m]> * make sure the interrupt isn't firing multiple times
<JamesMunns[m]> * have the LED go high always
<JamesMunns[m]> like, just led.set_high(), don't do led.set_low() (or put in a big delay)
mameluc[m] has quit [Quit: Idle timeout reached: 172800s]
<RockBoynton[m]> done
<JamesMunns[m]> gotcha! I am just paranoid then!
<RockBoynton[m]> just commented out the led.set_low()
<RockBoynton[m]> no worries, I'm willing to try anything
<JamesMunns[m]> I was making sure it wasn't a sampling/aliasing issue
<RockBoynton[m]> Thanks for your help!
<JamesMunns[m]> wait, does cortex-m still require the inline-asm feature to get asm intrinsics?
<JamesMunns[m]> there's also a cm7 features I don't remember what it does
<JamesMunns[m]> I wonder what devices have that
<JamesMunns[m]> Rock Boynton can you stick your projects in gh somewhere? I think you said you had:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/AKjjJSpADoxdxwIYqmvZHOAd>)
<JamesMunns[m]> I'd be interested in looking at those projects to see if I can see anything significantly different about them.
<dirbaio[m]> I think he mentioned he was getting ~20us with all 3
<RockBoynton[m]> yes dirbaio is right
<JamesMunns[m]> ah, I thought he had one where he got like 200ns latency once
<RockBoynton[m]> I'll clean up my mess of testing and try to make it reproducible for you.
<JamesMunns[m]> I don't have a board, so I probably can't reproduce, but I can peek!
<dirbaio[m]> makes me wonder if it's something flaky with the measurement setup?
<RockBoynton[m]> James Munns the fastest interrupt latency I have seen is 600 ns using rtic with an L4
<JamesMunns[m]> I have an STM32H743VI, not on a nucleo board (it's a weact)
<dirbaio[m]> what're you using to make the "trigger" pulse? how's the wiring done? are the wires too long maybe?
<dirbaio[m]> can you check with an oscilloscope to verify the edges are clean/fast?
<RockBoynton[m]> dirbaio[m]: I was starting to think the image wasn't getting loaded or something but I have switched up the behavior slightly (e.g only toggling instead of pulsing) and see my changes reflected. I have also tried switching back to the L4 and seeing the right behavior there as well
<JamesMunns[m]> what chip is your H7 again?
<RockBoynton[m]> dirbaio[m]: the wires are the ones included with the salae with the prongs manually held on the pads of the nucleo extension headers (ok, I'll admit this is jank af, but I was doing this on all of my testing, same on both nucleos)
<RockBoynton[m]> stm32h743zit6u is the exact printing on the chip
<JamesMunns[m]> oh wow maybe I do have that exact chip lol
<JamesMunns[m]> VIT6 instead of ZIT6, but damn, close
<JamesMunns[m]> so yeah, make me a repro, I'll play with it this weekend.
<dirbaio[m]> how're you making the first pulse?
<RockBoynton[m]> oh shit I just checked the analog signal and dirbaio you may be on to something
<RockBoynton[m]> look how slow the button rise is compared to the led pin
<JamesMunns[m]> lol
<JamesMunns[m]> THE PLOT THICKENS!
<JamesMunns[m]> Zoom in on the voltage, when does it cross 1.65v?
<dirbaio[m]> oh boi
<JamesMunns[m]> capacitance? on your wire? it's more likely than you think!
<dirbaio[m]> you'll need something to generate a sharp edge, like another MCU
<JamesMunns[m]> wonder if the button on the board has an RC filter or something
<RockBoynton[m]> it crosses at the red line
<JamesMunns[m]> that's a lot closer!
<RockBoynton[m]> fucking duuuuude why is different between nucleos
<JamesMunns[m]> not sure exactly what the trigger on the MCU GPIO pin is, but 1/2 x 3.3v is a pretty good first guess
<dirbaio[m]> I think it's very dependent on the exact silicon you have
<dirbaio[m]> ST promises "above X voltage the MCU will read it as high", but there's A LOT of wiggle room
<JamesMunns[m]> looking up the schematic to see if they have a cap on the button or something
<JamesMunns[m]> Do you have the C01 or E01 board revision?
<JamesMunns[m]> also what button are you using?
<dirbaio[m]> you simply can't get micro/nanosecond precision measurements with a button
<RockBoynton[m]> JamesMunns[m]: E01
<dirbaio[m]> use another mcu to generate the edge. straight from gpio to gpio
<JamesMunns[m]> you're gunna love this
<JamesMunns[m]> oops RC filter on the button!
<JamesMunns[m]> you're measuring your 100nf capacitor's rise time!
<RockBoynton[m]> dirbaio[m]: Now that you say it it makes so much sense, forgive my ignorance
<JamesMunns[m]> lmao
<JamesMunns[m]> you could probably calculate the time constant of the RC network and figure out how close you got... or wire up an MCU to a pin that DOESN'T expect you to charge a cap first :)
<RockBoynton[m]> it is always a hardware problem
<JamesMunns[m]> "wontfix: works as designed"
<RockBoynton[m]> or a problem between keyboard and seat
<JamesMunns[m]> it's friday, don't be too hard on yourself :D
<JamesMunns[m]> when in doubt tho, "check the schematic" is always a fair shout
<RockBoynton[m]> Hell of a debugging session fellas, much appreciated. I will make my test case more representative and report back with results
<JackGreenbaum[m]> @rock
<JackGreenbaum[m]> * @rock, Is there a timer running at full clock speed on the chip? If so you can trigger the interrupt from the timer and read the timer in the handler to measure interrupts by clock cycles precisely.
<JackGreenbaum[m]> * @rock, Is there a timer running at full clock speed on the chip? If so you can trigger the interrupt from the timer and read the timer in the handler to measure interrupts by clock cycles precisely. Or are you specifically trying to measure "from the pins"?
<JackGreenbaum[m]> * @rockboynton:matrix.org , Is there a timer running at full clock speed on the chip? If so you can trigger the interrupt from the timer and read the timer in the handler to measure interrupts by clock cycles precisely. Or are you specifically trying to measure "from the pins"?
<JamesMunns[m]> JackGreenbaum[m]: The original goal was "latency from gpio interrupt to MCU response"
<JamesMunns[m]> The goal was to use a gpio interrupt as a "start transfer" signal with a 1us turnaround time from trigger to starting send
<JamesMunns[m]> So "interrupt sets a gpio high" was the minimum viable measurement baseline
<JackGreenbaum[m]> Sounds like the answer involves "How hard can we drive the GPIO pin?"
<JamesMunns[m]> Maybe! The root issue is we found "the hardest button to button", to quote a different Jack.
<JamesMunns[m]> (I think as long as the answer was sub-us, the precise answer didn't matter QUITE as much.)
vollbrecht[m] has quit [Quit: Idle timeout reached: 172800s]
Ralph[m] has quit [Quit: Idle timeout reached: 172800s]
GrantM11235[m] has quit [Quit: Idle timeout reached: 172800s]
<RockBoynton[m]> <dirbaio[m]> "use another mcu to generate..." <- I'm having trouble getting this to work: For my setup, I powered my L4 board loaded with a simple blinky LED from an external power supply, I measure and verify the pin is toggling the way I want. Then I loaded the H7 with my latency test app. Now I am trying to wire up everything to allow me to measure the input side of the H7 pin connected to the output pin of the L4 that is
<RockBoynton[m]> toggling, as well as the output of the H7, but I can't figure out how to connect all the grounds that make the measurement I want possible between the Salae and the external power supply. I feel my electronics fundamentals is lacking here
<dirbaio[m]> and both nucleos connected with usb to the PC to power them
<dirbaio[m]> and the salelele too
<RockBoynton[m]> <dirbaio[m]> "should be just..." <- > <@dirbaio:matrix.org> should be just... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/SpZoIBrtFvHYnzMoniHUoIQi>)
<dirbaio[m]> that's odd
<dirbaio[m]> everything is connected to the same PC via USB?
<RockBoynton[m]> yes
<RockBoynton[m]> this was happening when I was using an external psu on the L4 as well
<RockBoynton[m]> I am using a USB hub (thanks mac), would that affect anything?
<JamesMunns[m]> you're not connecting any powers together, and not connecting like one device that is driving a pin high while another is driving the pin low?
<dirbaio[m]> why do you need external PSUs?
<dirbaio[m]> connecting GNDs from different PSUs is sometimes risky because they can be at different levels
<dirbaio[m]> it's better if you power everything from the same PSU
<dirbaio[m]> easiest is from USB
<dirbaio[m]> (from the Mac, or from the hub's PSU if it's powered)
<dirbaio[m]> and not use any extenral PSU
<RockBoynton[m]> not connecting powers together... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/YJIJVUtnPloOFNEilQTHjUOu>)
<RockBoynton[m]> dirbaio[m]: external psu was only cause I couldn't find another micro usb cable (but had a psu on my desk, funny I know). But I found another micro USB so external psu is out of the picture now
<dirbaio[m]> then I don't know what could be wrong :S
<RockBoynton[m]> ok I had a crazy idea, but I think it worked. I used the psu and set it to output 3v3. I tapped it on the pin pad on the board as an input.
<RockBoynton[m]> Embassy: 1.6 us
<RockBoynton[m]> Here are the results:
<RockBoynton[m]> RTIC: 780 ns
<RockBoynton[m]> HAL: 780 ns
<dirbaio[m]> the "button" channel is rising veeeeeeery slowly, I don't think this is accurate?
<RockBoynton[m]> I remember seeing an input speed in some HAL before, could that be something?
<dirbaio[m]> numbers look much more believable tho.
<JamesMunns[m]> output speed is a thing
<JamesMunns[m]> that would make your bumpy output a little sharper
<dirbaio[m]> no, I mean the button channel. the 3rd row, which iiuc is the input
<JamesMunns[m]> measuring where you do for input is odd tho
<JamesMunns[m]> yeah
<JamesMunns[m]> salelelelele is triggering at like 0.7v or something
<dirbaio[m]> yeah that's odd too
<JamesMunns[m]> theres a "logic level" setting you can set
<JamesMunns[m]> the default is like 1.2v or something
<JamesMunns[m]> it controls the high/low trigger thresholds for digital
<dirbaio[m]> but even then, you have no guarantee the salolol is triggering at the same time the H7 is. only way is to make the pulse actually sharp
<JamesMunns[m]> yep
<JamesMunns[m]> honestly Rock Boynton you could feed an output pin back onto the input pin just on the H743
<JamesMunns[m]> like, you could drive it high in "thread mode", since you're just firing an interrupt anyway
<dirbaio[m]> that might yield different results because the core will already be busy
<dirbaio[m]> taking an irq while busy can be slower
<dirbaio[m]> like if you're using sleeponexit
<RockBoynton[m]> I set the output from `Low` to `VeryHigh` but it didn't seem to make a difference... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/zKBMnzXzIEzNACUmjzYLYsiV>)
<JamesMunns[m]> like, 5-10 cycles slower, sure
<JamesMunns[m]> but if he's at 480mhz, 780ns is 390 cpu cycles
<JamesMunns[m]> which is still way more than the 15-20 I expect
<dirbaio[m]> yeah..
<JamesMunns[m]> tho its really less
<dirbaio[m]> maybe a pwm
<dirbaio[m]> so it's toggled without cpu intervention
<JamesMunns[m]> its 780ns from like 0.7v
<RockBoynton[m]> JamesMunns[m]: Ok right, I set it to 3v3 instead and it is almost at 1us
<JamesMunns[m]> that's... more?
<JamesMunns[m]> or you mean for embassy?
<RockBoynton[m]> no, the embassy app
<JamesMunns[m]> ah, gotcha
<RockBoynton[m]> the goal is to use embassy, so I'm trying to convince myself it will be make the requirement
<JamesMunns[m]> I mean you're gunna need a custom interrupt either way
<JamesMunns[m]> but you can have the rest of the app be embassy, or rtic 1 or rtic 2
<JamesMunns[m]> but if you have a hard 1us deadline, you don't want cooperative multitasking on that path, you very much want a preemptive interrupt
<JamesMunns[m]> 480 cycles even for an interrupt executor would be brave, IMO.
<JamesMunns[m]> maaaaybe, but it would be very close.
<dirbaio[m]> why do you need to send this thing over SPI so fast?
<dirbaio[m]> if you already have an FPGA, can't you design things in a way where all the real-time requirements are only in the FPGA?
<RockBoynton[m]> I was hoping to just make it a higher priority, I think dirbaio mentioned with `interrupt-executor` you could guarantee that a task that makes a timing will _always_ make it, is that incorrect?
<JamesMunns[m]> it will always be the HIGHEST priority
<JamesMunns[m]> but you have 480 CPU cycles to:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/dLhxUFQqpvofFiAtAsDeSUIs>)
<JamesMunns[m]> like, I'd believe you COULD do it. but flash wait states, critical sections, etc, are going to make it very easy to miss it by a bit. not a LOT but, a bit.
<JamesMunns[m]> vs an interrupt which is like 20-50 cpu cycles, guaranteed.
<JamesMunns[m]> I dunno, that's my gut feeling. Data beats gut feeling any day, for sure. but my gut is you'd be very close, and it's probably not worth the hassle vs just writing a small interrupt that pops from a queue and shoves it in a fifo, or slaps the "start" button on a DMA transfer.
<JamesMunns[m]> I'd trust dirbaio's gut over mine here, tho.
<RockBoynton[m]> hmm, a lot to think about
<JamesMunns[m]> <dirbaio[m]> "if you already have an FPGA, can..." <- I think this is a very good suggestion too