Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 15:28
    slorquet commented #1466
  • 15:19
    karlp closed #1466
  • 15:19
    karlp commented #1466
  • 14:50
    slorquet opened #1466
  • 14:49
    slorquet closed #1465
  • 14:34
    slorquet opened #1465
  • 14:23
    karlp closed #1464
  • 14:23

    karlp on master

    stm32h7:usart: add common file … (compare)

  • 14:21
    karlp commented #1464
  • 13:22
    slorquet closed #1452
  • 13:22
    slorquet commented #1452
  • 13:21
    slorquet opened #1464
  • 12:29
    karlp labeled #1452
  • 10:55
    slorquet commented #1452
  • 10:48
    slorquet commented #1452
  • 10:43
    slorquet commented #1456
  • 10:37
    slorquet commented #1456
  • 02:54
    neoxic commented #1458
  • 02:50
    neoxic synchronize #1458
  • 02:43
    neoxic synchronize #1458
Yusuf Celik
@YusufCelik
sure, thanks!
Yusuf Celik
@YusufCelik
can anyone clarify a method towards bulk transfer method from MCU via libopencm3 that exceeds 64 bytes for usb 1.1? I cannot look under the hood of usbd_ep_write_packet and I am not sure whether I can specify a larger byte size that it "auto breaks into chunks" or whether I should pre-chunkify and call that method multiple times
dxld
@dxld:it-syndik.at
[m]
you definetly have to break it into chunks yourself
what mcu are you using then I can tell you where the source for the write_packet is. I know it's a bit hard to find because of the indirection
Yusuf Celik
@YusufCelik
stm32f1038
Aleksey Kislitsa
@fr0ster
Do you mean stm32f103x8?
Yusuf Celik
@YusufCelik
yes
dxld
@dxld:it-syndik.at
[m]
as you can see it does basically nothing :)
Yusuf Celik
@YusufCelik
@dxld:it-syndik.at: much obliged!
dxld
@dxld:it-syndik.at
[m]
the file above is the stuff in common between _v1 and _v2 iirc
Yusuf Celik
@YusufCelik
given this source code, I assume that the method 'len' argument assumes the user to fill-in the max value
there is no check or switch statement or whatever that would have clarified
dxld
@dxld:it-syndik.at
[m]
or less than the max
Yusuf Celik
@YusufCelik
yes
case EXCEEDS_DEVICE_CAPACITY:
maybe the reference manual will clarify how they push the len specifier into what part of a special usb register
dxld
@dxld:it-syndik.at
[m]
that's what USB_SET_EP_TX_COUNT does
it just writes into some register yeah
I think what you want to do to debug this is check the write return value
if it's 0 then the write didn't go though and that's why your host is stuck
(assuming you don't pass in len=0)
Yusuf Celik
@YusufCelik
yeah, I could look into that
dxld
@dxld:it-syndik.at
[m]
that shouldn't happen if you just got an IN callback tough
Yusuf Celik
@YusufCelik
I still wonder whether you and I are on the right track with regards to our assumptions
we thought we could just simply keep pushing data via the callback
but was that how libopencm intended to support usb transfers
dxld
@dxld:it-syndik.at
[m]
I mean I implemented a working production usb device using this code and I got the code right here :)
Yusuf Celik
@YusufCelik
I also found thi
there is a part that is interrupt based and has a similar idea to ours:

```static void bulk_tx_cb(usbd_device * usbd_dev, uint8_t ep)
{
char buf[64] attribute ((aligned(4)));

(void)ep;

/* Keep sending packets */
usbd_ep_write_packet(usbd_dev, 0x82, buf, 64);

}```

"keep sending packets" <<< evidenced by this
dxld
@dxld:it-syndik.at
[m]
and I read the ST peripheral register docs multiple times over, though I guess mine was _v2 on a STM32F0 instead of _v1 hmm
Yusuf Celik
@YusufCelik
wish I had the host code for this
dxld
@dxld:it-syndik.at
[m]
did you have a look at the gadget0 test/example code?
that has a host side thing too you can play with
Yusuf Celik
@YusufCelik
hopefully they do not say "look example for bulk transfers" let's just write 64bytes!!!!
haha
dxld
@dxld:it-syndik.at
[m]
perhaps, not sure :)
Yusuf Celik
@YusufCelik
(facepalm; but I can already do that. I just need an example that exceeds that number and performs at speed)
one thing though: this thing started because I almost felt like I had 9600bps speeds (worse than serial)
dxld
@dxld:it-syndik.at
[m]
it's still worth a look I think
Yusuf Celik
@YusufCelik
initially, when I used my HOST -> request -< MCU send data loop (4096) to send 256kb
dxld
@dxld:it-syndik.at
[m]
it runs a bunch of different tests
Yusuf Celik
@YusufCelik
4096 times of 64bytes was abysmally slow
but was it due to the implementation or some hidden flaw