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
explore has quit [Quit: Connection closed for inactivity]
<re_irc> <almindor> does anyone know if there's a way to tell gdb to "shorten" the ludicrously long fulltype names when viewing things in "layout asm" mode?
<re_irc> <9names (@9names:matrix.org)> answering my own question: http_io (https://crates.io/crates/http_io/) seems like a good candidate. there's someone already using it with core2 (https://crates.io/crates/core2), shouldn't be hard to move it to embedded-io (https://crates.io/crates/embedded-io)
crabbedhaloablut has quit [Write error: Broken pipe]
crabbedhaloablut has joined #rust-embedded
<re_irc> <sis3020> Come try the top mmorpg https://splog.win/ wyrmob experiment now
explore has joined #rust-embedded
Foxyloxy has quit [Ping timeout: 245 seconds]
Foxyloxy has joined #rust-embedded
crabbedhaloablut has quit [Ping timeout: 268 seconds]
crabbedhaloablut has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
rardiol has quit [Ping timeout: 252 seconds]
explore has quit [Quit: Connection closed for inactivity]
<re_irc> <762spr> Still having trouble with cargo and the stm32l4xx-hal package...
<re_irc> I downloaded it and changed the dependency for stm32l4 to version 0.15.1, then in my original project's cargo.toml I updated it to point to the new path of my local version:
<re_irc> [dependencies.stm32l4xx-hal]
<re_irc> version = "0.7.1"
<re_irc> <burrbull> You can use 'cargo tree' to see all dependency tree
causal has quit [Quit: WeeChat 3.5]
<re_irc> <762spr> should I do that on the HAL library or on my main project?
<re_irc> <762spr> esc_tester v0.1.0 (C:\Users...\Documents\VSCode_workspace\STM32\ESC_Tester)
<re_irc> ├── cortex-m v0.7.5
<re_irc> │ │ [build-dependencies]
<re_irc> │ ├── bare-metal v0.2.5
<re_irc> <762spr> it doesn't seem to be linking it to the PAC but maybe I am misunderstanding how it is supposed to work?
<re_irc> <762spr> oh nevermind, I missed that it was below it.
<re_irc> <762spr> still not really sure why it isn't integrating and thinks it is redefining everything though
<re_irc> <firefrommoonlight> Don't add PAC as a dependency. Use the HAL's re-export
<re_irc> <762spr> 😮 I thought it could figure that out on it's own! OK, that makes sense, but now it complains that I don't have the features selected ["stm32l4x2", "rt"]
<re_irc> Is there a way to pass that on through the main project or should that be added to the HAL library?
<re_irc> <762spr> I put it in the HAL's cargo.toml and re compiled my project. Same result. 463 re-defines...
<re_irc> <762spr> ok I must have something seriously wrong with my setup somehow... if I try to just build the library, I get the same 463 re-define errors, so I tried building it with version 0.14.0 of the PAC which is the default one, it STILL gives me the same errors!
<re_irc> <firefrommoonlight> Post your cargo.toml deps section
<re_irc> <jspngh> You should have something like this in your project
<re_irc> path = "/path/to/stm32l4xx-hal"
<re_irc> features = ["stm32l476", "rt"]
<re_irc> [dependencies.stm32l4xx-hal]
<re_irc> <jspngh> and in your local stm32l4xx-hal copy, you only need to change the version of the "stm32l4" dependency.
<re_irc> <jspngh> Like firefrommoonlight is saying, don't put the stm32l4 dependency in your project
<re_irc> <762spr> ok let me try that real quick. I think I tried it before and it didn't like setting the features that way but I am not sure
<re_irc> <jspngh> You will have to fix some small things in the HAL though, since it's not ready for the 0.15 PAC yet
<re_irc> <762spr> error: failed to select a version for "stm32l4xx-hal".
<re_irc> ... required by package "esc_tester v0.1.0 (C:\Users\Matt\Documents\VSCode_workspace\STM32\ESC_Tester)"
<re_irc> versions that meet the requirements "^0.7.1" (locked to 0.7.1) are: 0.7.1
<re_irc> the package "esc_tester" depends on "stm32l4xx-hal", with features: "stm32l4x2" but "stm32l4xx-hal" does not have these features.
<re_irc> failed to select a version for "stm32l4xx-hal" which could resolve this conflict
<re_irc> <762spr> yeah I may just have to give up on the HAL for now I think this is over my head :/
<re_irc> <762spr> it doesn't seem to like selecting features through the HAL crate
<re_irc> <762spr> [dependencies.stm32l4xx-hal]
<re_irc> features = ["stm32l4x2", "rt"]
<re_irc> path = "../stm32l4xx-hal"
<re_irc> version = "0.7.1"
<re_irc> <jspngh> The problem is that the available features have been changed in the master branch, but not yet in the last release on crates.io
<re_irc> So the feature that would have worked if you used the crates.io package, won't work anymore when you are using the master branch on your local copy
<re_irc> <jspngh> In the Cargo.toml file you can see the available features: https://github.com/stm32-rs/stm32l4xx-hal/blob/master/Cargo.toml
<re_irc> <jspngh> You will see that L4x2 has been split up
<re_irc> stm32l432 = [ "stm32l4/stm32l4x2" ]
<re_irc> # L4x2
<re_irc> stm32l442 = [ "stm32l4/stm32l4x2" ]
<re_irc> <jspngh> You will see that L4x2 has been split up
<re_irc> stm32l442 = [ "stm32l4/stm32l4x2" ]
<re_irc> # L4x2
<re_irc> stm32l432 = [ "stm32l4/stm32l4x2" ]
<re_irc> <762spr> oh yeah I was wondering about that. I tried setting it to l432 because that's what I'm running but it errored out. makes sense now that you mention they don't match
<re_irc> <jspngh> If you use this
<re_irc> [dependencies.stm32l4xx-hal]
<re_irc> Do you still get an error?
<re_irc> features = ["stm32l432", "rt"]
<re_irc> path = "../stm32l4xx-hal"
<re_irc> <jspngh> So, leaving out the version + using "stm32l432"
<re_irc> <762spr> well, it's down to 22 errors 😅
<re_irc> <762spr> they are all of similar nature to:
<re_irc> error[E0615]: attempted to take value of method "ccr1" on type "stm32l4::stm32l4x2::tim1::RegisterBlock"
<re_irc> |
<re_irc> --> C:\Users...\Documents\VSCode_workspace\STM32\stm32l4xx-hal\src\pwm.rs:225:48
<re_irc> <jspngh> Yes, those are the differences between 0.14 and 0.15 that need to be fixed
<re_irc> <jspngh> You can send me a private message if you need help
<re_irc> <762spr> ah.
<re_irc> <762spr> well the compiler seems to be giving reasonable suggestions, I guess I could take a crack at fixing them on my local copy. If not I guess I will just wait for the smart people to get to it 😂
<re_irc> <762spr> Actually that was really easy! most of the 22 errors were duplicates and I only had to change the code in like 5 spots! It seems to be working now. Thank you so much for all your help and for all your work on making these crates! Obviously I could never do this on my own so you make it possible for guys like me to make stuff!
<re_irc> <762spr> and for putting up with all of my super noob questions! 😂
starblue has joined #rust-embedded
cr1901_ has joined #rust-embedded
cr1901 has quit [Ping timeout: 244 seconds]
<re_irc> <David Rheinsberg> Hey! We have recently starting looking for a home for UEFI development in rust. We are working on getting the UEFI rustc targets at Tier-2 and try to setup centralized documentation and ecosystem information. We were wondering whether rust-embedded would serve as a suitable home, and whether you are open to have us as a team? We are in contact with people across different companies, including Red Hat, Google,...
<re_irc> ... Microsoft, and Intel, trying to better centralize the UEFI efforts in Rust. I can gladly open an issue in the wg-repository instead, but just wanted to get some general comments here first.
<re_irc> <David Rheinsberg> Note that it is not a perfect fit for "embedded" development, but I personally think the overlap is big enough, given the challenges we face with UEFI platforms.
seer has quit [Ping timeout: 268 seconds]
seer has joined #rust-embedded
Foxyloxy has quit [Quit: Textual IRC Client: www.textualapp.com]
Foxyloxy has joined #rust-embedded
starblue has quit [Ping timeout: 244 seconds]
starblue has joined #rust-embedded
<re_irc> <firefrommoonlight> jspngh: Btw, the reason for this is that the L412 uses a different (newer) RTC than the others
<re_irc> <firefrommoonlight> I had a fun surprise when swapping between 2 diff 4x2 chips wherein my RTC stopped working
<re_irc> <firefrommoonlight> * L4x2
crabbedhaloablut has quit [Remote host closed the connection]
<re_irc> <adamgreig> David Rheinsberg: an issue on the wg tracker is probably a good idea, I agree you probably face very similar challenges (I guess maybe it's "also bare-metal" instead of "also embedded"?) and we could certainly have a new team, or maybe it would end up making more sense to have a new working group
<re_irc> <chemicstry> David Rheinsberg: I think the main problem is that UEFI development is focused on application processors such as Cortex-A or x86, which is not really common in embedded-rust ecosystem. There are just a few crates for cortex-a, used mainly for raspberry pi bare-metal experiments. Usually how it works with "embedded-rust" is that crates start as separate projects and if/when they become popular enough, they get moved...
<re_irc> ... to "embedded-rust" so it could be maintained even if the main author is gone. The question is how much code can be shared so that both parties (UEFI and embedded-rust) have interest in co-maintaining
starblue has quit [Ping timeout: 245 seconds]
crabbedhaloablut has joined #rust-embedded
smach has joined #rust-embedded
starblue has joined #rust-embedded
<re_irc> <David Rheinsberg> chemicstry: Cortex-A and RISCV would be two excellent examples of target architectures for UEFI which rust-embedded is also interested in. The UEFI PEI-stage could share the same board-setup crates even. But I am not so much looking for a home for UEFI crates, but rather a home to discuss work on rustc (e.g., curating the uefi targets, working on porting core/std) and documenting the status quo.
smach has quit [Quit: Leaving]
rardiol has joined #rust-embedded
starblue has quit [Ping timeout: 245 seconds]
starblue has joined #rust-embedded
starblue has quit [Ping timeout: 252 seconds]
Guest14 has joined #rust-embedded
Guest14 is now known as brazuca
starblue has joined #rust-embedded
brazuca has quit [Quit: Client closed]
Guest1479 has joined #rust-embedded
Guest1479 is now known as brazuca
gsalazar has joined #rust-embedded
dc740 has joined #rust-embedded
rardiol has quit [Ping timeout: 245 seconds]
cr1901_ is now known as cr1901
brazuca has quit [Quit: Client closed]
Guest1411 has joined #rust-embedded
Guest1411 is now known as brazuca
brazuca has quit [Quit: Client closed]
Guest1466 has joined #rust-embedded
Guest1466 is now known as brazuca
gsalazar has quit [Read error: Connection reset by peer]
gsalazar has joined #rust-embedded
crabbedhaloablut has quit [Remote host closed the connection]
crabbedhaloablut has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
brazuca has quit [Quit: Client closed]
Guest1448 has joined #rust-embedded
Guest1448 is now known as brazuca
<re_irc> <James Munns> If any of y'all want a fun mnemOS PR: smash together adamgreig's LEDC code, and make a driver service for it (the UART send DMA is a good example for this, and add it to the demo env :D
<re_irc> <James Munns> Wrong room 😅, but having fun with the Allwinner D1 :D
<re_irc> <dirbaio> nerdsnipe-driven development, hmmm? :D
<re_irc> <James Munns> Yeah, pretty much!
<re_irc> <James Munns> "let everyone else do the fun PRs"
gsalazar has quit [Ping timeout: 268 seconds]
brazuca has quit [Quit: Client closed]
Guest1492 has joined #rust-embedded
Guest1492 is now known as brazuca
starblue has quit [Ping timeout: 245 seconds]
rardiol has joined #rust-embedded
rardiol has quit [Quit: https://quassel-irc.org - Chat comfortably. Anywhere.]
richardeoin has quit [Ping timeout: 268 seconds]
richardeoin has joined #rust-embedded
<re_irc> <thalesfragoso> Did someone already mentioned here that &UnsafeCell isn't dereferenciable anymore ?
<re_irc> <thalesfragoso> &mut UnsafeCell still is though, but I think the only way to get a &mut to a RegBlock is through the raw ptr, right ?
<re_irc> <thalesfragoso> CC adamgreig for svd2rust insight
<re_irc> <dirbaio> how can you match all cortex-m using cfgs?
dc740 has joined #rust-embedded
<re_irc> <dirbaio> ilke "cfg(target_arch = "arm")" but matching only cortex-m arms
<re_irc> <dirbaio> you can't match entire targets, like "cfg(target = "thumbv7em-none-eabi")"?
<re_irc> <dirbaio> I know there's the "build.rs" trick, but I need this in a proc-macro
<re_irc> <dirbaio> alternatively, is there a way to get the target from a proc macro?
<re_irc> <mabez> dirbaio: AFAIK, its not possible but I hope someone has a solution. I had to use features on the proc macro crate which were enabled by another crate: https://github.com/esp-rs/esp-hal/blob/224e84d9dcbf286431375b62cc2ec1b0a47272d8/esp-hal-procmacros/src/lib.rs#L217-L225
<re_irc> <dirbaio> yeah that's sort of what I have now, would like to remove it D:
<re_irc> <mabez> also I have no idea what I'm doing with proc macros, just bumbling along until something works :D
<re_irc> <dirbaio> same here lol
<re_irc> <dirbaio> currently it assumes cortex-m (if features "std" and "wasm" aren't enabled)
<re_irc> <dirbaio> but I'd like it to emit "#[cortex_m_rt::entry]" or "#[riscv_rt::entry]" or "#[xtensa_lx_rt::entry]"or nothing (for std) automatically...
<re_irc> <mabez> What about if you added the "cfg_attr" in your proc macro? and let the compiler do the work for you. e.g
<re_irc> quote! {
<re_irc> #[cfg_attr(target_arch = "arm", cortex_m_rt::entry]
<re_irc> #[cfg_attr(target_arch = "xtensa", xtensa_lx_rt::entry]
<re_irc> <dirbaio> that would add "#[cortex_m_rt::entry]" for non-embedded ARM though
<re_irc> <mabez> Then the proc macro doesn't need to know the arch, because the compiler will resolve it once the code is emitted?
<re_irc> <mabez> Ah I see, arm is the tricky one
<re_irc> <dirbaio> raspi linux, or macos m1/m2
<re_irc> <dirbaio> perhaps with target_os 🤔
<re_irc> <dirbaio> that'd also fail for riscv32 linux (not that it's very common..)
<re_irc> <dirbaio> "#[cfg_attr(all(target_arch = "riscv32", not(unix), not(windows)), riscv_rt::entry]" 🤪
<re_irc> <dirbaio> (is macos "unix"?)
<re_irc> <mabez> Yeah "target_os = "none"" along with the arch _should_ filter out everthing right?
<re_irc> <dirbaio> ah "none" is a thing?
<re_irc> <mabez> indeed!
<re_irc> <dirbaio> oooh :D
dc740 has quit [Remote host closed the connection]
<re_irc> <almindor> does anyone know how something like https://www.klgrth.io/paste/tve5y could produce this racing pin output?
<re_irc> <almindor> somehow the DC pin is set in the middle of the SPI transfer. In this capture I used the "displayinterface" abstraction and the DC is set smack in the middle of the 2 command bytes. When I used raw SPI like in the code, it's set even sooner, before the 1st byte is even done transmitting
<re_irc> <9names (@9names:matrix.org)> maybe the spi write returns once all data is in a fifo, not when all data has finished transmitting?
<re_irc> <almindor> we're doing a manual loop over each byte tho, it's a 32bit register with 8bit data field for the data, so when we're doing this spi.write it translates( in software) into loop of reg_write(u8)
<re_irc> <almindor> i guess if the register write returns before the data is actually output, we could race it here, issue is, I don't see how to check that anywhere in the spec (e310/hifive board), there's just the "full" bit AFAICS
<re_irc> <almindor> maybe we need to wait for "full" to be 0 before returning from the byte push itself
<re_irc> <9names (@9names:matrix.org)> a bit surprising that they don't have a fifo empty flag.
<re_irc> maybe you could set the transmit watermark to 1, then check the interrupt pending register to see if txwm is set.
<re_irc> <almindor> hmm good point I didn't think about using that
<re_irc> <almindor> this is so odd, doing while "spi.ip.read().txwm().bit_is_clear()" (with txmark being 1) delays the DC set to high smack in the middle of the 2nd byte transfer
<re_irc> <almindor> * "while spi.ip.read().txwm().bit_is_clear() {}"
<re_irc> <almindor> inserting an artificial delay after each transfer is done (say reading a csr couple times) make it "work"
<re_irc> <James Munns> mabez: I used this to notch out my panic handler when I'm building with "--all-features"
emerent has quit [Ping timeout: 272 seconds]
emerent has joined #rust-embedded
loki_val has joined #rust-embedded
crabbedhaloablut has quit [Ping timeout: 268 seconds]