STM32WB55 USB Support

ChibiOS public support forum for topics related to the STMicroelectronics STM32 family of micro-controllers.

Moderator: RoccoMarco

Post Reply
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

STM32WB55 USB Support

Post 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
User avatar
Giovanni
Site Admin
Posts: 14894
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32WB55 USB Support

Post 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
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: STM32WB55 USB Support

Post 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
User avatar
Giovanni
Site Admin
Posts: 14894
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32WB55 USB Support

Post by Giovanni »

Look at the CPU status register value, the exception number is in there.

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: STM32WB55 USB Support

Post 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 ?
User avatar
Giovanni
Site Admin
Posts: 14894
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32WB55 USB Support

Post 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
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: STM32WB55 USB Support

Post 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
User avatar
Giovanni
Site Admin
Posts: 14894
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32WB55 USB Support

Post by Giovanni »

What is the size of the binary file?

Giovanni
Tabulous
Posts: 518
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 18 times

Re: STM32WB55 USB Support

Post 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
User avatar
Giovanni
Site Admin
Posts: 14894
Joined: Wed May 27, 2009 8:48 am
Has thanked: 1202 times
Been thanked: 997 times

Re: STM32WB55 USB Support

Post 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
Post Reply