cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeMX won't enable CAN or HSE with the STM32F042G6U6

JHaml
Associate II

I am trying to use CAN on the STM32F042G6U6 - with the 28UFQFPN package. I don't see anything in the datasheet saying these features won't work but the STM32CubeMX will not allow them to be enabled unless I change to a larger package. Should CAN and HSE work for me? If not, where is the documentation explaining why? Thank you.

4 REPLIES 4
turboscrew
Senior III

According to data sheets, both should be available, unless the pins are used for something else.

Especially, the CAN pins are also used by USART1. That special mapping is in the SYSCFG_CFGR1 register. It selects whether pins 19 and 20 are used for PA9/10 or PA11/12. That might confuse CubeMX.

The xtal lines should work normally.

JHaml
Associate II

Right. Your understanding is the same as mine. It should work but now I am afraid to put the STM32F042G6U6 down on my pcb since STMCube disables CAN and HSE on this part. Can ST comment please?

Maybe you can use them without Cube?

JHaml
Associate II

Solved! In the System Core tab under SYS I found the checkbox for SYSCFG_CFGR1 register and in the RCC tab I found the enable for the external crystal resonator. It just took me a long time to figure out where these selections were hiding. Thank for your help. All is good.