Closed covsh closed 2 years ago
OMG. Some things from ST make me crazy. Is this fix works for the multiple endpoints? I have no L151 in my lab, so I can't do a test.
OMG. Some things from ST make me crazy. Is this fix works for the multiple endpoints? I have no L151 in my lab, so I can't do a test.
I have Control Endpoint and 2 Bulk IN endpoints. Fix works well.
Could you please test with the assembly version of the driver? Looks like it's correct for L151. https://github.com/dmitrystu/libusb_stm32/blob/0a0a24f590844a9dab1557be054d43c128d0d0a8/src/usbd_stm32l100_devfs_asm.S#L419 and https://github.com/dmitrystu/libusb_stm32/blob/0a0a24f590844a9dab1557be054d43c128d0d0a8/src/usbd_stm32l100_devfs_asm.S#L499
For L100 it works well in both cases. Perhaps it's a cause that i didn't discover this bug.
Just testing assembler version. pma_write and pma_read works well. But my BULK endpoint didn't works.
Endpoints configure as:
usbd_ep_config(dev, 0x02, USB_EPTYPE_BULK /*| USB_EPTYPE_DBLBUF*/, 0x40);
usbd_ep_config(dev, 0x05, USB_EPTYPE_BULK /*| USB_EPTYPE_DBLBUF*/, 0x40);
usbd_reg_endpoint(dev, 0x02, txd1_ep_cb);
usbd_reg_endpoint(dev, 0x05, txd2_ep_cb);
And i have STALL packet on USB analyzer on both endpoints.
Seems with asm driver endpoint didn't config correctly (C version works well)
I not familiar with asm, its hard to debug this for me
Confirmed for large (>=64 bytes) endpoints.
Looks like it's fixed. Could you please do an independent test then i will merge this branch.
Test done. Asm and C version works well. Thanks for fixing.
Hello. I am using STM32L151C8 with usbd_stm32l100_devfs.c driver. Noticed that pma_write and pma_read don't read the data correctly. If we look into STM32 HAL Library function looks like:
pdwVal pointer is incremented twice (PMA_ACCESS is 2)
But in pma_read (and pma_write)
pma is incremented only ones Adding pma++; after tmp = *pma++; solving problem.
Surprisingly usbd_stm32l100_devfs_asm.S work correct