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
GenTooMan has joined #rust-embedded
<adamgreig[m]> Mebus: there's an example here you can copy: https://github.com/stm32-rs/stm32h7xx-hal/blob/master/memory.x
M9names[m] has joined #rust-embedded
<M9names[m]> <thejpster[m]1> "Has anyone shipped a RISC-V..." <- Boufallo lab Bl602/bl702 are sifive e2 cores, they have CLIC
<adamgreig[m]> the stm32h7 is quite a complicated chip, so it has a lot of different RAMs you can use for different things, but if you're just starting out that should work fine
cy6erlion has joined #rust-embedded
<Mebus[m]> ah, yeah thanks. This happens to be exactly the same file I am already using.
<M9names[m]> M9names[m]: The microcontroller cores in bl616/bl808 are t-head e907, which also implement CLIC
<Mebus[m]> I am using this example:
<Mebus[m]> in the beginning the LEDs were blinking on the board according to the blinky program, but now they don't - but i didn't change anything.
<Mebus[m]> any ideas?
<adamgreig[m]> when did they stop? does it help to power-cycle the board?
<adamgreig[m]> does it still program OK?
<Mebus[m]> they actually stopped after I unplugged the board
<Mebus[m]> that's what I get. so it seems that it starts, but no led blinking
<adamgreig[m]> any difference if you cargo run --bin blinky --release?
<adamgreig[m]> (added --release)
<adamgreig[m]> oh, it seems like you're running a program for an stm32h743, but your board is an stm32h745?
<Mebus[m]> yes, I don't know where to change that.
<Mebus[m]> no, --release does not help
<Mebus[m]> it's a STM32H745ZIT6
<adamgreig[m]> are you sure the first time they blinked it wasn't just whatever code was on there before?
<Mebus[m]> I changed the type of blinking, so it should have worked
<Mebus[m]> how can I set probe-run to the correct chip?
<adamgreig[m]> for a -Q nucleo board you also need to set up the power supply correctly, it uses the SMPS controller built-in to the stm32
<adamgreig[m]> try  let pwrcfg = pwr.smps().freeze();
<adamgreig[m]> I think in Cargo.toml you want the stm32h7xx-hal feature set to stm32h747cm7
<adamgreig[m]> whereas in config.toml you want --chip STM32H745ZITx
<adamgreig[m]> I think those three changes hopefully will be enough, so give them a try first, but it looks like https://github.com/antoinevg/nucleo-h7xx directly supports your nucleo board so might also be worth a look
<Mebus[m]> I geht this error: https://hastebin.com/share/lohofutebu.bash something seems to be wrong with the power settings
<adamgreig[m]> have you tried power cycling it since programming that?
<Mebus[m]> no, one second
<adamgreig[m]> ie remove all the cables so it totally turns off, then plug in again
<Mebus[m]> Hey, the LED blinks 😃😃😃
<adamgreig[m]> nice!
<Mebus[m]> Thanks a lot!
<adamgreig[m]> this is a weird "feature" of some of the stm32h7 chips, the power config is write-once until you remove power, even through a reset/reprogram
<adamgreig[m]> and if you write it wrong, it fails to boot
<adamgreig[m]> and it has to be set to the right thing for your particular PCB...
<Mebus[m]> are these *.svd files in the projects directory used in any way?
<Mebus[m]> or are they just there to be there?
<adamgreig[m]> however it is a really nice feature of the chip when you're designing your own PCBs, just quite annoying to get started on a nucleo board
<adamgreig[m]> not sure what they're doing there. look pretty old
<adamgreig[m]> I think it's probably to help with debugging - some debuggers can load them up
<adamgreig[m]> https://stm32-rs.github.io/stm32-rs/stm32h757_cm7.svd.patched might be more up-to-date for your chip
<Mebus[m]> Error 404 ðŸĪ”
IlPalazzo-ojiisa has quit [Remote host closed the connection]
cy6erlion has quit [Quit: Leaving.]
<Mebus[m]> I pushed my changes to here: https://github.com/Mebus/nucleo-h743zi/tree/stm32h747cm7 - maybe it helps somebody. I might clean it up a little later.
RansfordHyman[m] has joined #rust-embedded
<RansfordHyman[m]> I've noticed while looking up companies that are leveraging Rust in the embedded space are all in Europe. Is there any reason that is the case? Is there any list maintained where it is noted of companies that are leveraging Rust in the embedded space. I'm not in this space but I find it's usage with Rust interesting
M9names[m]1 has joined #rust-embedded
<M9names[m]1> maybe the companies using embedded rust in europe are more likely to publicize that fact?
<RansfordHyman[m]> <M9names[m]1> "maybe the companies using..." <- Perhaps 🙂
dc740 has joined #rust-embedded
dc740 has quit [Remote host closed the connection]
dc740 has joined #rust-embedded
Lumpio- has quit [Ping timeout: 264 seconds]
Lumpio- has joined #rust-embedded
crabbedhaloablut has joined #rust-embedded
Radu[m] has joined #rust-embedded
<Radu[m]> Hi, I want to do a mechanism like automatic door opening for college, also, I'd like to send an event to a server every time a door was opened(someone got close to that sensor) and also to be on batteries. Is it possible? Can you give me some steps to follow for this project?
<Radu[m]> Sorry because it's not exclusively rust related, I want to write the code in rust
<Mebus[m]> Probably with a ESP32 for example.
K900[m] has joined #rust-embedded
<K900[m]> I'm really curious as to why you need batteries if the door opening mechanism is right there and presumably powered somehow
K900[m] has quit [Client Quit]
K900[m] has joined #rust-embedded
K900[m] is now known as K900
K900 has quit [Client Quit]
K900 has joined #rust-embedded
<Radu[m]> K900: over engineering to make the teacher happy, also, I'm couriouse how that can be done
<K900> Exactly the same way as you would with a power supply, really
<K900> Except the power supply is a battery
<K900> Most pre-built developer boards take 5V or 3.3V both of which are easily available from, well, batteries
<K900> Also pro tip: phone power banks are surprisingly useful for prototyping in the field
<Radu[m]> thanks a lot
Foxyloxy_ has quit [Ping timeout: 260 seconds]
IlPalazzo-ojiisa has joined #rust-embedded
Foxyloxy has joined #rust-embedded
Orange_Murker[m] has joined #rust-embedded
<Orange_Murker[m]> <K900> "Also pro tip: phone power..." <- Yep. But some of them turn off while you are using them when the current draw is not high enough.
Foxyloxy has quit [Quit: Textual IRC Client: www.textualapp.com]
Foxyloxy has joined #rust-embedded
<M9names[m]> Looks sus to me.
<M9names[m]> Maybe you should write up an issue on GitHub to let the author know?
<Mebus[m]> What do you mean by "sus" ?
<M9names[m]> Sorry. Suspicious. The code and the error make me suspect there is a bug here
<Mebus[m]> Why is it using stm32h7xx-hal-0.9.0/src/ethernet/eth.rs -> there should be a new version available. can I change this somehow?
<M9names[m]> You can check who is depending on the old version using `cargo tree`.
<M9names[m]> If there's a Cargo.lock it can sometimes keep you on an old version.
GenTooMan has quit [Ping timeout: 260 seconds]
GenTooMan has joined #rust-embedded
GenTooMan has quit [Ping timeout: 246 seconds]
GenTooMan has joined #rust-embedded
emerent has quit [Ping timeout: 258 seconds]
emerent_ has joined #rust-embedded
emerent_ is now known as emerent
<dirbaio[m]1> what's the best practice for SPI chips that require a delay after asserting CS?
<dirbaio[m]1> - Driver adds a Delay operation in the transaction for each transaction (now that SpiDevice can do delays)
<dirbaio[m]1> - Treat it as "configuration" of the SpiDevice, similar to frequency: the driver doesn't insert Delay operations, instead the user is responsible for providing a properly-configured SpiDevice that will do these for all transactions
<dirbaio[m]1> * what's the best practice for SPI chips that require a delay after asserting CS?
<dirbaio[m]1> - Driver adds a Delay operation in the transaction for each transaction (now that SpiDevice can do delays)
<dirbaio[m]1> - Treat it as "configuration" of the SpiDevice, similar to frequency: the driver doesn't insert Delay operations, instead the user is responsible for providing a properly-configured SpiDevice that will do the delay for all transactions
<diondokter[m]> With the new traits I would go with the second option
<dirbaio[m]1> it'd be something like delay_before, delay_after fields in embedded-hal-bus SpiDevice impls?
<dirbaio[m]1> I dunno
<dirbaio[m]1> it feels cleaner that the driver doesn't have to insert the delay operations itself every time
<dirbaio[m]1> but on the other hand it feels redundant to have two ways of requesting delays
<diondokter[m]> How often does it happen where you have to care? Most chips are fine without delay. So I don't think the default SpiDevice implementation should implement something like it. Would be more generics again.
<diondokter[m]> Also, some hardware SPIs can do it for you iirc
<dirbaio[m]1> > Would be more generics again.
<dirbaio[m]1> not really, we already are generic on a Delay ðŸĪŠ
<dirbaio[m]1> > Most chips are fine without delay
<dirbaio[m]1> the enc28j60 needs it 😭
<diondokter[m]> > <@dirbaio:matrix.org> > Would be more generics again.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/iGefHpTqHlwaRwYnzYUYAPek>)
<dirbaio[m]1> required to support in-transaction delays
<diondokter[m]> Yeah, then some sort of config. There are three kinds of delays I guess.
<diondokter[m]> After CS assert, before CS deassert and between deassert and assert
<dirbaio[m]1> yeah
<dirbaio[m]1> grrr
<dirbaio[m]1> the "between deassert and assert" one is especially annoying to do with just Delay, no way to do it other than wasting the delay before each assert just in case
<diondokter[m]> Yep, only option when you don't have access to the time
<dirbaio[m]1> perhaps the question is: how common is it, does it warrant including in embedded-hal-bus or not
<dirbaio[m]1> * perhaps the question is: how common is it, does it warrant including in embedded-hal-bus or not?
<diondokter[m]> If it can't be made zero-cost, then we should probably not include it in the default SpiDevice
<adamgreig[m]> i think pretty much all spi devices require some delay asser-to-first-clock and last-clock-to-deassert but it's usually measured in a few ns, so you just ignore it because you get the delay for free from the cpu having to do things in sequence
<diondokter[m]> There's something to be said for letting drivers set all this up. Both delays and the frequency. In principle the driver should know best. And if we're looking to the future, a 1-2 GHz microcontroller could in theory assert the CS pin and start the SPI transaction in less than a nanosecond.
<diondokter[m]> Is there hardware out there that can't change the SPI frequency between transactions?
_catircservices has quit [Quit: Bridge terminating on SIGTERM]
whitequark[cis] has quit [Quit: Bridge terminating on SIGTERM]
likewise[m] has quit [Quit: Bridge terminating on SIGTERM]
dngrsspookyvisio has quit [Quit: Bridge terminating on SIGTERM]
juliand[m] has quit [Quit: Bridge terminating on SIGTERM]
dkhayes117[m] has quit [Quit: Bridge terminating on SIGTERM]
dirbaio[m]1 has quit [Quit: Bridge terminating on SIGTERM]
M9names[m] has quit [Quit: Bridge terminating on SIGTERM]
diondokter[m] has quit [Quit: Bridge terminating on SIGTERM]
adamgreig[m] has quit [Quit: Bridge terminating on SIGTERM]
mameluc[m] has quit [Quit: Bridge terminating on SIGTERM]
AndoThorNando[m] has quit [Quit: Bridge terminating on SIGTERM]
thejpster[m]1 has quit [Quit: Bridge terminating on SIGTERM]
JamesMunns[m] has quit [Quit: Bridge terminating on SIGTERM]
Mebus[m] has quit [Quit: Bridge terminating on SIGTERM]
RansfordHyman[m] has quit [Quit: Bridge terminating on SIGTERM]
DavidGoodenough[ has quit [Quit: Bridge terminating on SIGTERM]
Orange_Murker[m] has quit [Quit: Bridge terminating on SIGTERM]
M9names[m]1 has quit [Quit: Bridge terminating on SIGTERM]
yandrik[m] has quit [Quit: Bridge terminating on SIGTERM]
K900 has quit [Quit: Bridge terminating on SIGTERM]
Radu[m] has quit [Quit: Bridge terminating on SIGTERM]
jannic[m] has quit [Quit: Bridge terminating on SIGTERM]
_catircservices has joined #rust-embedded
likewise[m] has joined #rust-embedded
<likewise[m]> It is quite common for chips to have a delay after CS or CS#. The I/O elements of a SoC cannot keep up with the driving frequency inside the core, which is why it mostly works without delays.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/YaNMtsUGYFOElhodlABnujQD>)
<likewise[m]> * It is quite common for chips to have a delay after CS or CS#. The operating frequency of the I/O elements of a SoC cannot keep up with the core frequency, which is why it mostly works without delays.... (full message at <https://catircservices.org/_matrix/media/v3/download/catircservices.org/fiSIHyZACpTdafOGwwHAFJuT>)
lynaghk[m] has joined #rust-embedded
<lynaghk[m]> Can anyone recommend a serialization library or approach that I can use to generate a web UI for reading/writing structs with an embedded device (over, e.g., web serial)? I'm imagining something that would emit (at compile-time) an annotated schema of a struct definition which could then be rendered by some JavaScript into HTML inputs, combo boxes, checkboxes, etc.
<lynaghk[m]> I could almost certainly do this with a bunch of proc macros and build.rs hijinks, but I'd love to avoid reinventing the wheel if there is prior art here. Something like https://docs.rs/schemars/latest/schemars/ for JSON Schemas is the closest thing I'm aware of.
cr1901 has quit [Quit: Leaving]
cr1901 has joined #rust-embedded
IlPalazzo-ojiisa has quit [Quit: Leaving.]
dngrsspookyvisio has joined #rust-embedded
<dngrsspookyvisio> <lynaghk[m]> "Can anyone recommend a serializa..." <- I have written such a thing! https://github.com/spookyvision/embedded-web-ui
<dngrsspookyvisio> it's not well documented at the moment. hmu if you want help/collab :)
<dngrsspookyvisio> you can also make it work with WebSerial, I was just annoyed at the mandatory chrome so I built a server to translate serial to WebSockets (it's in the repo)
<dngrsspookyvisio> * you can also make it work with WebSerial, I was just annoyed at the mandatory use of Chrome so I built a server to translate serial to WebSockets (it's in the repo)
<lynaghk[m]> Ah, very neat! I'm just looking at the first example I could find (https://github.com/spookyvision/embedded-web-ui/blob/ce37fb02bc14d21b705bb94388bedcb9b49387aa/stm32f4-app/src/main.rs#L122) and it seems like the idea is to define UI elements in the firmware and then listen for changes that come in based on component ID.
<lynaghk[m]> I was thinking something closer to a single annotation on a type and default mappings of type -> UI control, with any changes on the frontend yielding an entire new type value. (Or maybe waiting for a "send" on the frontend). Still, definitely relevant and related work, thanks!
<dngrsspookyvisio> yeah, that's basically it. you can also send data back, e.g. this demonstrates an FFT done on-device and rendered in the browser: https://www.youtube.com/watch?v=OVQCu2fmVps
<dngrsspookyvisio> (second half of the video has audible audio)
<dngrsspookyvisio> at the moment the chart is made with d3, but I'm planning to move to plotters-rs
<dngrsspookyvisio> dngrsspookyvisio: the code for this is not in the repo but I can post it (it's just not very polished)
IlPalazzo-ojiisa has joined #rust-embedded
crabbedhaloablut has quit []