JomerDev[m] has quit [Quit: Idle timeout reached: 172800s]
blueluna[m] has quit [Quit: Idle timeout reached: 172800s]
<firefrommoonligh>
So, if you are looking for a way to share Mutex-locked resources across interrupts, either is fine?
<firefrommoonligh>
(They both seem to work on my end)
Averyshethey[m] has joined #rust-embedded
<Averyshethey[m]>
I'm trying to generate an rtic project, rtic is complaining about the function signature that the template generated, is there an up to date example of what an rtic file should look like?
<adamgreig[m]>
if you're using critical_section::Mutex, you'll eventually need to use critical_section::with to get the cs token, and you may as well swap now
<yourarj[m]>
James Munns: will it equivalent to creating a macro which will repeat the value?
<JamesMunns[m]>
this will, at runtime, likely just be a memcpy from flash/.text to RAM
<JamesMunns[m]>
yourarj[m]: yes
<yourarj[m]>
When I say overhead I'm referring to impact on bin size between two approaches creating array of copy type with obvious way
<yourarj[m]>
And array of non copy type with const approach?
<JamesMunns[m]>
honestly, I'm not sure! I would guess the compiler will optimize them the same way. But you would have to benchmark your specific program to see if it makes any change.
<yourarj[m]>
Great! THANKS James Munns: appreciate your help. 😃
<JamesMunns[m]>
interrupt pins actually work exactly like wakers in async: they tell you something happened, but not what happened, but they are useful for telling you when it is time to check what is going on.
<JamesMunns[m]>
Section 5.2 of the ST24DV04K datasheet explains all the different ways you can use GPO.
<khionu[m]>
Wonderful! Thank you very much!
<khionu[m]>
<JamesMunns[m]> "so, it seems like (somehow?) you..." <- Section 5.2 on the NFC datasheet PDF, btw
<khionu[m]>
Also Section 4.4
<JamesMunns[m]>
<JamesMunns[m]> "Section 5.2 of the ST24DV04K..." <- yep :)
<juliand[m]>
<JamesMunns[m]> "Screenshot 2024-01-29 at 08.20.4..." <- "After the end of transmission... Will not be set... (If) D1 is being transmitted"
<juliand[m]>
What's that supposed to mean? Has the transmission ended and a new transmission started?
<MathiasKoch[m]>
Well, the line breaks a serialized as part of my data :/
<JamesMunns[m]>
juliand[m]: > <@juliand:fehler-in-der-matrix.de> "After the end of transmission... Will not be set... (If) D1 is being transmitted"
<JamesMunns[m]>
> What's that supposed to mean? Has the transmission ended and a new transmission started?
<JamesMunns[m]>
I assume "all data is sent", but "not all data has hit the wire", e.g. there's still data in the output shift register/fifo
<JamesMunns[m]>
MathiasKoch[m]: it seems the workaround is "don't do that" :p
<MathiasKoch[m]>
Haha xD Awesome.. Gotta love STM
<JamesMunns[m]>
yeah, it's really really important to review the errata for any parts on any chip you use
<JamesMunns[m]>
ideally before you pick them, before you write code, and before you ship
<MathiasKoch[m]>
gotcha
<JamesMunns[m]>
sometimes you find errata the invalidate the whole purpose of choosing a part, like "oh yeah you can't use low power mode with that peripheral sorry"
<JamesMunns[m]>
idk if stm32 is particularly bad, but every chip maker has them, if they don't have errata docs it just means YOU get to prove there are hardware bugs
<juliand[m]>
JamesMunns[m]: I feel like STM is especially bad at fixing them in new revisions. Like the STM32H743ZI vs ZI2 still has mostly the same annoying hardware bugs...
<JamesMunns[m]>
Do AT commands use line breaks? Not newlines, a line break is when you hold the serial line low for like 9-20 bit times
<JamesMunns[m]>
which is an illegal bit pattern (e.g. overrunning start/stop bits)
<MathiasKoch[m]>
The with_timeout solution is what we have implemented in our newer async version, but we still need to fix the blocking legacy stuff here
<JamesMunns[m]>
Other wild guess, can you ever flush after sending no data? like, is it possible you're trying to flush after sending no data, and that just never sets the "done" flag high because nothing ever happened?
<JamesMunns[m]>
IMO it does seem the flush logic needs to be a little smarter, it looks like TC doesn't go high until some data is sent
<JamesMunns[m]>
so like if you start up or something, and do a flush before ever sending data, it does look like TC might never go high
<MathiasKoch[m]>
The empty write is a super valid point, that we absolutely should add a check for in our code, but I am not so sure that is what happens.
<MathiasKoch[m]>
We tried to print what we are transmitting, and the last transmit before we get stuck in flush (`tc`) does indeed contain data :(
<JamesMunns[m]>
Any chance you have a logic analyzer attached and can see what the CTS line looks like?
<MathiasKoch[m]>
Could be, if I interpret the errata correctly, that the break (0xFF) we receive on TXD (as seen from the modem towards MCU), while still clocking data out on RXD, breaks the TC stuff
Socke has joined #rust-embedded
lehmrob has joined #rust-embedded
IlPalazzo-ojiisa has joined #rust-embedded
<JamesMunns[m]>
Dunno! Might be worth looking at if there are any encoding errors (logic seems real unhappy), and what the timing of the start/stop message vs the CTS pulses looks like, and if there's any difference
johannes[m] has joined #rust-embedded
<johannes[m]>
Is there an easy way to replicate what arm-none-eabi-objcopy -O binary does but using Rust code? I've been playing around with https://crates.io/crates/elf but it does not seem to be able to do this easily.
<johannes[m]>
* Is there an easy way to replicate what arm-none-eabi-objcopy -O binary in.elf out.bin does but using Rust code? I've been playing around with https://crates.io/crates/elf but it does not seem to be able to do this easily.
<JamesMunns[m]>
If it doesn't have to be Rust, you can use llvm's binutils with cargo-binutils to make it cargo objcopy --release -- -O binary out.bin
<JamesMunns[m]>
otherwise, you can look at what probe-rs/probe-rs-cli does, they extract the flashable segments from an elf as well.
lehmrob has quit [Remote host closed the connection]
corecode has joined #rust-embedded
kenny has joined #rust-embedded
<Ecco>
I have an embassy question: in the sample STM32 code, there are some examples of "bind_interrupts!". Is it different from using "#[interrupt]" before the handler's declaration (kind of like #[exception])?
mameluc[m] has joined #rust-embedded
<mameluc[m]>
<Ecco> "I have an embassy question: in..." <- yes, bind_interrupts lets embassy handle the interrupts, #[interrupt] you do it yourself. You can do #[interrupts] without embassy but not bind_interrupts
<mameluc[m]>
strictly speaking #[interrupt] comes from cortex-m-rt
<Ecco>
yes indeed
<Ecco>
By the way, I found a bug in embassy-stm32
<Ecco>
(I'm still investigating)
<Ecco>
Yeah, ok, I believe it's a bug in embassy-stm32
<explodingwaffle1>
<Ecco> "This: https://github.com/embassy..." <- why does this use a union and not Option? (i don't think this pattern is exclusive to embassy either)
<Ecco>
explodingwaffle1: Not sure I understand what you mean
AdinAck[m] has quit [Quit: Idle timeout reached: 172800s]
<explodingwaffle1>
not really anything to do with your issue. but iirc Option<fn()> has the same size as pointer and None is null, so i was wondering what the point in union Vector was
<GrantM11235[m]>
That's a good question. The union allows you to store any arbitrary integer, but I don't know if that is useful or even a good idea
<GrantM11235[m]>
Also, I think that union technically needs to be repr(C)
<barafael[m]>
I got the same module from a different brand and it works fine... But none of the joy-it ones. I'm using an rp2040 with the ssd1309 driver, all via i2c. They all get NAK every couple seconds during continuous write. Speed does not make a difference though
<thejpster[m]>
<johannes[m]> "Is there an easy way to replicat..." <- The Neotron-loader does this. Sort of. I load ELF binaries off disk and into RAM then jump to the entry point.
<thejpster[m]>
Should be easy enough to write it to disk instead.
<thejpster[m]>
To be clear, I load them off and SD card on an RP2040 microcontroller . But anything that implements my file access trait will work.
<adamgreig[m]>
you might be able to get probe-rs to do it for you too, but if not you can certainly check its code, since it already has to load elf files and extract the part to write to flash