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
<M9names[m]> Holo: rp probe (the official one) has swclk on gpio 12 and swdio on gpio 14.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/NlRYquuNlyNHjlrtoRphiZWt>)
<holo[m]> <M9names[m]> "Holo: rp probe (the official one..." <- > <@9names:matrix.org> Holo: rp probe (the official one) has swclk on gpio 12 and swdio on gpio 14.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/ZexhPCiOZmhFwlOIceJUPZnH>)
pflanze has quit [Remote host closed the connection]
pflanze has joined #rust-embedded
pflanze has quit [Read error: Connection reset by peer]
pflanze has joined #rust-embedded
SunClonus has joined #rust-embedded
SunClonus has quit [Remote host closed the connection]
SunClonus has joined #rust-embedded
<michaeldesilva[m> Hi all, I'm having trouble running `probe-rs` when connecting to a simple blinky sketch with embassy - here's my entire code example https://github.com/bsodmike/stm32h747xi-async-quickstart... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/iOlCPHbfkJsPvCxtQuAPixWt>)
SunClonus has quit [Remote host closed the connection]
SunClonus has joined #rust-embedded
<michaeldesilva[m> Any ideas why I cannot set a breakpoint in Embassy with probe-rs? It also doesn't stop at the entry to main so I cannot step through. I've provided the SVD file https://github.com/bsodmike/stm32h747xi-async-quickstart/blob/master/.vscode/launch.json#L21 but I do not see any register details. FYI I'm... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/HfZmrngwyvGcqBtksbrcMmGj>)
<michaeldesilva[m> I'm now seeing a similar issue I initially faced on stm32h7xx-hal related to the power target. However, from what I can see the defaults do seem OK? https://github.com/embassy-rs/embassy/blob/main/embassy-stm32/src/rcc/h.rs#L316-L322
<michaeldesilva[m> <michaeldesilva[m> "I'm now seeing a similar issue I..." <- > <@michael.desilva:matrix.org> I'm now seeing a similar issue I initially faced on stm32h7xx-hal related to the power target. However, from what I can see the defaults do seem OK? https://github.com/embassy-rs/embassy/blob/main/embassy-stm32/src/... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/iWNZhTJAvrtsBcJGZrakDYZR>)
<michaeldesilva[m> * I find this super strange - I just switched my Arduino GIGA R1 Wifi board, and it is now reaching higher clock speeds, no problems - that issue with the power target is no longer a problem (on this board)... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/ytlbOSBejuvwtPqTlgUhGeQa>)
SunClonus has quit [Read error: Connection reset by peer]
johnbudweiser has joined #rust-embedded
johnbudweiser has quit [Remote host closed the connection]
<michaeldesilva[m> How does embassy-stm32 set limits on specific hardware, I'm interested in stm32h747xl but this https://github.com/embassy-rs/embassy/blob/main/embassy-stm32/src/rcc/f.rs#L416 doesn't list h7 at all, only in `stm32-metapac` which seems to generate info from SVD files.
<michaeldesilva[m> I've set my power stage to `LDO` - this works fine now, however I've got `config.rcc.sys = Sysclk::PLL1_P; // 400 Mhz` https://github.com/embassy-rs/embassy/blob/main/examples/stm32h7/src/bin/adc.rs#L40 with vos0 enabled (see https://github.com/embassy-rs/embassy/blob/main/examples/stm32h7/src/bin/adc.rs#L40... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/agSfCgxUgiofHOrNymITUMvI>)
<michaeldesilva[m> michaeldesilva[m: > <@michael.desilva:matrix.org> I've set my power stage to `LDO` - this works fine now, however I've got `config.rcc.sys = Sysclk::PLL1_P; // 400 Mhz` https://github.com/embassy-rs/embassy/blob/main/examples/stm32h7/src/bin/adc.rs#L40 with vos0 enabled (see https://github.com/embassy-rs/... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/CANWzhkQggJtNuvuSRUCZSvf>)
<michaeldesilva[m> I can't seem to get alloc to work with Embassy stm32 any ideas?
<michaeldesilva[m> ```
<michaeldesilva[m> ```
<michaeldesilva[m> * I can't seem to get alloc to work with Embassy stm32 any ideas?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/FdEDhViePIRZQBpagWACxgcl>)
<michaeldesilva[m> * I can't seem to get alloc to work with Embassy stm32 any ideas?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/YqGsfXvGvUVOBwnkYPoKetNS>)
<michaeldesilva[m> <michaeldesilva[m> "I can't seem to get alloc to..." <- > <@michael.desilva:matrix.org> I can't seem to get alloc to work with Embassy stm32 any ideas?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/uByMEaFVwxxVKdChcHKiFkjw>)
loki_val has quit [Ping timeout: 256 seconds]
crabbedhaloablut has joined #rust-embedded
crabbedhaloablut has quit [Ping timeout: 264 seconds]
crabbedhaloablut has joined #rust-embedded
<michaeldesilva[m> Rather than doing the following, is there a low-level way to initialise the data held to a specific value?... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/rYWRxeLaIAiysLRaEMHpJkpO>)
<michaeldesilva[m> * Rather than doing the following, is there a low-level way to initialise the data held to a specific value? Something similar to `memset` from C++.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/vooSOVGsoMdOIyPwQzJBpxOE>)
<diondokter[m]> michaeldesilva[m: > <@michael.desilva:matrix.org> Rather than doing the following, is there a low-level way to initialise the data held to a specific value? Something similar to `memset` from C++.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/GQIEkLOJCtNFAVWLDVGmmugl>)
<michaeldesilva[m> diondokter[m]: Thanks
<michaeldesilva[m> diondokter[m]: Isn’t that std dependent?
<diondokter[m]> It's available in core too
<michaeldesilva[m> Ahh
<diondokter[m]> If you don't want to cast it to a slice, there's this function too: https://doc.rust-lang.org/std/primitive.pointer.html#method.write_bytes
<diondokter[m]> If you search for memset on the docs site, you'll find anything that is marked as an alias for memset
<michaeldesilva[m> diondokter[m]: Hah just saw that. Sweet bytes()
<michaeldesilva[m> #[doc(alias = "memset")]
<JamesMunns[m]> Also, definitely benchmark before you start using unsafe because you think the safe code is slow. The optimizer is smart as hell, and using safe code makes it easier for the optimizer to be more aggressive
<JamesMunns[m]> I bet you your code will get turned into a member anyway
<JamesMunns[m]> s/member/memset/
<JamesMunns[m]> The optimizer LOVES turning code into memcpy, memset, and memmove. If it can do that, it almost certainly will.
<diondokter[m]> JamesMunns[m]: Yep. Using slice fill will very likely generate that. Using an iterator and doing it yourself will probably also result in a memset, but fill is probably easier for the optimizer
<JamesMunns[m]> you're mutably aliasing the memory, you write it manually after giving the memory to the allocator, that's UB
<JamesMunns[m]> like, after you give the full SDRAM memory range to the allocator, you should never touch/use it again. you should only use it through the allocator.
<JamesMunns[m]> also I don't know why you are re-initializing sdram after the first time you do it?
<JamesMunns[m]> it's likely you are corrupting the heap allocator's metadata, causing the segfault
<JamesMunns[m]> s/segfault/hardfault/
<michaeldesilva[m> JamesMunns[m]: 🤔 I'm missing the re-initialization bit, only once here? https://github.com/bsodmike/arduino-giga-r1-wifi-stm32h747xi-async-quickstart/blob/master/src/main.rs#L245
<JamesMunns[m]> this is undefined behavior
<michaeldesilva[m> JamesMunns[m]: ahh ignore that, I was being silly.
<JamesMunns[m]> like, you are corrupting the memory the heap allocator "owns", and you are probably overwriting it's metadata
<michaeldesilva[m> I was trying to figurer out why the drop was taking place
<JamesMunns[m]> if the compiler didn't already do something crazy because it figured out what you are doing is UB
<michaeldesilva[m> s/figurer/figurerout/, s/out//
<michaeldesilva[m> s/figurer/figure/
<JamesMunns[m]> drops happen when the item falls out of scope. you create a string in the loop when you call to_rfc2822, so it gets dropped when you leave the if let block
<michaeldesilva[m> JamesMunns[m]: right but that shouldn't drop my allocator?
<michaeldesilva[m> * my allocator? It's a global allocator....?
<JamesMunns[m]> it doesn't but you've corrupted the allocatr
<JamesMunns[m]> the ALLOCATOR is never dropped.
<JamesMunns[m]> the STRING your allocator allocated is deallocated/dropped
<michaeldesilva[m> JamesMunns[m]: where? the UB bit is commented out?
<michaeldesilva[m> JamesMunns[m]: ahh
<JamesMunns[m]> no, even HAVING ram_slice is undefined behavior
<michaeldesilva[m> JamesMunns[m]: ahhhhh
<JamesMunns[m]> you cannot have aliased memory - you "gave" it to the allocator, AND you kept it for yourself in `ram_slice`
<JamesMunns[m]> having it is UB, reading from it (esp if it was not initialized) is UB, writing to it is SUPER UB and is probably corrupting the state of the whole allocator.
<michaeldesilva[m> JamesMunns[m]: got it, now...
<JamesMunns[m]> yes, but you shouldn't make ram_slice at all in the first place.
<JamesMunns[m]> like, take the ptr, give it to mem::ALLOCATOR, then forget it exists.
linfax has joined #rust-embedded
<michaeldesilva[m> I was earlier trying to get `defmt` to output details for a HardFault https://github.com/bsodmike/arduino-giga-r1-wifi-stm32h747xi-async-quickstart/blob/master/src/main.rs#L296-L301
<michaeldesilva[m> I'm not sure though if this is embassy compatible?
<JamesMunns[m]> afaik embassy doesn't make any claims on any exception handlers
Rahix has quit [Ping timeout: 255 seconds]
sknebel has quit [Remote host closed the connection]
hmw has quit [Ping timeout: 260 seconds]
Rahix has joined #rust-embedded
sknebel has joined #rust-embedded
hmw has joined #rust-embedded
<michaeldesilva[m> <JamesMunns[m]> "afaik embassy doesn't make any..." <- Thanks for all your help. I’ll check tomorrow and rvt. Good night!
Rahix has quit [Ping timeout: 272 seconds]
korken89[m] has quit [Quit: Idle timeout reached: 172800s]
hmw has quit [Ping timeout: 272 seconds]
hmw has joined #rust-embedded
Rahix has joined #rust-embedded
xiugaze[m] has joined #rust-embedded
<xiugaze[m]> hey all, just copying this from the Embassy room, but I'm trying to interact with an ADC from an embassy task. As like a super basic example, this is what I'm trying to do:... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/yBlViJBphnGXUaHwobuozqLK>)
<xiugaze[m]> That's the trait bound, I see it in the docs too but no obvious way to coerce
<xiugaze[m]> I also tried using AdcPin as the parameter but that requires all these weird generics and where clauses, and those aren't allowed in task signatures anyway
marmrt[m] has joined #rust-embedded
<marmrt[m]> I haven't actually used Embassy, so I might not know what I'm talking about, but I think the problem is that degrade() creates a generic pin which does not support ADC
<marmrt[m]> You're basically trying to tell the HAL not to worry about which pin you\r're using, while the HAL wants to make sure you're using a pin with ADC functionality
<xiugaze[m]> That's true, but in that case, what type is the pin supposed to be in the function signature?
<marmrt[m]> PA0.into() might work, but again, I haven't looked at this hal
<marmrt[m]> or just PA0
<marmrt[m]> s/\r//
<xiugaze[m]> [here](https://docs.embassy.dev/embassy-stm32/git/stm32h723zg/adc/trait.AdcPin.html)'s the docs for `AdcPin` for my board.
<xiugaze[m]> I think the generic argument would be `AdcPin<ADC1>` but that's asking for trait objects which I don't think is what I want
SunClonus has joined #rust-embedded
<xiugaze[m]> Yeah, tried that too but generics and where clauses aren't allowed
SunClonusX has joined #rust-embedded
SunClonus has quit [Ping timeout: 246 seconds]
<AdamHott[m]> <adamgreig[m]> "I've made this room actually, so..." <- Just sent you a DM on this one
linfax has quit [Ping timeout: 260 seconds]
KennethKnudsen[m has quit [Quit: Idle timeout reached: 172800s]
AdinAck[m] has joined #rust-embedded
<AdinAck[m]> <xiugaze[m]> "image.png" <- what you can do is make your generic functions not a task, then make a task that runs your generic function as many times you want with as many pins you want
<AdinAck[m]> to provide resources to the task, i recommend https://github.com/adamgreig/assign-resources
Guest7282 has left #rust-embedded [Error from remote client]
Guest7282 has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
IlPalazzo-ojiisa has quit [Client Quit]
IlPalazzo-ojiisa has joined #rust-embedded
<MathiasKoch[m]> Anyone strong in TLS, rustls or similar who would like to review my PR on `embedded-tls`, and might help provide some insights on why my `CertificateVerify` step is giving me `BadSignature`, see description here: https://github.com/drogue-iot/embedded-tls/pull/135#issuecomment-1944380767
<MathiasKoch[m]> Anything is extremely welcomed, as I have now spend an entire day trying to compare with the rustls implementation in the rustcrypto provider
WSalmon has quit [Remote host closed the connection]
WSalmon has joined #rust-embedded
<MathiasKoch[m]> <MathiasKoch[m]> "Anyone strong in TLS, rustls..." <- Finally found it!
<MathiasKoch[m]> Client Certificate Authentication with x.509 certificates and private key is now working in `embedded-tls` 🎉
K900 has quit [Quit: Idle timeout reached: 172800s]
Averyshethey[m] has quit [Quit: Idle timeout reached: 172800s]
lulf[m] has joined #rust-embedded
<lulf[m]> <MathiasKoch[m]> "Finally found it!..." <- Awesome MathiasKoch !!!
<lulf[m]> lulf[m]: I'll try to get the review done tomorrow
<MathiasKoch[m]> lulf[m]: Yeah, no hurry. I'll just continue my embassy-net endeavours with a patched embedded-tls 👍️
<MathiasKoch[m]> s/hurry/rushurry/
<MathiasKoch[m]> s/hurry/rush/
<MathiasKoch[m]> MathiasKoch[m]: I still think some of the ergonomics around the `TlsVerifier` and this new `CryptoProvider` could be improved a bit, but I might look into that in a different PR, when I reach the point where I want to implement this on top of my ATECC crypto module
<MathiasKoch[m]> * crypto module for seure certificate & key storage
<MathiasKoch[m]> * crypto module for secure certificate & key storage
<MathiasKoch[m]> * a bit (more or less touched upon in https://github.com/drogue-iot/embedded-tls/issues/13), but, * crypto module for secure certificate & key storage
SunClonusX has quit [Read error: Connection reset by peer]
SunClonus has joined #rust-embedded
SunClonus has quit [Quit: Leaving]
SunClonus has joined #rust-embedded
IlPalazzo-ojiisa has quit [Read error: Connection reset by peer]
IlPalazzo-ojiisa has joined #rust-embedded
IlPalazzo-ojiisa has quit [Read error: Connection reset by peer]
IlPalazzo-ojiisa has joined #rust-embedded
M0175[m] has quit [Quit: Idle timeout reached: 172800s]
SunClonusX has joined #rust-embedded
SunClonusX has quit [Remote host closed the connection]
SunClonusX has joined #rust-embedded
SunClonus has quit [Ping timeout: 246 seconds]
SunClonusX has quit [Remote host closed the connection]
IlPalazzo-ojiisa has quit [Quit: Leaving.]
IlPalazzo-ojiis1 has joined #rust-embedded
SunClonus has joined #rust-embedded
IlPalazzo-ojiis1 has quit [Ping timeout: 264 seconds]