OpenSprinkler Forums OpenSprinkler Unified Firmware Issues uploading new OS firmware

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #37093

    Brian
    Participant

    Hi folks,

    I have been attempting to upload the latest (Arduino-based) OS development build from Github onto my OS 2.3, but have been running into issues. Details of my first attempt are captured in another thread here. I made another attempt today using the VirtualBox VM image from Ray (following the instructions detailed here). In both attempts I had no issues compiling the code, but when attempting to upload to the OS, I ran into errors. My second attempt with the VirtualBox VM appears to have a bit more in the debug output, but appears to have died at the same point in the upload. Full debug output from the VM upload follows:

    Binary sketch size: 57,834 bytes (of a 130,048 byte maximum)

    /home/opensprinkler/Desktop/OpenSprinklerGen2/arduino-1.0.5/hardware/tools/avrdude -C/home/opensprinkler/Desktop/OpenSprinklerGen2/arduino-1.0.5/hardware/tools/avrdude.conf -v -v -v -v -patmega1284p -carduino -P/dev/ttyUSB0 -b115200 -D -Uflash:w:/tmp/build5293906134277966278.tmp/mainArduino.cpp.hex:i

     

    avrdude: Version 5.11, compiled on Sep  7 2011 at 19:34:16

    Copyright (c) 2000-2005 Brian Dean, http://www.bdmicro.com/

    Copyright (c) 2007-2009 Joerg Wunsch

     

    System wide configuration file is “/home/opensprinkler/Desktop/OpenSprinklerGen2/arduino-1.0.5/hardware/tools/avrdude.conf”

    User configuration file is “/home/opensprinkler/.avrduderc”

    User configuration file does not exist or is not a regular file, skipping

     

    Using Port                    : /dev/ttyUSB0

    Using Programmer              : arduino

    Overriding Baud Rate          : 115200

    avrdude: Send: 0 [30]   [20]

    avrdude: Send: 0 [30]   [20]

    avrdude: Send: 0 [30]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [10]

    AVR Part                      : ATMEGA1284P

    Chip Erase delay              : 9000 us

    PAGEL                         : PD7

    BS2                           : PA0

    RESET disposition             : dedicated

    RETRY pulse                   : SCK

    serial program mode           : yes

    parallel program mode         : yes

    Timeout                       : 200

    StabDelay                     : 100

    CmdexeDelay                   : 25

    SyncLoops                     : 32

    ByteDelay                     : 0

    PollIndex                     : 3

    PollValue                     : 0x53

    Memory Detail                 :

     

    Block Poll               Page                       Polled

    Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

    ———– —- —– —– —- —— —— —- —— —– —– ———

    eeprom        65    10   128    0 no       4096    8      0  9000  9000 0xff 0xff

    Block Poll               Page                       Polled

    Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

    ———– —- —– —– —- —— —— —- —— —– —– ———

    flash         65    10   256    0 yes    131072  256    512  4500  4500 0xff 0xff

    Block Poll               Page                       Polled

    Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

    ———– —- —– —– —- —— —— —- —— —– —– ———

    lock           0     0     0    0 no          1    0      0  9000  9000 0x00 0x00

    Block Poll               Page                       Polled

    Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

    ———– —- —– —– —- —— —— —- —— —– —– ———

    lfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00

    Block Poll               Page                       Polled

    Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

    ———– —- —– —– —- —— —— —- —— —– —– ———

    hfuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00

    Block Poll               Page                       Polled

    Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

    ———– —- —– —– —- —— —— —- —— —– —– ———

    efuse          0     0     0    0 no          1    0      0  9000  9000 0x00 0x00

    Block Poll               Page                       Polled

    Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

    ———– —- —– —– —- —— —— —- —— —– —– ———

    signature      0     0     0    0 no          3    0      0     0     0 0x00 0x00

    Block Poll               Page                       Polled

    Memory Type Mode Delay Size  Indx Paged  Size   Size #Pages MinW  MaxW   ReadBack

    ———– —- —– —– —- —— —— —- —— —– —– ———

    calibration    0     0     0    0 no          1    0      0     0     0 0x00 0x00

     

    Programmer Type : Arduino

    Description     : Arduino

    avrdude: Send: A [41] . [80]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [03]

    avrdude: Recv: . [10]

    avrdude: Send: A [41] . [81]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [04]

    avrdude: Recv: . [10]

    avrdude: Send: A [41] . [82]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [05]

    avrdude: Recv: . [10]

    avrdude: Send: A [41] . [98]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [03]

    avrdude: Recv: . [10]

    Hardware Version: 3

    Firmware Version: 4.5

    avrdude: Send: A [41] . [84]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [03]

    avrdude: Recv: . [10]

    avrdude: Send: A [41] . [85]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [03]

    avrdude: Recv: . [10]

    avrdude: Send: A [41] . [86]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [03]

    avrdude: Recv: . [10]

    avrdude: Send: A [41] . [87]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [03]

    avrdude: Recv: . [10]

    avrdude: Send: A [41] . [89]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [03]

    avrdude: Recv: . [10]

    Vtarget         : 0.3 V

    Varef           : 0.3 V

    Oscillator      : 28.800 kHz

    SCK period      : 3.3 us

     

    avrdude: Send: A [41] . [81]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [04]

    avrdude: Recv: . [10]

    avrdude: Send: A [41] . [82]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [05]

    avrdude: Recv: . [10]

    avrdude: Send: B [42] . [82] . [00] . [00] . [01] . [01] . [01] . [01] . [03] . [ff] . [ff] . [ff] . [ff] . [01] . [00] . [10] . [00] . [00] . [02] . [00] . [00]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [10]

    avrdude: Send: E [45] . [05] . [08] . [d7] . [a0] . [00]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [10]

    avrdude: Send: P [50]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [10]

    avrdude: AVR device initialized and ready to accept instructions

     

    Reading | avrdude: Send: u [75]   [20]

    avrdude: Recv: . [14] . [1e] . [97] . [05] . [10]

    ################################################## | 100% 0.00s

     

    avrdude: Device signature = 0x1e9705

    avrdude: Send: V [56] . [a0] . [0f] . [fc] . [00]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [00]

    avrdude: Recv: . [10]

    avrdude: Send: V [56] . [a0] . [0f] . [fd] . [00]   [20]

    avrdude: Recv: . [14]

    avrdude: Recv: . [00]

    avrdude: Recv: . [10]

    avrdude: Send: V [56] . [a0] . [0f] . [fe] . [00]   [20]

    avrdude: ser_recv(): programmer is not responding

    avrdude: stk500_recv(): programmer is not responding

     

    Any recommendations on what I should try next?

     

    #37171

    Ray
    Keymaster

    Is there any reason you added -D (i.e. not erase flash)? Can you remove that option and try again?

    #37242

    Brian
    Participant

    Hi Ray,

    The -D was added by the IDE, not by me intentionally, but I can try running avrdude from the command line and exclude this option once I have access to my OS again in a couple weeks.

     

    #37253

    Ray
    Keymaster

    OK, I am a bit surprised that it’s adding -D, because it should usually do a flash erase before uploading a new firmware. Alternatively, try or OpenSprinkler Firmware Updater, which is basically a GUI wrapper for the avrdude command.

    #37573

    Brian
    Participant

    Hi Ray,

    I managed to flash the 2.1.4 firmware but it took some doing.

    After multiple attempts upon returning from my trip, I couldn’t get the OS firmware updater to work properly on my Mac, or on the virtualbox VM (hosted on the same machine) due to issues with the USB serial port. The issue appears to be related to a problem with the CH341 driver for OSX Yosemite (downloaded from here: http://raysfiles.com/drivers/ch341ser_mac.zip as referenced in the firmware update instructions PDF: https://github.com/rayshobby/osFWUpdater/raw/master/Instructions.pdf). As with my earlier attempt using the IDE, the avrdude process spawned by osFWUpdater seemed to get stuck when attempting to communicate with the OS, and would only end if killed. The OS firmware updater binary is 64 bit and would not run on the VirtualBox VM. I also failed at getting it to compile on this VM due to what appear to be QT4 library incompatibilities.

    I then attempted to use an old netbook running Ubuntu 14.04 LTS which I had previously attempted and failed at compiling the OS firmware on with the 1.0.5 Arduino IDE. Since this machine is also 32-bit, I had to re-compile the OS firmware updater, but also ran into issues compiling (see below). What ultimately ended up working was using avrdude that was included in the 1.0.5 Arduino IDE I had previously installed, and the firmware included in the OS firmware updater package for my hardware version as follows:

    sudo avrdude -v -v -v -v -p atmega1284p -c arduino -P /dev/ttyUSB0 -b 115200 -U flash:w:Firmwares/OpenSprinkler_v2.3/firmware2.1.4.hex:i

    I haven’t tried uploading the pre-2.1.4 firmware I compiled on my Mac/VM IDEs, but have a fairly high degree of confidence it would work.

    The compile error for the OS firmware updater follows:

    brudy@brudy-mini210:~/Downloads/Firmware-Updater-master/Source$ qmake
    brudy@brudy-mini210:~/Downloads/Firmware-Updater-master/Source$ make
    g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_NO_DEBUG -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -I. -o mainwindow.o mainwindow.cpp
    In file included from /usr/include/qt4/QtGui/QComboBox:1:0,
    from ui_mainwindow.h:16,
    from mainwindow.cpp:2:
    /usr/include/qt4/QtGui/qcombobox.h: In member function ‘void MainWindow::on_btnDetect_clicked()’:
    /usr/include/qt4/QtGui/qcombobox.h:233:10: error: ‘void QComboBox::currentIndexChanged(int)’ is protected
    void currentIndexChanged(int index);
    ^
    mainwindow.cpp:51:66: error: within this context
    ui->cmbDevice->currentIndexChanged(myHandler->curr_device);
    ^
    make: *** [mainwindow.o] Error 1

    #37612

    Ray
    Keymaster

    Sorry to hear the trouble you had to go through. Two quick comments:
    1) There is actually no need to recompile osFWUpdater — it’s just a GUI for running avrdude command. You can directly run command ‘avrdude -c arduino -p m1284p -P /dev/ttyxxx -U flash:w:xxx.hex’ where /dev/ttyxxx is the serial port name, and xxx.hex is the firmware file name.
    2) I am also a bit surprised that VirtualBox in Mac doesn’t work — you should be able to pass the USB device through to the virtual system, and therefore it should be fine even if the host system doesn’t have the driver for that USB device. To do so you will need to go to the VirtualBox menu -> USB devices and select the ch340g device so that it can be passed through to the virtual system.

    #37624

    Brian
    Participant

    Thanks Ray,

    So there is no need to specify the baud rate with -b?

    It was weird. After battling the OSX driver issue in my earlier attempt using the Arduino IDE on OSX, I was eventually able to get the USB passthrough working for the VM (resulting in the debug trace in the first post of this thread). For the attempt this past weekend I kept having a problem when attempting to enable passthrough for the device it gave me an error that the device was already in use (despite multiple host and VM reboots). I have since unloaded the CH340 driver and found an (unsigned) alternative that folks seem to have success with on Yosemite. If that also doesn’t work, I’ll try unloading that driver and just using USB passthrough to the VM.

    #37753

    Ray
    Keymaster

    I think avrdude uses -b 115200 by default.

    Currently there is a signed driver for Yosemite on this website:
    https://www.mac-usb-serial.com/
    which costs several dollars. However, CodeBender.cc and I have collaborated to develop a signed driver for all versions of Mac. I am not allowed to release it to the public yet, but if you email to [email protected] I can send you the driver directly.

Viewing 8 posts - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.

OpenSprinkler Forums OpenSprinkler Unified Firmware Issues uploading new OS firmware