22 Apr 2024 |
James Munns | * yeah, as Ryan said, only down to the port level, so like DynamicPin<PORTA> or whatever, which means you can't putPA4, PB6, PC0 in an array. | 14:34:28 |
ryan-summers | There are probably some negligible performance impacts, but likely nothing you'd notice | 14:35:46 |
James Munns | Ah! I missed that! sorry! | 14:35:40 |
jo_we | In reply to @ryan-summers:matrix.org There are probably some negligible performance impacts, but likely nothing you'd notice can definitely work with that! | 14:37:12 |
burrbull | Not sure I understood what you want. Maybe this?
let ar = [pa0.into_push_pull_output().erase(), pb1.into_push_pull_output().erase()] | 14:41:57 |
jo_we | yes, for sure. I now have an array of erased output pins. I just have to scrap the idea of contraining it to hardware intended nss pins, but thats not toooooo bad | 14:42:49 |
jo_we | managed to implement it this way! thanks again for tolerating me being "difficult" xD | 14:55:17 |
burrbull | In reply to @jo_we:matrix.org yes, for sure. I now have an array of erased output pins. I just have to scrap the idea of contraining it to hardware intended nss pins, but thats not toooooo bad as has been already said, you can make enum of possible types and implement OutputPin for this enum | 15:00:30 |
jo_we | ill look into this as well
| 15:01:55 |
23 Apr 2024 |
| esm3 joined the room. | 22:50:47 |
24 Apr 2024 |
bibble235 | Hi folks, I am really new and have a really stupid question. I only seem to be able to run my code with a debugger. If I flash a release version it runs connected to the STlink but use a plain USB on my scope no joy. | 09:36:27 |
James Munns | What panic and logging crate are you using? I think the old semi hosting crates would hang with no debugger attached | 10:05:38 |
bibble235 | In reply to @jamesmunns:beeper.com What panic and logging crate are you using? I think the old semi hosting crates would hang with no debugger attached https://github.com/antoinevg/stm32f3-rust-examples/blob/master/Cargo.toml | 10:27:40 |
bibble235 | panic-itm = "0.4.0" | 10:28:01 |
bibble235 | use cortex_m::{iprintln, interrupt::Mutex}; | 10:29:58 |
James Munns | yeah, I wonder if that iprintln is causing problems, looking now | 10:30:10 |
James Munns | https://github.com/rust-embedded/cortex-m/blob/master/cortex-m/src/itm.rs#L13 | 10:30:29 |
James Munns | yeah, probably, if the ITM fifo fills up it'll hang | 10:30:40 |
bibble235 | Assuming this is semihosting of some sort | 10:30:54 |
James Munns | ITM is sort of like semihosting, but the failure is likely the same. If you comment out all the iprintln lines does it start working? | 10:31:23 |
bibble235 | Just restarting on rust and getting up to speed | 10:31:27 |
James Munns | (those examples are all also 5 years old, and might be out of date). | 10:32:01 |
James Munns | you can also try https://github.com/embassy-rs/embassy/tree/main/examples/stm32f3, if you'd like | 10:32:20 |
James Munns | Those use defmt-rtt , which won't hang if there is no debugger attached. | 10:32:35 |
bibble235 | Thanks, I wanted somewhere to start from which worked before changing, updating. Any idea why it might hang, never worked, change in toolchain underneath code. Do people start with blink and work backwards. | 11:56:29 |
James Munns |
Any idea why it might hang
Because ITM is blocking on sending, but it can't send because there is no debugger attached (at least that's what I'm guessing).
| 12:46:11 |
25 Apr 2024 |
bibble235 | In reply to @jamesmunns:beeper.com
Any idea why it might hang
Because ITM is blocking on sending, but it can't send because there is no debugger attached (at least that's what I'm guessing).
All working now with [dependencies] cortex-m = "0.7.7" cortex-m-rt = "0.7.4"
stm32f3xx-hal = { version = "0.10.0", features = ["rt", "stm32f303xc"] } lazy_static = { version = "1.3.0", features = ["spin_no_std"] } panic-probe = { version = "0.3.1", features = ["defmt"] }
atomic = "0.6.0"
| 01:41:09 |
| Tim set a profile picture. | 12:12:54 |
| Tim changed their profile picture. | 12:13:11 |
| Tim changed their profile picture. | 12:13:53 |