Skip to content

Booting a Kobo Aura from SD

Jonathan Neuschäfer edited this page Mar 2, 2019 · 6 revisions

Note that in this file, Kobo Aura refers to the original Kobo Aura, model N514, rather than the newer Kobo Aura variants.

  • Connect wires and a UART to the serial port near the i.MX SoC (marked TX/RX/GND).
  • Make sure the u-boot shell can be entered. This may require changing the bootdelay variable in the u-boot environment.
  • To enter the u-boot shell, hold a key (space, for example) while booting the machine. You can now run u-boot commands:
eBR-1A # printenv
bootdelay=1
baudrate=115200
loadaddr=0x70800000
uboot=u-boot.bin
kernel=uImage
bootargs_base=setenv bootargs console=ttymxc0,115200 rootwait rw no_console_suspend lpj=3997696
bootargs_mmc=setenv bootargs ${bootargs}
bootcmd_mmc=run bootargs_base bootargs_mmc;load_ntxkernel; bootm
bootargs_SD=setenv bootargs ${bootargs}
bootcmd_SD=run bootargs_base bootargs_SD;load_ntxkernel; bootm
bootargs_recovery=setenv bootargs ${bootargs}
bootcmd_recovery=run bootargs_base bootargs_recovery;load_ntxkernel; bootm
bootcmd=run bootcmd_mmc
KRN_SDNUM_SD=1
KRN_SDNUM_Recovery=0
verify=no
stdin=serial
stdout=serial
stderr=serial

Environment size: 616/131068 bytes
  • Beware that the system is shutdown after about 16 seconds in the u-boot shell, probably due to an expiring watchdog. Do NOT have a saveenv command in progress when this timer expires.

  • Prepare a micro-SD card by writing a kernel in zImage format at offset 0x100000 (1MiB), and plug it into the device. To avoid overwriting the root filesystem, do not write further than offset 0xf00000 on the card. This leaves 14 MiB of space for the kernel.

    Warning: Do not boot the actual recovery system from the SD card, if you have a broken display, as it will throw you into the initial setup screen the next time you boot normally.

  • You can now try to manually boot your kernel from the uboot shell:

...
Hit any key to stop autoboot:  0
eBR-1A #
eBR-1A #
eBR-1A # mmc rescan 0; mmc read 0 0x70800000 0x800 0xe000; echo done; run bootargs_base; go 0x70800000

MMC read: dev # 0, block # 2048, count 57344 partition # 0 ...
57344 blocks read: OK
done
## Starting application at 0x70800000 ...
Uncompressing Linux... done, booting the kernel.
[    0.000000] Booting Linux on physical CPU 0x0
...
  • If this works, can go ahead and install this sequence of commands into the persistent uboot environment:
setenv bootcmd_recovery 'run bootargs_base bootargs_recovery; mmc rescan 0; mmc read 0 0x70800000 0x800 0xe000; go 0x70800000'
saveenv

Again, make sure that you submit these two commands quickly, to avoid corrupting the stored environment, when the system is powered off by the EC.

  • Boot into "recovery mode" by holding the frontlight button while sliding the power button. The kernel on the SD card should now be loaded.

Tips

  • If you're using the serial console and find that the machine suspends all the time, plug it into a USB host. This will suppress suspending.
  • If you want to repartition the external SD card, you should keep some offsets in mind:
start end+1 description
0x00000200 0x00100000 u-boot
0x00100000 0x00400000 kernel (size according to u-boot sources)
0x00700000 ??? waveform (according to u-boot sources)
0x00900000 ??? logo (according to u-boot sources)
0x00f00000 ??? system file system
  • The ext2 driver in this version of u-boot is horribly slow. Don't use it for anything serious.
  • If you use the bootm command, beware that it tries to load stuff.