Page 1 of 1
STM32WB55 USB Support
Posted: Tue Mar 07, 2023 10:35 am
by Tabulous
Hi
is the USB on STM32WB55 supported ?
I've run the P-NUCLEO68 demo and used the F4xx-USB-CDC_IAD USB files and this sort of works.
Two COM ports are enumerated but only one works.
KR
Re: STM32WB55 USB Support
Posted: Tue Mar 07, 2023 7:56 pm
by Giovanni
Hi,
Yes, it is supported, there must be some problem with descriptors, probably related to endpoint, hard to tell without looking at exchanged data.
Giovanni
Re: STM32WB55 USB Support
Posted: Thu Mar 09, 2023 3:02 pm
by Tabulous
mmmm
so one port works ok, and the other throws _unhandled_exception when trying to connect via tera term.
STM32WB supports upto 16 endpoints, just wondering if the USB driver supports 16 ?
KR
Re: STM32WB55 USB Support
Posted: Thu Mar 09, 2023 4:28 pm
by Giovanni
Look at the CPU status register value, the exception number is in there.
Giovanni
Re: STM32WB55 USB Support
Posted: Thu Mar 09, 2023 4:55 pm
by Tabulous
so if have the make file like this USB second port hand faults
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(ALLCSRC) \
$(TESTSRC) \
usbcfg.c main.c
If i switch main.c and usbcfg.c around in the build order it now works
# C sources that can be compiled in ARM or THUMB mode depending on the global
# setting.
CSRC = $(ALLCSRC) \
$(TESTSRC) \
main.c usbcfg.c
What is going on there ?
Re: STM32WB55 USB Support
Posted: Thu Mar 09, 2023 5:41 pm
by Giovanni
Hard to tell, it is possible there is a problem on the flash loader, some parts could not be loaded properly.
It is not about code anyway, check the .map file and the loaded image using the ST flash tool.
Giovanni
Re: STM32WB55 USB Support
Posted: Thu Mar 09, 2023 5:59 pm
by Tabulous
Giovanni wrote:Hard to tell, it is possible there is a problem on the flash loader, some parts could not be loaded properly.
It is not about code anyway, check the .map file and the loaded image using the ST flash tool.
Giovanni
using STM32CubeProgrammer results in the same issue.
so this says to me its is something to do with with build/linking and not device flashing
Re: STM32WB55 USB Support
Posted: Thu Mar 09, 2023 6:10 pm
by Giovanni
What is the size of the binary file?
Giovanni
Re: STM32WB55 USB Support
Posted: Thu Mar 09, 2023 6:14 pm
by Tabulous
Giovanni wrote:What is the size of the binary file?
Giovanni
CSRC = $(ALLCSRC) \
$(TESTSRC) \
usbcfg.c main.c
output binary is 99,628 bytes
CSRC = $(ALLCSRC) \
$(TESTSRC) \
main.c usbcfg.c
output binary is 99,636 bytes
there is a size difference
Re: STM32WB55 USB Support
Posted: Thu Mar 09, 2023 8:26 pm
by Giovanni
Size difference is because functions alignment option in makefile probably.
If you are 100% sure that the written image is equal to the binary file then next thing is compiler/linker. Try changing optimization options then try a different compiler version, this could give us an hint.
Giovanni