8 years, 3 months ago.

Nucleo-F042 Board redefined configuration

Hello,

I am interested in using both UARTs, one SPI, one IIC and input capture functions. Is there a list of pins that carry predefined functions and if it is possible to reconfigure some of these pins for alternate functions.

Thanks Sudhir Gupta

Question relating to:

Affordable and flexible platform to ease prototyping using a STM32F042K6T6 microcontroller.

1 Answer

8 years, 3 months ago.

Hello Sudhir. Review this landing page:

https://developer.mbed.org/platforms/ST-Nucleo-F042K6/

Recommend the following (one combination that should work for your requirements):

PA9 & PA10 for UART1 TX & RX

PA2 & PA3 for UART2 TX & RX

PB3, PB4, PB5 for SPI port CLK, MISO, MOSI

PB6 & PB7 for I2C port SCL, SDA ; be sure to add the required pull-up resistors to 3V3 due to open drain configuration of I2C

The above should work for your configuration. Be sure to not reverse SCL & SDA as this will not work and cause other ports to fail. We did this on our STM32F072RB Nucleo review and killed a day with this silly error.

MBED is amazing and you should be able to quickly test your project. With MBED, you do not need to worry about the very complex ST specific configurations for the above ports - they are all handled for you automatically by the compiler :)

Post back if you have any issues. Good luck yar !

On the I2C definition - be sure that you pass the correct port pin for SCL and SDA pins - that is the error we made during our lab testing. We reversed the port pins in the C code definition and the compiler did not complain but broke all of the port configurations. Silly error but consumed much time. We felt that the ST processor could not support the ports of our choice due to the confusing related data sheets. However, we have been proven wrong and MBED saved our project. We are currently using the STM32F072RB Nucleo and may migrate to the M4 series if the end product is too slow. However, so far, amazing results !! Wanted to make this clear on our error :)

Hi Sanjiv,

Thank you for a prompt reply. I shall try these. Do you know, if there is an existing example on using the input capture function of any one of the timers?

Thanks Again, Sudhir

posted by Sudhir Gupta 11 Jan 2016

Hi Sudhir. The first hit from this search looks promising but there are many public posts:

https://developer.mbed.org/search/?type=&q=timer+capture

posted by Sanjiv Bhatia 11 Jan 2016