7 years, 8 months ago.

mbed and Nucleo ST411RE board

Hi Everyone, I am a newbie to this board and I am having a few problems. I have been successfully using an LPC1768 board but it lacked the I/O I needed so I decided to upgrade to the ST board, which, with its Morpho connectors gave me access to all of the I/O lines.

Problem is, I cannot see how you address the actual pins and their other functions in code. I have been trying to setup one of the ADC lines, PA_1/ADC1_1 with the command:

AnalogIn sensorL(PA_1);

but this generates a warning when compiling. I also tried:

AnalogIn sensorL(ADC1_1);

But this and everything else I can think of generated an error when compiled. I do not know how to tell the compiler I want to use an 'additional function' on this pin. I also need to use many of the digital I/o lines as pwm - please can someone tell me how to set them up.

I know that I could use the Arduino header pin names but when this goes into my own design I need more than the Arduino headers provide.

Last question is: When the micro is in my own pcb can it be programmed just using the 2 lines SWCLK and SWDIO along with ground and power using the ST Link part of the Nucleo board?

2 Answers

7 years, 8 months ago.

Hi,

these are your pins for ADC https://github.com/ARMmbed/mbed-os/blob/master/hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/PeripheralPins.c#L41 for Nucleo F411RE.

PA_1 should not generate any warning.

mbed API uses PinNames, these are pinNames available for your target https://github.com/ARMmbed/mbed-os/blob/master/hal/targets/hal/TARGET_STM/TARGET_STM32F4/TARGET_NUCLEO_F411RE/PinNames.h

Hi Martin, Thanks for the reply, but I am a real newbie with this chip. Unfortunately I do not know what to do with them - how do I import them to my project?

posted by John Hale 22 Aug 2016

Just use the PinNames defined, for instance AnalogIn sensorL(PA_1); should compile and work. What error are you getting?

posted by Martin Kojtal 22 Aug 2016
7 years, 8 months ago.

Try starting at this page: https://developer.mbed.org/platforms/ST-Nucleo-F411RE/

Import the https://developer.mbed.org/teams/ST/code/Nucleo_read_analog_value/?platform=ST-Nucleo-F411RE Analog value program. It compiles error free for me. Be sure to select the F411RE as your target.

Any of the pins shown in blue with white text are the pin names you can use. There is a also a list of aliases in the box just below the pin diagram. You can use those pin names as well where appropriate.

Hope that helps.