Kernel message while reading /dev/ttyMCC

Discussion in 'UDOO NEO' started by cyrilf, Oct 24, 2016.

  1. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    Hi,

    I'm reading through /dev/ttyMCC to get analog input from Arduino back to the CPU using Linux and minicom. When I read something using a timer on Arduino side, I get a kernel message above the minicom output.

    Here is my Arduino sketch:
    Code:
    #include <math.h>
    #include <imx6sx_sdb_m4.h>
    #include <hwtimer_epit.h>
    
    #define NB_MESURES 600
    #define PIN A0
    
    HWTIMER timer;
    
    float TabV0[NB_MESURES];
    int n = 0;
    
    void readValue(void *param)
    {
      TabV0[n] = analogRead(PIN);
      Serial.print("test: ");
      Serial.println(TabV0[n]);
      n = (n + 1) % NB_MESURES;
    }
    
    void setup()
    {
      analogReadResolution(12);
    
      Serial.begin(115200);
    
      hwtimer_init(&timer, &BSP_HWTIMER1_DEV, BSP_HWTIMER1_ID, 1);
      hwtimer_set_period(&timer, BSP_HWTIMER1_SOURCE_CLK, 1000000);
      hwtimer_callback_reg(&timer, readValue, 0);
      hwtimer_start(&timer);
    }
    
    void loop()
    {
    }
    Here is the output of:
    Code:
    minicom -D /dev/ttyMCC
    Code:
    Welcome to minicom 2.7
    
    OPTIONS: I18n
    Compiled on Oct 20 2016, 12:12:22.
    Port /dev/ttyMCC
    
    Press CTRL-A Z for help on special keys
    
    [ 1737.880825] mcc int still be triggered after 101 ms polling!
    
    [ 1739.900845] mcc int still be triggered after 101 ms polling!
    test: [ 1741.920839] mcc int still be triggered after 101 ms polling!
    2753[ 1743.940851] mcc int still be triggered after 101 ms polling!
    .[ 1745.960855] mcc int still be triggered after 101 ms polling!
    0[ 1747.980916] mcc int still be triggered after 101 ms polling!
    0[ 1750.000909] mcc int still be triggered after 101 ms polling!
    
    [ 1752.020850] mcc int still be triggered after 101 ms polling!
    test: [ 1754.040852] mcc int still be triggered after 101 ms polling!
    2752[ 1756.060853] mcc int still be triggered after 101 ms polling!
    .[ 1758.080846] mcc int still be triggered after 101 ms polling!
    0[ 1760.100844] mcc int still be triggered after 101 ms polling!
    0[ 1762.120822] mcc int still be triggered after 101 ms polling!
    
    [ 1764.140898] mcc int still be triggered after 101 ms polling!
    test: [ 1766.160867] mcc int still be triggered after 101 ms polling!
    2754[ 1768.180926] mcc int still be triggered after 101 ms polling!
    .[ 1770.200849] mcc int still be triggered after 101 ms polling!
    0
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    I never have seen this before.

    What if you compile and send this sketch from the Arduino IDE on the Neo itself and have the serial monitor of the IDE already opened? In this way we rule out buffer issues that ttyMCC can have.
     
  3. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    I don't have an UI on my UDOO Neo (I don't need it for embedded device). I'll try with an installation of UDOObuntu to test.
     
  4. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Or send compiled sketch to M4 and start minicom directly after upload (without reboot).
     
  5. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    I don't reboot after uploaded the sketch to M4. I don't have a micro HDMI cable now to test with UDOObuntu but I'll do it later.
     
  6. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    You can check with VNC-viewer, no need for a monitor to be connected.
     
  7. Francesco

    Francesco Active Member

    Joined:
    Jun 23, 2015
    Messages:
    220
    Likes Received:
    110
    Hi. BSP_HWTIMER1 is used to implement micros. Using it compromises micros().
    As an alternative, you can use the yield() function in the sketch:
    Code:
    void yield (void)
    {
        delay(1000);
        ReadValue();
    }
     
  8. cyrilf

    cyrilf Active Member

    Joined:
    Feb 19, 2015
    Messages:
    168
    Likes Received:
    47
    Hi. This method is not accurate at all. The point is to get the value at a certain frequency, not after a certain time.
     

Share This Page