How to Stop an Arduino Sketch Running on M4?

Discussion in 'UDOO NEO' started by Avenue33, Jan 23, 2016.

  1. Avenue33

    Avenue33 New Member

    Joined:
    Jan 12, 2016
    Messages:
    8
    Likes Received:
    3
    The /usr/bin/udooneo-m4uploader sketch.cpp.bin uploads the executable of the Arduino sketch to the M4 MCU.

    How to stop the sketch running on the M4 MCU?

    Thank you!
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    How to stop an Arduino from running its sketch?
    I suppose by uploading an "empty" sketch. Or create a pause state in your sketch when pressing an attached button or sending a serial command to the Arduino. Like a real Arduino the Neo starts the last loaded sketch at startup or reboot/reset. So you have to stop it in another way.
     
  3. Avenue33

    Avenue33 New Member

    Joined:
    Jan 12, 2016
    Messages:
    8
    Likes Received:
    3
    Thanks. I've already tried this option but I'd like to know whether there is a cleaner way, with lower power usage.
     
  4. Francesco

    Francesco Active Member

    Joined:
    Jun 23, 2015
    Messages:
    220
    Likes Received:
    110
    You can use `udoom4ctl disable`, but it requires a reboot.
     
    Andrea Rovai likes this.
  5. Gla

    Gla New Member

    Joined:
    Oct 25, 2016
    Messages:
    25
    Likes Received:
    4
    Please sb help.
    My udooneo has stuck after programming with the M4 (arduino), i must have sent too many data to the buffers.
    The problem is that i cannot access the board through linux, web interface etc.
    I cann only use my udoo through an android booted sdcard.
    The leds of the board are ok, but i cannot connect via usb, SSH, VNC etc.
    I have tried all the methods described in the udoo docs.
    Has anyone any further ideas?
     
  6. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    It could also be that your Udoobuntu SD image or card is broken. You need to remove the last compiled sketch from your SD card and than boot.

    Can you mount the card with another Linux machine? Then you can try to backup all your files on the Udoobuntu SD and rewrite a fresh image.
     
  7. Gla

    Gla New Member

    Joined:
    Oct 25, 2016
    Messages:
    25
    Likes Received:
    4
    i know that is what i am trying to achieve.
    i have an old notebook with ubuntu installation.
    If i cannot manage to solve it i will try to rewrite the bootable sd card of udoo.
    Is there any way to see linux partitions through windows?
     
  8. Gla

    Gla New Member

    Joined:
    Oct 25, 2016
    Messages:
    25
    Likes Received:
    4
    thanks for your answer by the way
     
  9. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
  10. Gla

    Gla New Member

    Joined:
    Oct 25, 2016
    Messages:
    25
    Likes Received:
    4
    i am unhappy to inform that finding the last compiled m4last.fw and delete it or change it, does not apply as a solution to debug the arduino side of udoo. I have find the file with a mounted version of my bootable udooneo sdcard, so as to replace or to delete the file, but the problem still remains.
    The sure solution is to format the sd card and to rewrite the bootable sd card of udooneo.
    Now everything seems normal, but i have to download and copy all my files to udoo from scratch.
    Anyway, thank you all for the help provided.
     
  11. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    Then there was a problem with your image or SD card. Removing the m4last.fw should solve the problem of not able to stop the sketch.
    Next time you could serial debug the Linux boot with UART 1. Or on the SD card look into the Linux log files to see what is going wrong.
     

Share This Page