How to start the Arduino sketch at power up?

Discussion in 'UDOO X86' started by Theflorianmaas, Sep 17, 2018.

  1. Theflorianmaas

    Theflorianmaas UDOOer

    Joined:
    Dec 7, 2013
    Messages:
    22
    Likes Received:
    2
    How to make the arduino sketch runs as soon as the power supply is plugged in?
    I have a Udoo X86 Advanceded with a power button connected to the button/led header.
    When I plug the power supply into the board, the power led on the board is yellow. I would like the arduino sketch runs immediately, while it starts only if then a press the power buttun, the power led turns green and the system boots.
    Is there a way to get it?
    Thank you
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    I think that is the default case. If you put the power in, the Arduino101 part should start immediately. You can try it with a simple example as the Blink example.
    If you use Serial.Read() or Serial.Write() in your Arduino sketch, be aware that this only functions correclty when there is a connection with Braswell. In your Arduino sketch you have to wait until Braswell OS is running. There is also an Arduino bug regarding this resulting in a reset of arduino 101 (as a workaround): https://www.udoo.org/docs-x86/Arduino_101_(Intel_Curie)/Curie_Reset_on_PowerON.html
     
  3. Theflorianmaas

    Theflorianmaas UDOOer

    Joined:
    Dec 7, 2013
    Messages:
    22
    Likes Received:
    2
    Yes there is a Serial.read(), but does the sketch hang on that line until the Braswell OS is running or the schetch does not start at all?
    In the first case the code before Serial.read() should be executed in any way, but actually nothing happens.
    I will do some test.
    Thank you
     
  4. Theflorianmaas

    Theflorianmaas UDOOer

    Joined:
    Dec 7, 2013
    Messages:
    22
    Likes Received:
    2
    It definitely does not work as you explained.
    I have tried with the blink led sketch and it starts only when the power button (external) is pressed and the power led becomes green.
    Is there anything else to check, maybe in the bios?
     

Share This Page