How to refresh a sketch

Discussion in 'UDOO NEO' started by Gorgo, Nov 19, 2016.

  1. Gorgo

    Gorgo UDOOer

    Joined:
    Nov 9, 2016
    Messages:
    159
    Likes Received:
    17
    Hi guys,
    I'm trying to find an easier way to upload my sketch.
    If there's some running bug inside and the sketch goes to some infinite loop/fork bomb, the only way to upload a new sketch is:
    - Connect to UDOO via serial or ssh
    Code:
    sudo rm /var/opt/m4/m4last.fw
    Code:
    sudo reboot 
    If I try to upload a new sketch with ArduinoIDE, without deleting m4last+reboot, from my lapto, it always fails.
     
  2. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    In the arduino Board manager for Neo there is Udoo fota: https://github.com/UDOOboard/udoofota?files=1

    I did not look into the sources very well but perhaps there is already this option in the Udoo client.c else you could make one yourself.
     
  3. Gorgo

    Gorgo UDOOer

    Joined:
    Nov 9, 2016
    Messages:
    159
    Likes Received:
    17
    I'm wondering why grounding the RST pin using a jumper doesn't restart the sketch.
     
  4. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    What RST pin? I know of a RST switch on the Neo, it will reset the complete board. And load the last compiled and uploaded Arduino sketch into M4 memory.

    So that is why I suggested to extend the Udoofota client with some kind of reset function.
     
  5. menegolli

    menegolli New Member

    Joined:
    Nov 22, 2016
    Messages:
    4
    Likes Received:
    1
    waltervl likes this.
  6. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    I totally looked over that Arduino RST pin! What I read from the original Arduino Uno it resets the Arduino and runs the last loaded code.

    I am not close to my Neo but pulling the RST pin low does it do anything? Your last sentence is not clear to me.

    From the schedule I read that the RST pin is connected to Master_RST which suspects it is connected to the reset button on the Neo. Which performs the same function as the reset on a original Arduino Uno.

    If this is true it is not possible to give another function to the Arduino RST pin as it is physically connected to the master RST button.

    Then there is only the possibility to use the process used by the Udoo to upload and reset sketches named Udoofota and add the refresh functionality ( remove m4last.fw file and reboot Udoo)
     
  7. menegolli

    menegolli New Member

    Joined:
    Nov 22, 2016
    Messages:
    4
    Likes Received:
    1
    I do not want to give that pin another functionality, I am just wondering why it is doing nothing when I connect it to GND
     
  8. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    I understand that. After having a closer look to the schematics I see that the RST pin (MASTER_RST) is not connected to the reset button (PWRON) on the Neo but to NVCC_GPIO GPIO_11. So probably nothing is monitoring that pin. Someone at Udoo team knows?
    @Andrea Rovai

    So if it should be possible to have that RST pin doing something, what Reset function do you want to have?
    1. Reboot Arduino M4 part with last compiled (perhaps erroneous) sketch. Almost the same as the normal Neo reset button.
    2. Reboot Arduino M4 part without a sketch, but leave the /var/opt/m4/m4last.fw file in place. Now should be able to upload the same or a new sketch into the M4
    3. Reboot Arduino M4 part and remove file /var/opt/m4/m4last.fw (requested by @Gorgo ) This is a bit difficult because then the M4 part should delete something on the A9 Linux side.

    Any more options to be added?
     
  9. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    No more need for this option?
     
  10. Gorgo

    Gorgo UDOOer

    Joined:
    Nov 9, 2016
    Messages:
    159
    Likes Received:
    17
    Why not? I think option 2 (if the third one is too difficult to accomplish) is useful.
     
  11. waltervl

    waltervl UDOOer

    Joined:
    Dec 12, 2015
    Messages:
    2,314
    Likes Received:
    580
    It is a discussion forum so I expected some feedback. I am not a developer so I just wanted to set some specs for someone that could develop this.
     
    Gorgo likes this.
  12. Gorgo

    Gorgo UDOOer

    Joined:
    Nov 9, 2016
    Messages:
    159
    Likes Received:
    17
    Sorry waltervl, I thought you wanted to give up this function ;)
     

Share This Page