6 years, 1 month ago.

Alternative pin setup for NUCLEO-F042

Nucleo-board F042 provides CAN – pins (CAN1_RD / CAN2_TD) at PA_11 / PA_12. There is a alternative pin – connection to PA_9 / PA_10. Pin 4 in SYSCFG_CFGR1 activates this alternative setting. Probably I set this pinning with: SYSCFG->CFGR1 |= 0x00000010; but code simply doesn’t work after this. Any idea to manage this? Thanks a lot. Dieter

2 Answers

6 years, 1 month ago.

I could not see the alternate CAN pins on PA_9/PA_10 in the Table 13 page 34 of the datasheet.

https://www.st.com/resource/en/datasheet/stm32f042k6.pdf

Accepted Answer

Hi Yoshi, Thank you very much for your quick response, and for your helpfulness.

Please see note (5) on page 36, regarding the 24 and 20 pin package of the chip: “5. Pin pair PA11/12 can be remapped in place of pin pair PA9/10 using SYSCFG_CFGR1 register”

In https://www.st.com/resource/en/reference_manual/dm00031936.pdf on page 168 they describe the usage of Pin 4 to remap the pins. My problem is, that I made a little program on the NUCLEO-board using the CAN-interface, and I have to transfer this to a 20 pin ssop – version of STM32F042, which has no PB11/PB12 – pins. Best wishes Dieter

posted by Dieter Riedl 13 Nov 2018

I thought the question was related to the mbed (NUCLEO-F042, 32 pin STM32F042K6T6) device. The 20 pin ssop device is not related to the mbed, therefore this discussion is off-topic.

Why don't you ask this question on the STM device forum?

posted by Yoshi Mimura 13 Nov 2018
6 years, 1 month ago.

Hello Dieter,

I'm afraid that pin pair PA11/12 can be remapped in place of pin pair PA9/10 using SYSCFG_CFGR1 register only on UFQFPN28 and TSSPOP20 (28 and 20-pin) packages. However, NUCLEO-F042 boards are equipped with the LQFP32 (32-pin) package. So your program won't work on a NUCLEO-F042 but should run fine on custom boards equipped with a TSSPOP20 package.

  • Could you please let us know how did you create the CAN object in your program (did you use pins PA_11, PA_12 or rather PA_9, PA_10)?
  • Did your program , without pin mapping (without SYSCFG->CFGR1 |= 0x00000010) work on a NUCLEO-F042 board?

My project is a device on a board with a maximum width of 9mm, and with a processor that had to have a CAN-port. As a fan of working with mbed – modules, I was very happy to find a processor, witch was small enough for my board, and also available in a mbed- supported NUCLEO-module. I started to write some test routines for my project in a breadboard-realisation for the NUCLEO – board, and then transfered the code to my homemade board with the tssop20 – controler. In this phase, I realized the problem that there is no CAN-constructor for the alterative pin – couple. So of course, Yoshi is right, and my problem is not a primary mbed subject. I just tried to find an idea on the topic. So anyway, thank you very much Yoshi and Zoltan.

posted by Dieter Riedl 13 Nov 2018