L432 AnalogIn connected to GND reads 0.5 with GCC compiler and 0.0 with mbed
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
GNU Arm Embedded Toolchain |
Expired
|
Undecided
|
Unassigned |
Bug Description
Board: Nucleo L432
The following code was used with the mbed-os library:
#include "mbed.h"
DigitalOut o0(D0);
DigitalOut o1(D1);
DigitalOut o2(D2);
DigitalOut o3(D3);
DigitalOut o4(D4);
DigitalOut o5(D5);
DigitalOut o6(D6);
DigitalOut o7(D7);
DigitalOut o8(D8);
DigitalOut o9(D9);
DigitalOut o10(D10);
DigitalOut o11(D11);
DigitalOut o12(D12);
DigitalOut o13(D13);
//DigitalOut i0(A0);
DigitalOut i1(A1);
DigitalOut i2(A2);
DigitalOut i3(A3);
DigitalOut i4(A4);
DigitalOut i5(A5);
//DigitalOut i6(A6);
//DigitalOut i7(A7);
AnalogIn r_0(A0);
Serial pc(USBTX, USBRX);
int main()
{
pc.baud(115200);
while(1) {
printf("Analog %3.2f%%\r\n", (r_0.read(
wait_ms(500);
}
}
Using the online mbed compiler the value reads 0.0 when grounded. With the GCC compiler the value reads around 0.45. If no other outputs are used the value will read 0.0. I tested this with the F746ZG board and there was no issues there.
Please provide a pre-processed testcase and the command line options, version used. This bug report is incomplete.