Pages

Resin.io and the OpenPi

Introduction

Following on from a previous post on Using Redin.io with Node-RED I have been given a Wireless Things OpenPi device. This is based on the Raspberry Pi Compute Module and hence is a different beast to put software on compared to the regular Raspberry Pi models. The big difference here is that there is no SD or uSD card slot available on the Compute Module or on the OpenPi itself. Instead the eMMC flash memory is installed on the Compute Module and must be programmed by connecting the device to another computer, for example another Raspberry Pi.

Preparation

Build rpiboot – CM eMMC flashing pages.

Connect OpenPi programming port to USB port on host Pi, I’m using a Raspberry Pi 2 here.

sudo bash
root@raspberrypi2:~# /home/pi/tools/usbboot/rpiboot
Waiting for BCM2835 ...
Found serial = 0: writing file /usr/share/rpiboot/usbbootcode.bin
Waiting for BCM2835 ...
Found serial = 1: writing file /usr/share/rpiboot/msd.elf
root@raspberrypi2:~#

Flashing software

Partitioning

root@raspberrypi2:~# fdisk -l /dev/sda

Disk /dev/sda: 3909 MB, 3909091328 bytes
4 heads, 16 sectors/track, 119296 cylinders, total 7634944 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00012301

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 7634943 3816448 6 FAT16
root@raspberrypi2:~# fdisk /dev/sda

Command (m for help): p

Disk /dev/sda: 3909 MB, 3909091328 bytes
4 heads, 16 sectors/track, 119296 cylinders, total 7634944 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00012301

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 7634943 3816448 6 FAT16

Command (m for help): d
Selected partition 1

Command (m for help): n
Partition type:
p primary (0 primary, 0 extended, 4 free)
e extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-7634943, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-7634943, default 7634943):
Using default value 7634943

Command (m for help): a
Partition number (1-4): 1

Command (m for help): t
Selected partition 1
Hex code (type L to list codes): c
Changed system type of partition 1 to c (W95 FAT32 (LBA))

Command (m for help): p

Disk /dev/sda: 3909 MB, 3909091328 bytes
4 heads, 16 sectors/track, 119296 cylinders, total 7634944 sectors
Units = sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disk identifier: 0x00012301

Device Boot Start End Blocks Id System
/dev/sda1 * 2048 7634943 3816448 c W95 FAT32 (LBA)

Command (m for help): w
The partition table has been altered!

Calling ioctl() to re-read partition table.

WARNING: If you have created or modified any DOS 6.x
partitions, please see the fdisk manual page for additional
information.
Syncing disks.
root@raspberrypi2:~#

Formatting

Format the partition

root@raspberrypi2:~# mkfs.vfat /dev/sda1
mkfs.vfat 3.0.13 (30 Jun 2012)
root@raspberrypi2:~#

Mounting and transferring files

Mount device

root@raspberrypi2:~# mount -t vfat /dev/sda1 /mnt
root@raspberrypi2:~# cd /mnt
root@raspberrypi2:~# scp -pr andrew@192.168.1.4:noobs/NewOpenPi/* .

root@raspberrypi2:/mnt# ls
bootcode.bin os recovery.img
BUILD-DATA recovery7.img recovery.rfs
config.json recovery.cmdline resin
defaults recovery.elf riscos-boot.bin
INSTRUCTIONS-README.txt RECOVERY_FILES_DO_NOT_EDIT

Finishing up

TODO….

Bookmark this post: bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark bookmark

Comments are closed.