Cannot install app after the first one



  • Hi,
    (macOS Sierra; Mono Maker m3; SDK 1.2)

    First time I compiled an app, it works fine. If I do a factory reset (hold down reset, press button), it's fine for the next install.

    However, make install fails after that, until I do another factory reset.

    $ make install
    Programming app to device...
    /usr/local/openmono/monoprog/monoprog.app/Contents/MacOS/monoprog -p wifi_tutorial.elf --verbose 1
    Resetting Mono device to start bootloader
    Programming Mono device with wifi_tutorial.elf...........
    Mono device not detected on USB ports.
    No connection to Mono device.
    make: *** [install] Error 2
    

    Now it is finding the device initially, as if I disconnect it entirely, I get the same behaviour but without Resetting Mono device to start bootloader. It seems to me to be resetting it and then not finding it after that. A timing thing, maybe?

    With an excessive verbosity:

    $ /usr/local/openmono/monoprog/monoprog.app/Contents/MacOS/monoprog -p wifi_tutorial.elf --verbose 255
    Total number of ports available: 3
    Port: serial1
    Location: /dev/cu.serial1
    Description: Built-in Serial Port (1)
    Manufacturer: N/A
    Vendor Identifier: N/A
    Product Identifier: N/A
    Busy: No
    Port: Bluetooth-Incoming-Port
    Location: /dev/cu.Bluetooth-Incoming-Port
    Description: incoming port - Bluetooth-Incoming-Port
    Manufacturer: N/A
    Vendor Identifier: N/A
    Product Identifier: N/A
    Busy: No
    Port: usbmodem1D111
    Location: /dev/cu.usbmodem1D111
    Description: Mono Serial Port
    Manufacturer: Monolit ApS
    Vendor Identifier: 4b4
    Product Identifier: f232
    Busy: No
    Mono detected on serial bus.
    Resetting Mono device to start bootloader
    Programming Mono device with wifi_tutorial.elf
    ElfProgrammer wifi_tutorial.elf
    SiliconId: 2e16a069
    Program: 2200-1d180
    Config: 80000440-80000fa0
    Meta: 3ffc0-40000
    Looking for Mono as a USB device............
    Mono device not detected on USB ports.
    No connection to Mono device.
    

    ???



  • Hi @_gid

    Thanks for the useful logs. I suspect the issue here is that you have some sort of while(1) loop in your code.

    The USB Serial port seems not to be able to reset mono into bootloader. If your create your own run loop of any kind, you break the ability to reset via USB.

    See Resets and Reconnects in our developer documentation.

    If you do not use any kind of while(1) in our app, them the issue must be another. If so, I would need to take a look at your code.



  • Hi,

    Hardware reset performed, followed by "Force Bootloader". Then:

    bash-3.2$ monomake project hello_world
    Creating new mono project: hello_world...
     * hello_world/app_controller.h
     * hello_world/app_controller.cpp
    Writing Makefile: hello_world/Makefile...
    Atom Project Settings: Writing Auto complete includes...
    
    bash-3.2$ cd hello_world/
    
    bash-3.2$ make
    creating build directory
    Compiling C++: app_controller.cpp
    Compiling C++: Default main function
    Linking hello_world.elf
    bash-3.2$ make install
    Programming app to device...
    /usr/local/openmono/monoprog/monoprog.app/Contents/MacOS/monoprog -p hello_world.elf --verbose 1
    Programming Mono device with hello_world.elf..................................................................................................................................................................................................................................................................................................................................................................................................
    

    Hello World app has installed and is running. Now, without anything else done:

    bash-3.2$ make
    make: Nothing to be done for `all'.
    
    bash-3.2$ make install
    Programming app to device...
    /usr/local/openmono/monoprog/monoprog.app/Contents/MacOS/monoprog -p hello_world.elf --verbose 1
    Resetting Mono device to start bootloader
    Programming Mono device with hello_world.elf...........
    Mono device not detected on USB ports.
    No connection to Mono device.
    make: *** [install] Error 2
    
    bash-3.2$ 
    

    As you can see, the code is just the standard Hello World. I haven't actually got as far as writing any custom code yet... the only thing that's been on this device is Hello World and the initial Wifi Tutorial app, showing "Network Ready".



  • @_gid OK, something seems yo be cause Mono not to reset or monoprog times out before mono has booted the bootloader.

    Try to see if you can reset Mono using the USB Serial DTR line:

    $ monomake reboot
    

    A Mono running the "hello world" app should reset when running this command. Can you see if Mono resets?



  • It doesn't seem to do anything...

    bash-3.2$ monomake reboot
    using port: /dev/cu.usbmodem1D111
    bash-3.2$ 
    

    and the screen just continues to say Hi, I'm Mono! without a flicker. And, just in case this helps:

    bash-3.2$ monomake bootldr
    Mono device running app detected.
    bash-3.2$ 
    

    I've just managed to fix my MacBook Pro that's running El Capitan, so I can try that shortly.



  • I've verified the same behaviour on my MacBook Pro, running El Capitan. It has never had the device plugged in or the SDK installed.

    I installed OpenMono-v1.2-Mac.pkg, ran monomake project hello_world; make; make install and it failed in the same way.

    I performed a "Force Bootloader" and make install worked.

    A second make install failed in the same way.



  • Seeing the same behavior here macOS Sierra, mono SDK 1.2.



  • Hi @_gid & @allan

    I found out it seems to be an issue introduced in SDK 1.2!
    Could you try to upgrade to the coming 1.3 release

    Let me know if it helps

    /kristoffer



  • @stoffera That seems to have fixed it, thanks.

    To clarify, it didn't work with the existing SDK 1.2 compiled app installed, so I did a button + reset restart, then make install, and then a subsequent make install and it worked.



  • SDK 1.3 fixed it for me.



  • HI @allan & @_gid ,

    The SDK 1.3 you tried mistakenly announces itself (monomake version) as version 1.2.1 on Mac. (Things went a little fast Tuesday)

    I have uploaded a new build of the package (same link as previous)



  • @stoffera hah, it sure does. I hadn't noticed :)


Log in to reply