cancel
Showing results for 
Search instead for 
Did you mean: 

Bug Report STM32CubeMX v4.3, can't enable USB and CAN at the same time for STM32F303x

maggie
Associate III
Posted on August 01, 2014 at 04:22

I'm using STM32CubeMX v4.3 to generate my STM32F303x custom board pins.

I need both USB and CAN enabled.

I can set USB (as FS Device) pins as:

  • PA11: USB_DM
  • PA12: USB_DP
And CAN pins as:

  • PD0: CAN_RX
  • PD1: CAN_TX
But for some reason, I can't enable USB and CAN at the same time.

When I try to enable USB, CAN can't be enabled anymore (grayed-out) and on mouse hover, says:

  • ''CAN Not Available: CAN IP can be selected if USB IP is not selected''
When I try to enable CAN, USB can't be enabled anymore (grayed-out) and on mouse hover, says:

  • ''USB Not Available: USB IP can be selected if CAN IP is not selected''

Acc. to clive1:

''In the original F1 design CAN and USB shared a common 512 byte SRAM buffer, this is supposedly not the case with the F303 design, but the logic in CubeMX might still be blocking this option.''

Please confirm if this is an STM32CubeMX bug for STM32F303x devices.

Related forum

/public/STe2ecommunities/mcu/Lists/STM32Java/Flat.aspx?RootFolder=https://my.st.com/public/STe2ecommunities/mcu/Lists/STM32Java/Why%20can%27t%20I%20enable%20USB%20and%20CAN%20simultaneously%20using%20STM32CubeMX&FolderCTID=0x01200200770978C69A1141439FE559EB459D758000F9A0E3A95BA69146A17C2E80209ADC21&currentviews=11

.

#stm32cubemx-stm32f303x-can-usb
2 REPLIES 2
stm32cube-t
Senior III
Posted on September 11, 2014 at 09:36

Hello,

This is indeed an issue in STM32CubeMX implementation to be fixed for the next 4.4 release.

For most of STM32F3 MCUs, USB and CAN have separated SRAMs: the peripherals can be used simultaneously. On STM32F302x6/x8 products, when the CAN clock is enabled only the first 768 bytes are available to USB while the last 256 bytes are used by CAN. Since they can't overlap, it is safe to use both simultaneously as well.

Thank you for pointing out the issue.

 

maggie
Associate III
Posted on September 11, 2014 at 15:03

Acknowledged. Thank you for confirming that the issue is valid.

Will expect the fix in the next version release then. :)