AnsweredAssumed Answered

STM32CubeF0 Bug Report - __HAL_REMAP_PIN_ENABLE

Question asked by Kolomaznik.Petr.001 on Mar 4, 2015
Latest reply on Mar 5, 2015 by Kolomaznik.Petr.001
I tried to configure the CAN controller in the STM32F042F6P6 using
STM32CubeMX
. The function was not correct because it was not properly remapping pins PA11, PA12. Macro __HAL_REMAP_PIN_ENABLE does not activate SYSCFGCOMPEN: SYSCFG & COMP clock enable.

Version: STM32CubeMX 4.6.0, STM32CubeF0 1.2.1

I made a change in the file stm32f0xx_hal_msp.c, function is correct now:
HAL_MspInit void (void)
{
    / * USER CODE BEGIN MspInit 0 * /

    RCC-> APB2ENR = 0x00000001; / * <<<< Correction, added * /

    / * END USER CODE MspInit 0 * /

    / * Init System interrupt * /
    / * SysTick_IRQn interrupt configuration * /
    HAL_NVIC_SetPriority (SysTick_IRQn, 0, 0);

    __HAL_REMAP_PIN_ENABLE (HAL_REMAP_PA11_PA12);

    / * USER CODE BEGIN MspInit 1 * /


    / * END USER CODE MspInit 1 * /
}

Outcomes