JamesMunns[m] has quit [Quit: Idle timeout reached: 172800s]
Amit[m] has quit [Quit: Idle timeout reached: 172800s]
<GuineaWheek[m]>
i've found that 'z' sometimes produces smaller code than 's'
<GuineaWheek[m]>
i think it really depends from project to project
<GuineaWheek[m]>
the real problem seems to be that rustc + llvm can't produce enough useful debug info on the assembly emitted so you only get line number/asm correspondences once in a blue moon
<whitequark[cis]>
<okhsunrog[m]> "Catherine: what did you end up..." <- haven't built it yet
<whitequark[cis]>
whitequark[cis]: I'm not super impressed with protobuf historically, though I realize it's reasonably close to postcard
<whitequark[cis]>
whitequark[cis]: thank you for pypostcard, I will make sure to investigate it
sroemer has joined #rust-embedded
sroemer has joined #rust-embedded
ivche has quit [Ping timeout: 248 seconds]
Vaishnav-sabari- has joined #rust-embedded
<Vaishnav-sabari->
Hi all. Nice to meet you. Just wanted to inquire about embedded rust resources other than the embedded rust book. Which ones would you all suggest . Please let me know. Thank you. I know this might seem like a very beginner-like question , so I apologize for that.
M9names[m] has joined #rust-embedded
<M9names[m]>
The awesome embedded rust page is a good place to start:
<dcz[m]>
mkj: can't see the location yet, I'll get back once I try what you suggest
ian_rees[m] has joined #rust-embedded
<ian_rees[m]>
dcz: you'll probably want to set the device class to 0 - I have a note in an old SAMD21 firmware that this is the default of UsbDeviceBuilder , means "use the class code info from Interface Descriptors"
<ian_rees[m]>
not sure that'll matter if you're just using two CDC interfaces, just I vaguely remember having some difficulty getting that to work reliably across Linux/Windows/MacOS
<ian_rees[m]>
s/that/it/
<dcz[m]>
I found the panic: it's in borrow_mut while allocating a string. I guess I'm doing it very wrong
<dcz[m]>
that's caused by let mut serial2 = SerialPort::new_with_interface_names(...)
<mkj[m]>
(oof I realised I was looking at the wrong channel, this isn't embassy, sorry!)
<dcz[m]>
(no worries, I might get to embassy at some point :P)
<dcz[m]>
is endpoint count something defined in hardware?
<dcz[m]>
I noticed that there's no panic when I bump the number and allocate another class, but the device doesn't enumerate
<ian_rees[m]>
I'm not very familiar with STM32 but in SAMD USB peripheral the silicon has a certain number of endpoints. I think there might be a rough edge in usb-device where if you try to use more endpoints than you have it fails silently
<ian_rees[m]>
what host OS are you trying to connect to? If Linux, does dmesg show anything when the device is connected?
<dcz[m]>
Device not responding to setup address. and so on
<ian_rees[m]>
there's also a limit in usb-device around the control endpoint buffer size, which constrains the maximum size device descriptor. Might try enabling control-buffer-256 feature
<ian_rees[m]>
usb-device has had some of this cleaned up in the latest Git but it's a bit of a pain to update as all the HAL, Class implementations, firmwares need to be updated in sync
<dcz[m]>
the datasheet says "The Universal Serial Bus (USB) is a 4-wire bus with 4 bidirectional endpoints. "
<dcz[m]>
I might be out of luck
<ian_rees[m]>
Hmm, yeah I'd say that's your issue
<ian_rees[m]>
must be a fairly small chip?
<dcz[m]>
GD32VF103... it's not a monster I guess
<ian_rees[m]>
I think there are some non-CDC "serial port" implementations that just use one IN and one OUT - my memory is pretty fuzzy on this stuff but I think the CDC implementation winds up allocating another endpoint, so if "bidirectional" means that one hardware endpoint can do both IN and OUT, you might be unable to use CDC but able to use some slimmed-down alternative
<ian_rees[m]>
the device will use endpoint 0 for control, so you basically have 3 bidirectional endpoints to use for other stuff
<dcz[m]>
in my understanding, the CDC class uses one IN, one OUT. Togther with EP0 it's 3 endpoints. When I bump endpoint count to 5, the library allocates another CDC class and that fails later, which would suggest it's just 2 EP per CDC
<dcz[m]>
what I want is to have 2 bidirectional devices and that seems impossible with 4 endpoints
<dcz[m]>
wait a minute
<dcz[m]>
"The Universal Serial Bus (USB) is a 4-wire bus with 4 bidirectional endpoints."
<dcz[m]>
ah I see what you mean: the CDC allocates another bidirectional endpoint
<dcz[m]>
so I could squeeze another bidirectional endpoint if I don't use CDC
<ian_rees[m]>
yeah, it's to support the fancier modem stuff that CDC was meant for
<dcz[m]>
which I don't even want in the first place, lol
<dcz[m]>
how is an interface related to endpoint?
<ian_rees[m]>
an interface is a higher level abstraction, I think of it as "thing that there might be a host-side driver for"
<ian_rees[m]>
so a device can provide one or more interfaces, and each interface will require some number (perhaps 0) of endpoints to provide that interface. Endpoints are just one end of a data pipe
<ian_rees[m]>
there's effectively a bit in the endpoint address field that says IN or OUT, so I think one hardware endpoint can do both IN and OUT - one physical thing doing two logical things
<dcz[m]>
the question is whether this can be switched while the device is operation
<dcz[m]>
half duplex isn't all that bad
<ian_rees[m]>
yes, the hardware endpoint 0 is doing the entire control endpoint 0 thing, both IN and OUT
<GuineaWheek[m]>
i forgot if embassy ever merged the patches required for the gd32vf103's usb ip block to actually work
<GuineaWheek[m]>
i know upstream synopsys-usb-otg basically never did because that crate's basically orphaned
pcs38 has joined #rust-embedded
DanielakaCyReVol has joined #rust-embedded
<DanielakaCyReVol>
<GuineaWheek[m]> "i know upstream synopsys-usb-otg..." <- Do you know more crates implementing DesignWare USB controllers, by the chance?
<DanielakaCyReVol>
I would love to have drivers for the many application processors that I deal with, and they have no manuals whatsoever. Looking at the drivers in Linux and U-Boot is basically all I can do, but all this stuff is quite complex and I do not have much of an understanding thus far. 😬
<jason-kairos[m]>
Is it possible to read and write a MCU's ram while it is still running with a debug probe? (eg. probe-rs)
<Lumpio->
Depends on the MCU, some of them have (almost) free background RAM access, some require them to be stopped
<jason-kairos[m]>
STM32's - I think defmt maybe does a trick like that?
<Lumpio->
STM32 has background RAM access (I dunno if it causes extra bus contention or something but it should not be that noticeable)
<Lumpio->
defmt-rtt uses that for messages
Socke has quit [Ping timeout: 252 seconds]
<dcz[m]>
okay, I made a raw bulk USB device and I have enough endpoints now
<dcz[m]>
but it's treated as a whole device by the kernel... how do I make separate functions?
Socke has joined #rust-embedded
Kaspar[m] has quit [Quit: Idle timeout reached: 172800s]
chrysn[m] has quit [Quit: Idle timeout reached: 172800s]
<dcz[m]>
nvm, this is never going to work. Another function (device) means another control endpoint
DominicFischer[m has joined #rust-embedded
<DominicFischer[m>
I think you're looking for IADs
<dcz[m]>
I managed without, I was just using the wrong function
<dcz[m]>
now I'm ready to rumble :D
<dcz[m]>
*wrong interface
<dcz[m]>
gotta find myself a circular buffer to receive commands now
Farooq has joined #rust-embedded
<Farooq>
So today I brought out my DEC 330 multimeter and realized the seven segment display has been damaged. I should buy a new one. Perhaps now I could buy a more advanced multimeter. What do you suggest?
<Farooq>
Also I don't like touch multi meters
<KevinPFleming[m]>
lots of good used Fluke DMMs on eBay, they last forever
<Farooq>
thanks I needed a brand name
GrantM11235[m] has quit [Quit: Idle timeout reached: 172800s]
<Farooq>
alright way out of my budget
sroemer has quit [Quit: WeeChat 4.5.2]
danielb[m] has joined #rust-embedded
<danielb[m]>
Damaged as in broken, or damaged as not showing stuff and you could revive it by cleaning it?
i509vcb[m] has quit [Quit: Idle timeout reached: 172800s]
<KevinPFleming[m]>
looks very interesting
<thejpster[m]>
Looks a lot like bbqueue.
JamesMunns[m] has joined #rust-embedded
<JamesMunns[m]>
> The buffer length is required to be a power of two, and the only arithmetic operations used by buffer operations are addition/subtraction and bitwise-and. Compared to other Rust ring buffers (such as bbqueue), fring is less flexible, but offers reduced storage and computational overhead.
<JamesMunns[m]>
interesting!
<JamesMunns[m]>
I wonder how they handle wraparounds without a third "watermark" pointer.
<JamesMunns[m]>
Ah, they might force you to write to the "end" of the buffer, instead of doing an early wraparound
<JamesMunns[m]>
interesting, I'll have to check it out more some time :D