Difference between local compilation and mbed online (AnalogIn)

23 May 2018

Very simple to verify .. Create this project

The project to verify the problem

#include "mbed.h"
 
AnalogIn input(PA_1);
 
int main() {
 while(1){
  
     printf("Results:= %f\n",input.read());
    }
}   

You will notice a diff in offset voltage when you compile locally vs mbed (about 0.5 V). The problem is in the mbed-OS .. I cannot recreate the problem using mbed

  • compile it using eclipse-arm gcc
  • compile it using mbed.
  • run both bin file.
  • I tried that with mbed-os.
  • I tried with mbed.

Please help

23 May 2018

Which board? / boards?

Which OS version?

23 May 2018

Latest mbed-OS you get from MBED-IDE (online).

Board= Nucleo-L476RG

The same for the mbed version (not OS)