STM32WB55 USB Support

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

Moderators: RoccoMarco, barthess

Tabulous
Posts: 509
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 17 times

STM32WB55 USB Support

Postby Tabulous » Tue Mar 07, 2023 10:35 am

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32WB55 USB Support

Postby Giovanni » Tue Mar 07, 2023 7:56 pm

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: 509
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 17 times

Re: STM32WB55 USB Support

Postby Tabulous » Thu Mar 09, 2023 3:02 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32WB55 USB Support

Postby Giovanni » Thu Mar 09, 2023 4:28 pm

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

Giovanni

Tabulous
Posts: 509
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 17 times

Re: STM32WB55 USB Support

Postby Tabulous » Thu Mar 09, 2023 4:55 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32WB55 USB Support

Postby Giovanni » Thu Mar 09, 2023 5:41 pm

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: 509
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 17 times

Re: STM32WB55 USB Support

Postby Tabulous » Thu Mar 09, 2023 5:59 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32WB55 USB Support

Postby Giovanni » Thu Mar 09, 2023 6:10 pm

What is the size of the binary file?

Giovanni

Tabulous
Posts: 509
Joined: Fri May 03, 2013 12:02 pm
Has thanked: 7 times
Been thanked: 17 times

Re: STM32WB55 USB Support

Postby Tabulous » Thu Mar 09, 2023 6:14 pm

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: 14455
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1076 times
Been thanked: 922 times
Contact:

Re: STM32WB55 USB Support

Postby Giovanni » Thu Mar 09, 2023 8:26 pm

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


Return to “STM32 Support”

Who is online

Users browsing this forum: No registered users and 23 guests