15 Replies Latest reply on Jul 21, 2015 10:43 AM by Jimmy Manley

    Sketch.elf has 0 bytes after reboot (Edison kit for Arduino)

    RoyRutten Green Belt

      Hi,

       

      I'm fairly new to the Arduino / Edison stuff, so this might be a simple issue but can't seem to figure it out. After uploading the blink application to the break out board, it runs just fine. If I toggle power to the board, most of the time the blink application does not start, I need to upload it again from the Arduino IDE. Sometimes, but only sometimes the application seems to stay resident after reboot (as it should). In that case I can disconnect the board from power as often as I like, the blink app keeps starting up. However most of the time it doesn't startup after reboot after uploading from Arduino. If I look at the sketch.elf file with Putty, it's filesize is 0 bytes in that case.

       

      I'm not able to reproduce this issue, if I upload the sketch (blink app runs), power toggle and wait for the app to start, it will start maybe 1 in 10 or 15 times.

       

      I've updated to the latest firmware (Edison). Also I used the latest version of the Arduino IDE.

       

      Help is greatly appreciated!

       

      Thanks a lot in advance.

       

      Best regards,

      Roy

        • Re: Sketch.elf has 0 bytes after reboot (Edison kit for Arduino)
          Jimmy Manley Brown Belt

          Hello Roy,

           

          Welcome to the Intel Embedded Community.

          We are currently working in your case and will contact you with additional information as soon as possible.

           

          Regards,

           

          Jimmy Manley.

          • Re: Sketch.elf has 0 bytes after reboot (Edison kit for Arduino)
            Jimmy Manley Brown Belt

            Hi Roy,

             

            One thing that may be happening is that the Edison has run out of available space. Could you check if this is the case by using the "df" command. Could you provide us with a screenshot of the result from this command.

             

            Did something went wrong while you flashed the board (i.e. you received an error message or the like)?

             

            Thank you.

             

            Regards,

             

            Jimmy.

              • Re: Sketch.elf has 0 bytes after reboot (Edison kit for Arduino)
                RoyRutten Green Belt

                Hi Jimmy,

                 

                Thanks for your reply!

                 

                Some additional info: I'm using both micro USB ports and external power supply. USB cables are only 0.5 meters long. Tried without the power supply, but does't work either.

                 

                This is the result of the df command:

                df.jpg

                 

                Furthermore, this is the upload log of the sketch:

                 

                Upload log sketch

                 

                #!/bin/sh

                starting download script

                 

                 

                # clupload script to invoke lsz

                # Copyright (C) 2014 Intel Corporation

                #

                Args to shell: C:\Users\roy.rutten\AppData\Roaming\Arduino15\packages\Intel\tools\sketchUploader\1.6.2+1.0/x86/bin C:\Users\ROY~1.RUT\AppData\Local\Temp\build1398282619045844359.tmp/Blink.cpp.elf COM7

                # This library is free software; you can redistribute it and/or

                COM PORT 7

                # modify it under the terms of the GNU Lesser General Public

                Converted COM Port COM7 to tty port /dev/ttyS6

                # License as published by the Free Software Foundation; either

                Sending Command String to move to download if not already in download mode

                # version 2.1 of the License, or (at your option) any later version.

                #

                # This library is distributed in the hope that it will be useful,

                # but WITHOUT ANY WARRANTY; without even the implied warranty of

                # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU

                # Lesser General Public License for more details.

                #

                # You should have received a copy of the GNU Lesser General Public

                # License along with this library; if not, write to the Free Software

                # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA

                #

                 

                 

                echo "starting download script"

                echo "Args to shell:" $*

                 

                 

                Deleting existing sketch on target

                # ARG 1: Path to lsz executable.

                # ARG 2: Elf File to download

                # ARG 3: COM port to use.

                 

                 

                #path contains \ need to change all to /

                path_to_exe=$1

                fixed_path=${path_to_exe//\\/\/}

                 

                 

                #COM ports are not always setup to be addressed via COM for redirect.

                #/dev/ttySx are present. Howwever, COMy -> /dev/ttySx where x = y - 1

                 

                 

                com_port_arg=$3

                com_port_id=${com_port_arg/COM/}

                echo "COM PORT" $com_port_id

                tty_port_id=/dev/ttyS$((com_port_id-1))

                echo "Converted COM Port" $com_port_arg "to tty port" $tty_port_id

                 

                 

                echo "Sending Command String to move to download if not already in download mode"

                echo "~sketch downloadEdison" > $tty_port_id

                 

                 

                #Move the existing sketch on target.

                echo "Deleting existing sketch on target"

                "$fixed_path/lsz.exe" --escape -c "mv -f /sketch/sketch.elf /sketch/sketch.elf.old" <> $tty_port_id 1>&0

                 

                 

                Transfer complete

                # Execute the target download command

                 

                 

                #Download the file.

                host_file_name=$2

                "$fixed_path/lsz.exe" --escape --binary --overwrite $host_file_name <> $tty_port_id 1>&0

                Sending: Blink.cpp.elf

                 

                 

                Bytes Sent:   1024/  75668   BPS:-2147483648 ETA 00:00 

                Bytes Sent:   9216/  75668   BPS:-2147483648 ETA 00:00 

                Bytes Sent:  10240/  75668   BPS:-2147483648 ETA 00:00 

                Bytes Sent:  11264/  75668   BPS:-2147483648 ETA 00:00 

                Bytes Sent:  12288/  75668   BPS:787387   ETA 00:00 

                Bytes Sent:  13312/  75668   BPS:853002   ETA 00:00 

                Bytes Sent:  14336/  75668   BPS:918618   ETA 00:00 

                Bytes Sent:  15360/  75668   BPS:984234   ETA 00:00 

                Bytes Sent:  16384/  75668   BPS:1049849  ETA 00:00 

                Bytes Sent:  17408/  75668   BPS:1115465  ETA 00:00 

                Bytes Sent:  18432/  75668   BPS:1181080  ETA 00:00 

                Bytes Sent:  19456/  75668   BPS:1246696  ETA 00:00 

                Bytes Sent:  20480/  75668   BPS:1312312  ETA 00:00 

                Bytes Sent:  21504/  75668   BPS:1377927  ETA 00:00 

                Bytes Sent:  22528/  75668   BPS:1443543  ETA 00:00 

                Bytes Sent:  23552/  75668   BPS:1509159  ETA 00:00 

                Bytes Sent:  24576/  75668   BPS:1574774  ETA 00:00 

                Bytes Sent:  25600/  75668   BPS:1640390  ETA 00:00 

                Bytes Sent:  26624/  75668   BPS:1706005  ETA 00:00 

                Bytes Sent:  27648/  75668   BPS:1771621  ETA 00:00 

                Bytes Sent:  28672/  75668   BPS:1837237  ETA 00:00 

                Bytes Sent:  29696/  75668   BPS:1902852  ETA 00:00 

                Bytes Sent:  30720/  75668   BPS:1968468  ETA 00:00 

                Bytes Sent:  31744/  75668   BPS:2034083  ETA 00:00 

                Bytes Sent:  32768/  75668   BPS:1973138  ETA 00:00 

                Bytes Sent:  33792/  75668   BPS:2034799  ETA 00:00 

                Bytes Sent:  34816/  75668   BPS:2096459  ETA 00:00 

                Bytes Sent:  35840/  75668   BPS:2158120  ETA 00:00 

                Bytes Sent:  36864/  75668   BPS:2219781  ETA 00:00 

                Bytes Sent:  37888/  75668   BPS:2281441  ETA 00:00 

                Bytes Sent:  38912/  75668   BPS:2343102  ETA 00:00 

                Bytes Sent:  39936/  75668   BPS:2404762  ETA 00:00 

                Bytes Sent:  40960/  75668   BPS:2466423  ETA 00:00 

                Bytes Sent:  41984/  75668   BPS:2528084  ETA 00:00 

                Bytes Sent:  43008/  75668   BPS:2589744  ETA 00:00 

                Bytes Sent:  44032/  75668   BPS:2651405  ETA 00:00 

                Bytes Sent:  45056/  75668   BPS:2713065  ETA 00:00 

                Bytes Sent:  46080/  75668   BPS:2774726  ETA 00:00 

                Bytes Sent:  47104/  75668   BPS:2836386  ETA 00:00 

                Bytes Sent:  48128/  75668   BPS:2733451  ETA 00:00 

                Bytes Sent:  49152/  75668   BPS:2641438  ETA 00:00 

                Bytes Sent:  50176/  75668   BPS:2558949  ETA 00:00 

                Bytes Sent:  51200/  75668   BPS:2484466  ETA 00:00 

                Bytes Sent:  52224/  75668   BPS:2416766  ETA 00:00 

                Bytes Sent:  53248/  75668   BPS:2355163  ETA 00:00 

                Bytes Sent:  54272/  75668   BPS:2205278  ETA 00:00 

                Bytes Sent:  55296/  75668   BPS:2159152  ETA 00:00 

                Bytes Sent:  56320/  75668   BPS:2039763  ETA 00:00 

                Bytes Sent:  57344/  75668   BPS:2004191  ETA 00:00 

                Bytes Sent:  58368/  75668   BPS:1906700  ETA 00:00 

                Bytes Sent:  59392/  75668   BPS:1878718  ETA 00:00 

                Bytes Sent:  60416/  75668   BPS:1852510  ETA 00:00 

                Bytes Sent:  61440/  75668   BPS:1775002  ETA 00:00 

                Bytes Sent:  62464/  75668   BPS:1753914  ETA 00:00 

                Bytes Sent:  63488/  75668   BPS:1733932  ETA 00:00 

                Bytes Sent:  64512/  75668   BPS:1715058  ETA 00:00 

                Bytes Sent:  65536/  75668   BPS:1697118  ETA 00:00 

                Bytes Sent:  66560/  75668   BPS:1638761  ETA 00:00 

                Bytes Sent:  67584/  75668   BPS:1623950  ETA 00:00 

                Bytes Sent:  68608/  75668   BPS:1609872  ETA 00:00 

                Bytes Sent:  69632/  75668   BPS:1596403  ETA 00:00 

                Bytes Sent:  70656/  75668   BPS:1583574  ETA 00:00 

                Bytes Sent:  71680/  75668   BPS:1571308  ETA 00:00 

                Bytes Sent:  72704/  75668   BPS:1593755  ETA 00:00 

                Bytes Sent:  73728/  75668   BPS:1548288  ETA 00:00 

                Bytes Sent:  74752/  75668   BPS:1569792  ETA 00:00 

                Bytes Sent:  75668   BPS:947839                         

                 

                 

                Transfer complete

                 

                 

                #mv the downloaded file to /sketch/sketch.elf

                Moving downloaded file to /sketch/sketch.elf on target

                target_download_name="${host_file_name##*/}"

                echo "Moving downloaded file to /sketch/sketch.elf on target"

                "$fixed_path/lsz.exe" --escape -c "mv $target_download_name /sketch/sketch.elf; chmod +x /sketch/sketch.elf" <> $tty_port_id 1>&0

                 

                 

                Transfer complete

                 

                 

                 

                I've also included the linux boot log (what appears in Putty after resetting the board, after uploading the sketch).

                 

                Linux boot log

                 

                ******************************

                PSH KERNEL VERSION: b0182b2b

                                WR: 20104000

                ******************************

                 

                 

                SCU IPC: 0x800000d0  0xfffce92c

                 

                 

                PSH miaHOB version: TNG.B0.VVBD.0000000c

                 

                 

                microkernel built 11:24:08 Feb  5 2015

                 

                 

                ******* PSH loader *******

                PCM page cache size = 192 KB

                Cache Constraint = 0 Pages

                Arming IPC driver ..

                Adding page store pool ..

                PagestoreAddr(IMR Start Address) = 0x04899000

                pageStoreSize(IMR Size)          = 0x00080000

                 

                 

                *** Ready to receive application ***

                 

                 

                 

                 

                U-Boot 2014.04 (Apr 29 2015 - 03:53:19)

                 

                 

                       Watchdog enabled

                DRAM:  980.6 MiB

                MMC:   tangier_sdhci: 0

                In:    serial

                Out:   serial

                Err:   serial

                Hit any key to stop autoboot:  0

                Target:blank

                Partitioning already done...

                Flashing already done...

                GADGET DRIVER: usb_dnl_dfu

                reading vmlinuz

                5383904 bytes read in 133 ms (38.6 MiB/s)

                Valid Boot Flag

                Setup Size = 0x00003c00

                Magic signature found

                Using boot protocol version 2.0c

                Linux kernel version 3.10.17-poky-edison+ (sys_dswci@tlsndgbuild004) #1 SMP PREE                   MPT Wed Apr 29 03:54:01 CEST 2015

                Building boot_params at 0x00090000

                Loading bzImage at address 00100000 (5368544 bytes)

                Magic signature found

                Kernel command line: "rootwait root=PARTUUID=012b3303-34ac-284d-99b4-34e03a2335f                   4 rootfstype=ext4 console=ttyMFD2 earlyprintk=ttyMFD2,keep loglevel=4 g_multi.et                   hernet_config=rndis systemd.unit=multi-user.target hardware_id=00 g_multi.iSeria                   lNumber=a9a3c568d7504aea1b1c17a935b119de g_multi.dev_addr=02:00:86:b1:19:de plat                   form_mrfld_audio.audio_codec=dummy"

                 

                 

                Starting kernel ...

                 

                 

                [    0.760311] pca953x 1-0020: failed reading register

                [    1.654628] snd_soc_sst_platform: Enter:sst_soc_probe

                [    2.058447] pmic_ccsm pmic_ccsm: Error reading battery profile from battid fr                   mwrk

                [    2.076609] pmic_ccsm pmic_ccsm: Battery Over heat exception

                 

                 

                Welcome to Linux!

                 

                 

                         Expecting device dev-ttyMFD2.device...

                [  OK  ] Reached target Remote File Systems.

                         Expecting device dev-disk-by\x2dpartlabel-factory.device...

                         Expecting device sys-subsystem-net-devices-usb0.device...

                [  OK  ] Reached target Paths.

                [  OK  ] Set up automount Arbitrary Executable File Formats F...utomount Point.

                [  OK  ] Reached target Swap.

                [  OK  ] Set up automount boot.automount.

                [  OK  ] Created slice Root Slice.

                [  OK  ] Listening on Journal Socket.

                [  OK  ] Listening on udev Kernel Socket.

                [  OK  ] Listening on /dev/initctl Compatibility Named Pipe.

                [  OK  ] Listening on udev Control Socket.

                [  OK  ] Listening on Delayed Shutdown Socket.

                [  OK  ] Created slice User and Session Slice.

                [  OK  ] Created slice System Slice.

                         Starting Create list of required static device nodes...rrent kernel...

                         Starting Apply Kernel Variables...

                         Mounting POSIX Message Queue File System...

                         Mounting Debug File System...

                         Starting udev Coldplug all Devices...

                         Starting Journal Service...

                [  OK  ] Started Journal Service.

                         Starting Load Kernel Modules...

                [  OK  ] Reached target Slices.

                         Starting Remount Root and Kernel File Systems...

                [  OK  ] Created slice system-getty.slice.

                [  OK  ] Created slice system-serial\x2dgetty.slice.

                         Mounting Temporary Directory...

                [  OK  ] Set up automount home.automount.

                [  OK  ] Mounted Debug File System.

                [  OK  ] Mounted POSIX Message Queue File System.

                [  OK  ] Mounted Temporary Directory.

                [  OK  ] Started Create list of required static device nodes ...current kernel.

                [  OK  ] Started Apply Kernel Variables.

                [  OK  ] Started Remount Root and Kernel File Systems.

                [  OK  ] Started udev Coldplug all Devices.

                         Starting Load/Save Random Seed...

                         Starting Create Static Device Nodes in /dev...

                [  OK  ] Started Load Kernel Modules.

                [  OK  ] Started Load/Save Random Seed.

                [  OK  ] Started Create Static Device Nodes in /dev.

                         Starting udev Kernel Device Manager...

                [  OK  ] Reached target Local File Systems (Pre).

                         Mounting /var/volatile...

                         Mounting FUSE Control File System...

                         Mounting Configuration File System...

                [  OK  ] Mounted Configuration File System.

                [  OK  ] Mounted FUSE Control File System.

                [  OK  ] Mounted /var/volatile.

                [  OK  ] Started udev Kernel Device Manager.

                [  OK  ] Reached target Local File Systems.

                         Starting Trigger Flushing of Journal to Persistent Storage...

                         Starting Create Volatile Files and Directories...

                [  OK  ] Found device /dev/ttyMFD2.

                [  OK  ] Started Trigger Flushing of Journal to Persistent Storage.

                [  OK  ] Started Create Volatile Files and Directories.

                [  OK  ] Found device /dev/disk/by-partlabel/factory.

                [  OK  ] Reached target Sound Card.

                         Mounting Mount for factory...

                         Starting Network Time Synchronization...

                         Starting Update UTMP about System Boot/Shutdown...

                [  OK  ] Mounted Mount for factory.

                [  OK  ] Started Network Time Synchronization.

                [  OK  ] Started Update UTMP about System Boot/Shutdown.

                [  OK  ] Found device /sys/subsystem/net/devices/usb0.

                [  OK  ] Created slice system-systemd\x2drfkill.slice.

                         Starting Load/Save RF Kill Switch Status of rfkill2...

                         Starting Load/Save RF Kill Switch Status of rfkill1...

                         Starting Load/Save RF Kill Switch Status of rfkill0...

                [  OK  ] Created slice system-systemd\x2dfsck.slice.

                         Starting File System Check on /dev/disk/by-partlabel/home...

                [  OK  ] Started Load/Save RF Kill Switch Status of rfkill2.

                [  OK  ] Started Load/Save RF Kill Switch Status of rfkill1.

                [  OK  ] Started Load/Save RF Kill Switch Status of rfkill0.

                [    7.996176] systemd-fsck[177]: /dev/mmcblk0p10: recovering journal

                [  OK  ] Reached target System Initialization.

                [  OK  ] Reached target Timers.

                [  OK  ] Listening on D-Bus System Message Bus Socket.

                         Starting Restore Sound Card State...

                [  OK  ] Listening on sshd.socket.

                [    8.089519] systemd-fsck[177]: /dev/mmcblk0p10: clean, 15/87120 files, 14184/                   348155 blocks

                [  OK  ] Reached target Sockets.

                [  OK  ] Reached target Basic System.

                         Starting Crashlog service...

                [  OK  ] Started Crashlog service.

                         Starting Edison PWR button handler...

                [  OK  ] Started Edison PWR button handler.

                         Starting Daemon to handle arduino sketches...

                [  OK  ] Started Daemon to handle arduino sketches.

                         Starting Start or stop WiFI AP Mode in Edison...

                [  OK  ] Started Start or stop WiFI AP Mode in Edison.

                         Starting Bluetooth rf kill event daemon...

                [  OK  ] Started Bluetooth rf kill event daemon.

                         Starting Daemon to reset sketches...

                [  OK  ] Started Daemon to reset sketches.

                         Starting Daemon to load edison mcu app binary...

                [  OK  ] Started Daemon to load edison mcu app binary.

                         Starting D-Bus System Message Bus...

                Application available at (physical) address 0x04819000

                        VRL mapped to 0xff217000

                        App size = 11508 bytes

                 

                 

                        App Authentication feature is disabled!

                        Resetting IPC

                 

                 

                *** Ready to receive application ***

                [  OK  ] Started D-Bus System Message Bus.

                         Starting Network Service...

                         Starting Login Service...

                         Starting Permit User Sessions...

                         Starting Cleanjournal service...

                [  OK  ] Started Cleanjournal service.

                         Starting Watchdog sample daemon...

                [  OK  ] Started Watchdog sample daemon.

                [  OK  ] Started Network Service.

                [  OK  ] Started File System Check on /dev/disk/by-partlabel/home.

                [  OK  ] Started Permit User Sessions.

                         Mounting Arbitrary Executable File Formats File System...

                         Starting Getty on tty1...

                [  OK  ] Started Getty on tty1.

                         Starting Serial Getty on ttyMFD2...

                [  OK  ] Started Serial Getty on ttyMFD2.

                [  OK  ] Reached target Login Prompts.

                         Mounting /home...

                         Starting Network Name Resolution...

                [  OK  ] Reached target Network.

                         Starting Zero-configuration networking...

                         Starting Mosquitto - lightweight server implementati...SN protocols...

                [  OK  ] Mounted Arbitrary Executable File Formats File System.

                [  OK  ] Mounted /home.

                [  OK  ] Started Network Name Resolution.

                [  OK  ] Started Mosquitto - lightweight server implementatio...T-SN protocols.

                [  OK  ] Started Login Service.

                [  OK  ] Started Zero-configuration networking.

                         Starting The Edison status and configuration service...

                [  OK  ] Started The Edison status and configuration service.

                         Starting Intel_XDK_Daemon...

                [  OK  ] Started Intel_XDK_Daemon.

                         Starting File System Check on /dev/disk/by-partlabel/boot...

                [  OK  ] Started Restore Sound Card State.

                [   11.386513] systemd-fsck[251]: dosfsck 2.11, 12 Mar 2005, FAT32, LFN

                [   11.388949] systemd-fsck[251]: /dev/mmcblk0p7: 5 files, 2717/2947 clusters

                         Starting PulseAudio Sound System...

                [  OK  ] Started File System Check on /dev/disk/by-partlabel/boot.

                         Mounting /boot...

                [  OK  ] Mounted /boot.

                         Starting Bluetooth service...

                [  OK  ] Started PulseAudio Sound System.

                [  OK  ] Started Bluetooth service.

                         Starting Hostname Service...

                [  OK  ] Reached target Multi-User System.

                [  OK  ] Started Hostname Service.

                 

                 

                Poky (Yocto Project Reference Distro) 1.6.1 edison ttyMFD2

                 

                 

                edison login:

                 

                 

                Best regards,

                 

                Roy