LoginSignup
9
9

More than 5 years have passed since last update.

Edisonを文鎮から復帰する (Oct 2015版)

Last updated at Posted at 2015-10-29

うっかり /boot を吹き飛ばしてしまい、パワーサイクルに入ってしまったEdisonを復帰するための手順です。

ちなみにこういう感じでzBootコマンドがカーネルイメージを見つけられずにリセットされます。

******************************
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 (Jun 19 2015 - 12:05:55)

       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
** Unable to read file vmlinuz **
Error: Invalid Boot Flag (found 0xffef, expected 0xaa55)
## Kernel loading failed ...
zboot - Boot bzImage

Usage:
zboot [addr] [size] [initrd addr] [initrd size]
      addr -        The optional starting address of the bzimage.
                    If not set it defaults to the environment
                    variable "fileaddr".
      size -        The optional size of the bzimage. Defaults to
                    zero.
      initrd addr - The address of the initrd image to use, if any.
      initrd size - The size of the initrd image to use, if any.

Unknown boot mode: boot
Saving Environment to MMC...
Writing to redundant MMC(0)... done
Resetting to default boot mode and reboot...
resetting ...

0. 前提

  • 2015年10月時点の情報です
  • MacOSXとEdisonはシリアルコンソールで接続します

1. 公式イメージをダウンロードする

公式サイトからYocto Linuxのイメージをダウンロードします。

2. イメージを展開

適当なところに先ほどダウンロードしたイメージを展開します。イメージには flashall.sh が含まれていることを確認してください。

cd ~/Downloads/
unzip edison-image-ww25.5-15.zip

3. フラッシュ開始 (1回目)

文鎮から復帰するためにフラッシュを開始します。と言っても、パワーサイクルに入っているのでu-bootから強制的にフラッシュモードにします。

Edisonをフラッシュモードにする

EdisonにはU-Bootというブートマネージャ(?)が組み込まれていて、起動時にいくらかのコマンドを受け付けることができます。 Hit any key to stop autoboot と表示されたタイミングで [SPACE] などを叩いて自動起動を停止します。

U-Boot 2014.04 (Jun 19 2015 - 12:05:55)

       Watchdog enabled
DRAM:  980.6 MiB
MMC:   tangier_sdhci: 0
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0  # SPACEバーを押下

run do_flash とタイプしてフラッシュモードにします。

boot > run do_flash

flashall.shの起動

flashall.shを起動して、文鎮Edisonがフラッシュモードになるのを待機します。

cd ~/Downloads/edison-image-ww25.5-15
chmod +x flashall.sh
sudo ./flashall.sh

フラッシュモードのEdisonを発見すると自動的にフラッシュが開始されます。

Using U-Boot target: edison-blankcdc
Now waiting for dfu device 8087:0a99
Please plug and reboot the board
Flashing IFWI
Copying data from PC to DFU device
Download    [=========================] 100%      4194304 bytes
Flashing U-Boot
Download    [=========================] 100%       237568 bytes
Flashing U-Boot Environment
Download    [=========================] 100%        65536 bytes
Flashing U-Boot Environment Backup
Download    [=========================] 100%        65536 bytes
Rebooting to apply partition changes

4. フラッシュ (2回目)

Edisonをフラッシュモードにする

フラッシュ1回目の手順でリブートを促されるので、Edisonの電源を挿抜して再起動します。その後、U-Bootから run do_flash を実行します。

U-Boot 2014.04 (Jun 19 2015 - 12:05:55)

       Watchdog enabled
DRAM:  980.6 MiB
MMC:   tangier_sdhci: 0
In:    serial
Out:   serial
Err:   serial
Hit any key to stop autoboot:  0
boot > run do_flash
Saving Environment to MMC...
Writing to redundant MMC(0)... done
GADGET DRIVER: usb_dnl_dfu
#
DFU complete CRC32: 0xb98db2f8
DOWNLOAD ... OK
Ctrl+C to exit ...
####################################################################
DFU complete CRC32: 0x50eca82c
DOWNLOAD ... OK
Ctrl+C to exit ...
resetting ...

flashall.shの完了を待つ

flashall.shを実行しているコンソール上に次のように表示されてフラッシュが完了します。

Now waiting for dfu device 8087:0a99
Flashing boot partition (kernel)
Download    [=========================] 100%      6111232 bytes
Flashing rootfs, (it can take up to 5 minutes... Please be patient)
Download    [=========================] 100%    566330368 bytes
Rebooting
U-boot & Kernel System Flash Success...
Your board needs to reboot to complete the flashing procedure, please do not unplug it for 2 minutes.

参考

9
9
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
9
9