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
flippette[m] has quit [Quit: Idle timeout reached: 172800s]
anton_star has joined #rust-embedded
anton_star has quit [Quit: Client closed]
sroemer has joined #rust-embedded
starblue has quit [Ping timeout: 252 seconds]
emerent has quit [Ping timeout: 248 seconds]
starblue has joined #rust-embedded
emerent has joined #rust-embedded
anton_star has joined #rust-embedded
anton_star has quit [Client Quit]
anon143 has joined #rust-embedded
barafael[m] has quit [Quit: Idle timeout reached: 172800s]
anon143 has quit [Ping timeout: 255 seconds]
loki_val has quit [Ping timeout: 248 seconds]
crabbedhaloablut has joined #rust-embedded
anton_star has joined #rust-embedded
anton_star has quit [Ping timeout: 256 seconds]
Makarov9 has joined #rust-embedded
igiona[m] has joined #rust-embedded
<igiona[m]> In embassy-nrf, iIs anything one has to do other than
sroemer has quit [Ping timeout: 260 seconds]
<igiona[m]> * In embassy-nrf, is there anything one has to do other than enabling the feature nfc-pins-as-gpio in order to use the NFC pads as Gpio?
<igiona[m]> Somehow it's seem snot to be enough :/
<igiona[m]> * ~In embassy-nrf, is there anything one has to do other than enabling the feature nfc-pins-as-gpio in order to use the NFC pads as Gpio?
<igiona[m]> Somehow it's seem snot to be enough :/ ~
<igiona[m]> Errata, the DK connects the pins to the NFC connector as default. The feature is indeed enough ;)
Makarov9 has quit [Ping timeout: 256 seconds]
<igiona[m]> * ~In embassy-nrf, is there anything one has to do other than enabling the feature nfc-pins-as-gpio in order to use the NFC pads as Gpio?... (full message at <https://catircservices.org/_irc/v1/media/download/AawewqOmNV2WyqX55NgLQbjPo3sEBE_tYfrF10sm0-G3Pe2JmyN2xf_0QwMmjqLDNdz--owlh139wdaCknkkFBq_8AAAAAAAAGNhdGlyY3NlcnZpY2VzLm9yZy9STkNjQ1Z4TVBkdFVMZ3FRdGJUV1Jham4>)
thejpster[m] has joined #rust-embedded
Makarov9 has joined #rust-embedded
Makarov9 has quit [Ping timeout: 256 seconds]
<igiona[m]> * <del>In embassy-nrf, is there anything one has to do other than enabling the feature nfc-pins-as-gpio in order to use the NFC pads as Gpio?... (full message at <https://catircservices.org/_irc/v1/media/download/AaliGSfFOUiC5XzkGnkZIEDPPpAVmipYJA5KwDKABDM4pY7gSRaAvWBMX1zUZwofZrOtcuda4j-I4EUCgUQZM26_8AAAAAAAAGNhdGlyY3NlcnZpY2VzLm9yZy9wWnlnVWFibmhzcGdXa3pMY2lZTUVybko>)
<igiona[m]> s/max_duty/max\_duty/, s/is/it's/, s/month/months/
<igiona[m]> * Did anybody encountered issues with the SimplePwm duty cycle on nrf devices?
<igiona[m]> I'm puzzled 'cause on my nrf5340, when I set the duty to 0, the GPIO is high, and when I set to max_duty() it's low.
<igiona[m]> I'm not sure if I'm too tired already, or it's actually a bug to be reported :D
<igiona[m]> I tested both, embassy-nrf main and 0.2.0
<igiona[m]> I'm pretty sure on my nrf53833 did work just fine a couple of months ago.
Makarov9 has joined #rust-embedded
Makarov44 has joined #rust-embedded
Makarov9 has quit [Ping timeout: 256 seconds]
Makarov44 has quit [Ping timeout: 256 seconds]
starblue has quit [Ping timeout: 272 seconds]
starblue has joined #rust-embedded
birdistheword99[ has joined #rust-embedded
<birdistheword99[> Hi guys, I'm looking to write a library that I can use on my embedded device, that describes the layout of my settings in eeprom, and in a PC application that will read and write those settings. I am tripping up on the... (full message at
<dirbaio[m]> Are you transmuting rust structs to bytes and writing them to eeprom?
<birdistheword99[> Yes, I'm annotating them with [#repr(c)] and writing them as bytes into eeprom
<dirbaio[m]> Heapless string itself is not repr(C)
<dirbaio[m]> So you can't do that
<dirbaio[m]> The layout is unstable. A future rustc version might decide to place the length at the end instead of st the start, for example
<birdistheword99[> Ah Ok thats good to know, why does the compiler not warn that items in a struct annotated with #[repr(C)]' are not all #[repr(C)]' ? Is there an additional clippy lint that needs to be turned on perhaps?
<dirbaio[m]> That's a very good q, I don't know. Maybe it should warn
<birdistheword99[> * Ah Ok thats good to know, why does the compiler not warn that items in a struct annotated with #[repr(C)] are not all #[repr(C)] ? Is there an additional clippy lint that needs to be turned on perhaps?
<dirbaio[m]> Anyway
<dirbaio[m]> The solution is you need to make your own string struct
<dirbaio[m]> {len: u32, chars: [u8; 32]}
<dirbaio[m]> And make it repr(C)
<dirbaio[m]> You can even omit the length and assume the string is padded with null bytes, that'd save some space in eeprom.
<dirbaio[m]> And Since you're making the structs yourself you can use u32 to avoid the usize issue
<birdistheword99[> Ah ok, that makes sense, thanks :)
<birdistheword99[> Does heapless String have a method to convert from raw bytes back to String?
sroemer has joined #rust-embedded
sroemer has quit [Changing host]
sroemer has joined #rust-embedded
anon143 has joined #rust-embedded
Lumpio[m] has quit [Quit: Idle timeout reached: 172800s]
ryan-summers[m] has quit [Quit: Idle timeout reached: 172800s]
TomB[m] has quit [Quit: Idle timeout reached: 172800s]
sroemer has quit [Ping timeout: 252 seconds]
scorpion2185[m] has quit [Quit: Idle timeout reached: 172800s]
HumanG33k has quit [Ping timeout: 276 seconds]
HumanG33k has joined #rust-embedded
<cr1901> Is there any precedent for optionally auto-generating memory.x for applications (so ppl who don't know the offhand can get started more quickly)?
<JamesMunns[m]> I think embassy provides it by default? or the nrf-hal crates used to automatically provide it (maybe behind a feature?)
Lumpio[m] has joined #rust-embedded
<Lumpio[m]> Double from_ is a bit cumbersome, maybe time for a PR to heapless? 🙂
<cr1901> Why would embassy need to provide memory.x? Is it a convenience, or are apps expected to use a different memory region allocation?
<JamesMunns[m]> sorry, "embassy hals"
<cr1901> Ahhh. And yes, nrf-hal does it.
<dirbaio[m]> embassy does it for rp, stm32 but not nrf
<dirbaio[m]> PRs welcome
<cr1901> I was looking for ideas for msp430 :P
<dirbaio[m]> it's a convenience
<dirbaio[m]> * a convenience yep
<dirbaio[m]> it's best if hte HAL allows disabling it in case you need a custom memory map
<cr1901> How does embassy hals disable it, enabled-by-default feature?
<dirbaio[m]> Cargo feature memory-x
<dirbaio[m]> it's not enabled by default, you have to enable it
<dirbaio[m]> but the examples enable it, and that's what most people copypaste from
bartmassey[m] has quit [Quit: Idle timeout reached: 172800s]
jannic[m] has quit [Quit: Idle timeout reached: 172800s]
tamme[m] has quit [Quit: Idle timeout reached: 172800s]
adamgreig[m] has quit [Quit: Idle timeout reached: 172800s]
therealprof[m] has quit [Quit: Idle timeout reached: 172800s]
Jubilee[m] has joined #rust-embedded
<Jubilee[m]> hey everyone, can someone show me a non-simple example of them using linker scripts to position "marker statics" in the binary? ...and by non-simple I do actually mean the weirder, the better, actually, though I might have some followup questions.