Sorry to cross-post but there's nothing but tumbleweed in the DM36x forum and I'd quite like to get some stuff working... I'm looking for some basic assistance / explanation of how to get up & running with what I've got. I know how to write C code but am new to embedded Linux and the myriad of TI software / support packages etc. and am having problems getting to the stage of being able to type "make all" and have something pop out that I can then burn to a board and run.
I have a Leopardboard DM368 and the TI/Appro IPNC-MT5 DM368 camera here, the idea/project/dream is to build an IP camera based on the Appro IPNC reference design. I was hoping to use the Leopardboard to do initial development on so as to avoid bricking the more expensive MT5 camera/board... and I think it's probably good that I did!
The Appro/TI IPNC SDK is version 4.0.0. I realise the Leopardboard is not really TI's problem, but I'm looking for a bit of basic help / explanation of the bare basics of booting & flashing.
As I think I understand it, there are 3 bootloaders:
- TI's RBL, built into the chip's ROM
- UBL, a small bootstrap sort of loader which can be sent to RBL to then load & run u-boot, not resident on the chip/board, maybe available in binary for the DM368 or may need compiling from somewhere?
- u-boot (AKA Das-u-boot), a more fully featured bootloader which can be used to download firmware & burn to NAND/NOR/etc, usually burnt to flash (NAND/NOR/SD) & loaded on reset to load the main Linux uimage/cramfs.
...and then the built kernel / IPNC app, in my case (using IPNC SDK 4.0.x) I assume this is /Binaries/DM368/ipnc_dm368_ubifs although it could also be in /Source/ipnc_rdk/target/filesys or /Source/ ipnc_rdk/tftp/ ...?
As I am developing in a VM at the moment I have been trying to use SD-card or UART to send the image & boot the board rather than trying to get TFTP set up to talk to a VM, that seemed like plenty of chance to go wrong...
I have been following the guide in "UserGuide_IPNC_RDK_DM36x_Version4.0.0.pdf", p36-37 "Flashing by UART on U-Boot", the terminal log is below:
U-Boot 2010.12-rc2 (Dec 11 2012 - 13:18:02)
Cores: ARM 297 MHz
DDR: 243 MHz
I2C: ready
DRAM: 128 MiB
NAND: 256 MiB
MMC: davinci: 0, davinci: 1
*** Warning - booting from SD, using default environment
Net: Ethernet PHY: GENERIC @ 0x00
DaVinci-EMAC
Hit any key to stop autoboot: 3 0
DM365 LEOPARD # loadb 0x80700000
## Ready for binary (kermit) download to 0x80700000 at 115200 bps...
## Total Size = 0x00025d3c = 154940 Bytes
## Start Addr = 0x80700000
DM365 LEOPARD # loadb 0x80 2000000
## Ready for binary (kermit) download to 0x82000000 at 115200 bps...
## Total Size = 0x01660000 = 23461888 Bytes
## Start Addr = 0x82000000
DM365 LEOPARD # nand erase 0x500000 0x400000
NAND erase: device 0 offset 0x500000, size 0x400000
Erasing at 0x8e0000 -- 100% complete.
OK
DM365 LEOPARD # nand write 0x80700000 0x500000 0x400000
NAND write: device 0 offset 0x500000, size 0x400000
4194304 bytes written: OK
DM365 LEOPARD # nand erase 0x900000 0x1800000
NAND erase: device 0 offset 0x900000, size 0x1800000
Erasing at 0x20e0000 -- 100% complete.
OK
DM365 LEOPARD # nand write 0x82000000 0x900000 0x1800000
NAND write: device 0 offset 0x900000, size 0x1800000
25165824 bytes written: OK
DM365 LEOPARD # setenv bootcmd 'nboot 0x80700000 0 0x500000;bootm 0x80700000'
DM365 LEOPARD # setenv bootargs 'mem=48M console=s ttyS0,115200n8 noinitrd ip=dhcp rw ubi.mtd=3,2048 rootfstype=ubifs root=ubi0:rootfs cmemk.phys_start=0x83000000 cmemk.phys_end=0x88000000 cmemk.phys_start_1=0x00001000 cmemk.phys_end_1=0x00008000 cmemk.pools_1=1x28672 cmemk.allowOverlap=1 cmemk.useHeapIfPoolUnavailable=1 lpj=1077248 nohz=off highres=off eth=$(ethaddr) quiet'
DM365 LEOPARD # saveenv
Saving Environment to NAND...
Erasing Nand...
Erasing at 0x3c0000 -- 50% complete.Erasing at 0x3e0000 -- 100% complete.
Writing to Nand... done
DM365 LEOPARD # reset
resetting ...
NAND
Starting NAND Copy...
No valid boot image found!
NAND Boot failed.
Aborting...
Can anyone shed any light on what I've done wrong? I realise the IPNC software will probably throw a few errors but I expected it would at least try to boot.
As a secondary problem, I can't find any good documentation/guides/posts on how to take the output of the IPNC 4.0.0 SDK "make sysall" and create a bootable SD card, currently my SD card was created with the RR DVSDK, but this does not provide what we need for our design. The files created by the IPNC SDK are:
- diagnostic_ipnc_dm368.bin
- nandwriter_ipnc_dm368.out
- ubl_486arm_360ddr_ipnc_dm368.bin
- uImage_ipnc_dm368
- ipnc_dm368_ubifs
- ubl_432arm_340ddr_ipnc_dm368.bin
- u-boot-1.3.4-dm368_ipnc.bin
The Leopardboard was booting from the SD card OK, I tried replacing the "rootfs" partition contents with the contents of /Source/ipnc_rdk/target/filesys but it didn't change the software that was booted, so I assumed it was using the "boot" partition and loading the uimage file, replacing that with one from /Source/ipnc_rdk/tftp/ just wouldn't boot, although it would say "Starting kernel..." and then hang.
I have read hundreds of pages / posts and tonnes of pdf's but they are mostly for other CPU's (DM365, 355, 81x) or for older IPNC SDK's, other SDK's like RR DVSDK which has a GUI config & SD-card creation script, so I can't really get a good idea of what will & won't transfer to the DM368. I don't have the full CCS, but I do have the XDS100v3 adapter & CCS v5 installed for JTAG programming only.
I think what I need to do is:
- Either build or download ubl for the DM368, and somehow burn it to the board
- Then do the same with u-Boot (I can load u-boot from SD card but the leopardboard doesn't boot from NAND anymore)
- Then use u-Boot to burn the output/result of "make sysall" to the board... but which exact file from the selection above?
Any good guide to the various arguments used in bootcmd / bootargs would be useful too, all the wikis and things seem to only give half the story or give examples which aren't explained.
Any help greatly appreciated! I just want to get on and write some code :(