14 Replies Latest reply on Jan 22, 2015 6:37 PM by jzd

    a strange bug between "trace" and "ADC" in edison arduino

    jzd

      I found a strange bug between trace and ADC, and i think it is a bug of Arduino IDE.

      yocto: ww42

      arduino: 1.5.4-intel 1.0.4

       

      1, I add trace_enable(0); in arduino-1.5.3-Intel.1.0.4\hardware\arduino\edison\cores\arduino main.cpp file, to disable the trace output. Then I cannot use the adc port 0-5.

       

      trace_init(VARIANT_TRACE_LEVEL, 0);

      trace_target_enable(TRACE_TARGET_UART);

      trace_enable(0); // i add this to diable trace

       

      2, if I only disable trace_debug by

      #define VARIANT_TRACE_LEVEL TRACE_LEVEL_ERROR

      it will report  "find_iio_dev_name  Can't find ADC driver ads7955 entry in ...."  (sys)and ADC still cannot work

       

      3, firstly i thought maybe the initialization work needs some interval time, so I replce all trace_debug/trace_error and trace_info with usleep(100000), it still cannot work.

       

      4, I comment out the printf functions in trace_main() in trace.c, then ADC  worked

      if(tdesc.trace_target & TRACE_TARGET_UART){

             if( tmsg.tlevel == TRACE_LEVEL_ERROR){

                  //fprintf(stderr, tmsg.tbuf);

                  fflush(stderr);

             }else{

                 //printf(tmsg.tbuf);

                  fflush(stdout);

             }

        }

       

      It seems some works in trace affect ADC's initialization, and I dont know what it is.

      AND I repeat the same problem in two edison arduino boards.