4 years, 1 month ago.

AnalogIn upon pin A7 causes runtime error

Hi all,

Testing now the Nucleo-l432kc board. I've have just found that creating an AnalogIn object upon pin A7 causes a runtime error, crashing the system.

Is this an undocumented limitation?


Question relating to:

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

2 Answers

4 years, 1 month ago.

A7 is PA_2. Appears to be used for the default stdio uart output. http://www.st.com/content/ccc/resource/technical/document/user_manual/e3/0e/88/05/e8/74/43/a0/DM00231744.pdf/files/DM00231744.pdf/jcr:content/translations/en.DM00231744.pdf

Perhaps try A6/PA7. There are no special usage notes associated with that pin. (see page 27).

If for some reason you have to use A7, you could try disabling stdio output to free up the uart pins. I think setting the macro DEVICE_SERIAL to 0 will disable the default uart output.

Thanks Graham. On page 24 of such document the very same usage note is stated for the f303k8 board, but, on such board, the A7 pin (PA2) can be used as an analog input not generating any trouble.

Also, the pinout (https://developer.mbed.org/platforms/ST-Nucleo-L432KC/) claims that it can be used as an analog input in the l432kc board.


posted by m cesar 12 Jun 2017
4 years, 1 month ago.

m cesar - it does look like Graham's response is correct. The manual he linked to shows that pin is blocked on your board and needs to be manually disconnected. Be sure to look at Table 6 and Table 13.

My point is that the very same information is reported on Table 6 & Table 10 for the f303k8 board and, in such board, the mbed library allows you to use pin A7 as an analog input, of course if you do not use the USB serial at the same time.

I'll try to compile the library modifying the l432kc PeripheralPins.c file in order to check if it is possible to give access to A7 as an analog input.

Thanks again.

EDIT: after recompiling the library with a modified PeripheralPins.c (just removing a comment) now my Nucleo-l432kc board allows the use of the A7 pin as an analog input, provided you do not use the USB serial simultaneously. This is the same way the Nucleo-f303k8 works.

posted by m cesar 13 Jun 2017