How to setup GPIO state on SAM3X when KERNEL is not booted

Discussion in 'General Discussion' started by TomFreudenberg, Sep 22, 2014.

  1. TomFreudenberg

    TomFreudenberg Member

    Joined:
    May 12, 2014
    Messages:
    59
    Likes Received:
    2
    Hi, our problem may be a bit similar like

    gpio-default-state-t811.html

    but I decided to add this as a seperate title.

    Problem is: We are using UDOO as a controller for our project. The SAM3X should handle all kind of external hardware and sensors, the IMX running Ubuntu should run the application web server. One of the hardware to control are two 4Wire Stepper Motors. By now we have used Pins (SAM3X) 50, 48, 46, 44 as controlling lines for motor driver chip and Pin 52 as ENABLE.

    The INO Setup() function initialize the Pins as OUTPUT and set Pin 52 to LOW to definitly stop the Motor from running.

    We were wondering why on hell the Motor is running / vibrating for 4-6 seconds when starting UDOO with Power ON.

    We used an oscilloscope and checked, that the Pin OUTPUT Level on Pin 52 is still 1.7V on Power ON

    Immediatly when the kernel is loaded and initialize the IMX side, the levels are as expected and the Motors stop running.

    If you stop the boot process via serial console, the Port is as long in this unwanted state, until KERNEL is loaded.

    So from my experience, it seems, that the SAM has only (full) access to the Pins, when also the KERNEL is loaded. Even if we remove the BOOT-SD-Card, the initialization from Setup() is not fullfilled.

    What does this mean? For our project, we can not seriously initialize the hardware for a few seconds until the complete linux is also loaded. But this could damage already some of the components.

    We tested this behavior with an UDOO DUAL. You could check it very easy by yourself when measuring Volt level on Pin 52.

    Code:
    void Setup() {
      pinMode(52, OUTPUT);
      digitalWrite(52, LOW);
    }
    
    void Loop() {
    }
    
    The Level on Pin 52 is around 1.7V until boot of kernel has reached initialization on IMX side.

    From my point of view there are two options to solve this:

    1. From the moment of POWER ON the SAM3X has full control of all Pins as a DUE would have

    2. The SAM3X is started only AFTER the IMX boot is complete, so POWER ON to SAM3X is handled by kernel boot

    However both options are fine but current state not.


    It would be great if someone will check this from UDOO officials.

    Thanks for any feedback
    Tom
     
  2. TomFreudenberg

    TomFreudenberg Member

    Joined:
    May 12, 2014
    Messages:
    59
    Likes Received:
    2
    Re: How to setup GPIO state on SAM3X when KERNEL is not boot

    Additional Info to the above description: Last week we tested out some new things and got irregular results. So we decided to send back this UDOO Dual to customer care as it seems to be a hardware failure.
     
  3. modjo

    modjo Active Member

    Joined:
    Sep 29, 2014
    Messages:
    417
    Likes Received:
    127
    thank's for your informations .
     
  4. xwalter

    xwalter Member

    Joined:
    Sep 8, 2014
    Messages:
    89
    Likes Received:
    4
    I think is better to set all of kernel input as input
    The setting up the arduino pins in according of the application and the re-set up the kernel pins
    Did you test with instruments and/or tools .
    This is a bad issue if you are right ..... :(
     
  5. TomFreudenberg

    TomFreudenberg Member

    Joined:
    May 12, 2014
    Messages:
    59
    Likes Received:
    2
    Re: How to setup GPIO state on SAM3X when KERNEL is not boot

    Hi as I wrote in my additional Info: it seems to be a hardware failure on this UDOO Board. The customer support will send out a new board in exchange to us so that I will follow up with this. I will keep you (this forum) informed on our next steps.
     

Share This Page