cancel
Showing results for 
Search instead for 
Did you mean: 

STM32CubeF0 Bug Report - __HAL_REMAP_PIN_ENABLE

petr239955
Associate III
Posted on March 04, 2015 at 23:46

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

*

/

}

#stm32cubef0-bug-__hal_remap_pin_
2 REPLIES 2
Posted on March 05, 2015 at 01:03

RCC-

>

APB2ENR

=

0x00000001

;

/

*

<<<<

Correction

,

added

*

/

Don't assume to know initial conditions, or break them, use

RCC-

>

APB2ENR

|=

0x00000001

;

/

*

<<<<

Correction

,

added

*

/

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
petr239955
Associate III
Posted on March 05, 2015 at 09:38

Of course, you

're right.

This is

more

secure solution.