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
starblue has quit [Ping timeout: 255 seconds]
starblue has joined #rust-embedded
sauce has quit [Server closed connection]
sauce has joined #rust-embedded
IlPalazzo-ojiisa has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
duderonomy has joined #rust-embedded
tafama has quit [Quit: ZNC - https://znc.in]
tafa has joined #rust-embedded
emerent_ has joined #rust-embedded
emerent is now known as Guest7799
Guest7799 has quit [Killed (tungsten.libera.chat (Nickname regained by services))]
emerent_ is now known as emerent
ryan-summers[m] has quit [Quit: Idle timeout reached: 172800s]
IlPalazzo-ojiisa has joined #rust-embedded
datdenkikniet[m] has quit [Quit: Idle timeout reached: 172800s]
limpkin has quit [Quit: limpkin]
limpkin has joined #rust-embedded
limpkin has quit [Client Quit]
limpkin has joined #rust-embedded
toor[m] has quit [Quit: Idle timeout reached: 172800s]
dirbaio[m] has quit [Quit: Idle timeout reached: 172800s]
JonathanDickinso has quit [Quit: Idle timeout reached: 172800s]
ilpalazzo-ojiis4 has quit [Quit: Idle timeout reached: 172800s]
mameluc[m] has joined #rust-embedded
<mameluc[m]> Seems like this room is bugging out for me. I receive notifications but no messages
diondokter[m] has quit [Quit: Idle timeout reached: 172800s]
<adamgreig[m]> often that's for responses in threads, if you're on element web check the little chat box icon on the top right
JamesMunns[m] has quit [Quit: Idle timeout reached: 172800s]
crabbedhaloablut has quit []
<mameluc[m]> the last message seems to be from Friday but maybe people are not that active on the weekend here
diondokter[m] has joined #rust-embedded
<diondokter[m]> Ah, STM being STM again!
<diondokter[m]> So this ADC goes up to 2.5 Msps on 12-bit, right?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/VEQuKerTYUFQSvxhIgKAiPrB>)
dirbaio[m] has joined #rust-embedded
<dirbaio[m]> hmm are you sure there's no "max ADC clock" or similar documented in the datasheet?
JamesMunns[m] has joined #rust-embedded
<JamesMunns[m]> They might have a max speed to hit some level of accuracy
<diondokter[m]> No it's literally a feature of this ADC that it can run at the PCLK without divider
<diondokter[m]> It works fine though at max speed. But I don't need it, I just care about the time of my samples :P
<dirbaio[m]> which stm32?
<diondokter[m]> Stm32g030f6
<diondokter[m]> Ah lol
<diondokter[m]> Then why does it work hahaha
<dirbaio[m]> 🙃
<JamesMunns[m]> diondokter[m]: that's the great thing about ub! sometimes it does work!
<JamesMunns[m]> it might just give you bizzare-ass nonlinear adc readings!
<diondokter[m]> No, the readings are very good haha
<JamesMunns[m]> at room temperature? :p
<diondokter[m]> That's true!
<diondokter[m]> Fine. I'll change the clock haha
<dirbaio[m]> ADC overclock ⚡️⌛️⚡️
nadja has quit [Server closed connection]
nadja has joined #rust-embedded
<JamesMunns[m]> Reading STM32G0-Analog-ADC-ADC.pdf, the ADC is a "Successive-approximation ADC", but basically it means it takes the input, charges a capacitor, then samples and holds that. It seems that the "too quick" sample time failure mode only presents with high-impedance signals. If you're plugging something relatively low resistance into the ADC, it'll read fine. If you have it though a huge voltage divider (like to read a battery
<JamesMunns[m]> voltage), it might read low if you don't give it enough capture time.
<JamesMunns[m]> so like, if you are reading between a 2k/5k voltage divider (or like just direct from a PSU), overclock away! If you run it between a 200k/500k voltage divider, you might not collect enough coloumbs and read too low of a value.
<diondokter[m]> Hmmm yeah. Well in my situation so far it was a 0-60v signal through a 120/10k divider
<diondokter[m]> Working on my induction heater. That voltage is gonna go up later when I'm not scared of blowing up another IGBT :P
<diondokter[m]> So might be fine yeah
<JamesMunns[m]> oh wow, this slide tells you what IP they use for the ADCs
<JamesMunns[m]> "TSMC090" shows a bunch of synopsis IP references, neat.
<diondokter[m]> Oh! It's not even their IP? 🤯
<diondokter[m]> You'd think STM is big enough to design their own ADCs
<JamesMunns[m]> Ah, wait, that's referring to the fab process
<JamesMunns[m]> diondokter[m]: lots of their stuff isn't their IP
<diondokter[m]> I know about the radio in the WL or WB series. That's just a semtech
<dirbaio[m]> wb is semtech too?
<JamesMunns[m]> and lots of the USB IP is synopsis too
<diondokter[m]> The 'or' is there because I don't remember which one
<diondokter[m]> The one that does LoRa
<dirbaio[m]> ah, wl then
<JamesMunns[m]> I was having trouble figuring out some of the allwinner D1 drivers, until I realized their USB OTG IP was all from mentor graphics, which has lots of leaked docs
<mameluc[m]> wl series uses SX126x to be exact
<dirbaio[m]> they just glued a semtech SXsomething. you talk to it via an on-die SPI even, with the same protocl you'd talk to a discrete SXsmoething 🤪
<dirbaio[m]> didn't even try to connect it to an APB like a real peripheral 🤪
<diondokter[m]> Yeah, I've done lora in 2017-2019 with an SX1276. Pretty nice chips though!
<diondokter[m]> But I have no clue why they have so many variants. They're all pretty much the same! Even chips meant for the same frequency band
firefrommoonligh has quit [Quit: Idle timeout reached: 172800s]
<JamesMunns[m]> JamesMunns[m]: Yeah, I guess this just means the ADC is fabbed on 90nm TSMC nodes, tho "TSMC090 ADC" does show a lot of research papers and some synopsis IP references, haven't gone to check the verilog to see if it looks remotely like the STM32G0 one tho
<diondokter[m]> 90nm, nice! We've reached bleeding-edge 2003 :P
<mameluc[m]> first time using stm32 for me and I happened to get in to the stm32wl chip. Basically m0+ and m4 cores, some trippy peripherals and a semtech chip glued together. Idk how common it is to have two cores like that
<diondokter[m]> Ok, final sample speed ends up being 2285714.5 without overclock (but with a 32mhz synchronous clock)
<diondokter[m]> Most STM chips are single core
<JamesMunns[m]> mameluc[m]: not uncommon, especially for a lot of radio processors
M9names[m] has joined #rust-embedded
<M9names[m]> Fairly common for chips with wireless comms to have 2 cores, allows vendors to run a blob without having to care as much about how it impacts user code
<mameluc[m]> ah thats why
<dirbaio[m]> yeah, nrf52 doesn't do the two cores thing and it's a bit of a pain
<mameluc[m]> there is also some trickery to hide the keys without a secure element
<dirbaio[m]> guess that's why they added the 2nd code in the nrf53
<JamesMunns[m]> dirbaio[m]: and they totally started doing it for nrf53 + nrf91
<dirbaio[m]> nrf91 also so they can make their IP unreversengineereable
<JamesMunns[m]> tho all the old "M4+M0" cores I saw were *cursed*, like they had very little coherency between cores, and it's not like the m0 can do atomics for synchronization
<JamesMunns[m]> but yeah, they generally expect you to run their blob(s) on the m0 core, and use their staticlibs to handle talking to them, good luck if you decide not to do that.
<mameluc[m]> makes sense for stuff that is more complicated than jiggling some spi
<dirbaio[m]> except if the blob is C
<dirbaio[m]> and assumes you run a RTOS
<dirbaio[m]> so they fail to give you nonblocking APIs
<dirbaio[m]> (looking at you Nordic)
<JamesMunns[m]> yeah, that's pretty common for vendors
<JamesMunns[m]> the only supported use case is "copy and paste our sample project then tweak a few things, but not too much"
<mameluc[m]> without vendors our jobs would be so much nicer. Id probably be a carpenter
<diondokter[m]> Ratatui is prett nice btw :D
<diondokter[m]> s/prett/pretty/
<mameluc[m]> no_std?
<diondokter[m]> No this is a screenshot of my PC
<diondokter[m]> It's a CLI that continuously monitors the state of the device over modbus
<mameluc[m]> idk what Id do with it on an embedded device but would be cool to connect the serial port and have this hackerman stuff spew out
<mameluc[m]> I had to do some hackerman stuff for a kids TV show. I did it in javascript. This would have saved so much work
<diondokter[m]> Yeah ratatui (the successor to tui-rs) is definitely worth checking out!
<diondokter[m]> My entire CLI including modbus is just 710 loc
<mameluc[m]> thanks for the tip, will use some day
<JamesMunns[m]> tokio-console is also using tui-rs