Skip to main content
JHaml
Associate
December 21, 2018
Question

STM32CubeMX won't enable CAN or HSE with the STM32F042G6U6

  • December 21, 2018
  • 3 replies
  • 1102 views

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.

    This topic has been closed for replies.

    3 replies

    turboscrew
    Senior III
    December 21, 2018

    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
    JHamlAuthor
    Associate
    December 21, 2018

    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?

    turboscrew
    Senior III
    December 26, 2018

    Maybe you can use them without Cube?

    JHaml
    JHamlAuthor
    Associate
    December 26, 2018

    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.