Problem with prebuilt linux distribution and SAM-BA

Microchip in-system programming solution: SAM-BA

Moderators: nferre, fab

granit
Posts: 1
Joined: Fri Sep 11, 2020 9:42 am

Problem with prebuilt linux distribution and SAM-BA

Fri Sep 11, 2020 10:01 am

Hi,
I try to download the pre-built linux distribution linux4sam-poky-sama5d4_xplained-graphics-2020.04 to a SAMA5D4Xplained board.
The script looks like this:

import SAMBA 3.2
import SAMBA.Connection.Serial 3.2
import SAMBA.Device.SAMA5D4 3.2

SerialConnection {
//port: "ttyACM0"
//port: "COM85"
//baudRate: 57600

device: SAMA5D4Xplained {
// to use a custom config, replace SAMA5D4Xplained by SAMA5D4 and
// uncomment the following lines, or see documentation for
// custom board creation.
//config {
// serialflash {
// ioset: 1
// busWidth: 8
// header: 0xc1e04e07
// }
//}
}

onConnectionOpened: {
// initialize Low-Level applet
initializeApplet("lowlevel")

// initialize NAND flash applet
initializeApplet("nandflash")

// erase all memory
applet.erase(0, applet.memorySize)

// write files
applet.write(0x000000, "at91bootstrap-sama5d4_xplained.bin", true)
applet.write(0x040000, "u-boot-sama5d4-xplained.bin")
applet.write(0x0c0000, "u-boot-env-sama5d4-xplained.bin")
applet.write(0x180000, "at91-sama5d4_xplained.dtb")
applet.write(0x200000, "zImage-sama5d4-xplained.bin")
applet.write(0x800000, "atmel-xplained-demo-image-sama5d4-xplained.ubi")
}
}

The erase works fine, also the bootstrap. But I can't find:
-u-boot-env-sama5d4-xplained.bin (I have only u-boot-env.bin),
-at91-sama5d4_xplained.dtb
- zImage-sama5d4-xplained.bin
- atmel-xplained-demo-image-sama5d4-xplained.ubi ( I have demo_linux_nandflash_usb.qml)

What should I do?
Regards
Bernhard
nferre
Site Admin
Posts: 223
Joined: Wed Feb 14, 2007 11:17 am

Re: Problem with prebuilt linux distribution and SAM-BA

Fri Sep 11, 2020 5:22 pm

Hi,

Please check the ready-made package for flashing sama5d4 xplained with 2020.04 graphics poky image: https://files.linux4sam.org/pub/demo/li ... 020.04.zip.
It contains all binaries plus the associated .qml sam-ba file for properly flashing the demo. The script flashing snippet looks like:

Code: Select all

	onConnectionOpened: {

		var itbFileName = "sama5d4_xplained.itb"
		var ubootEnvFileName = "u-boot-env.bin"

		// initialize Low-Level applet
		print("-I- === Initilize low level (system clocks) ===")
		initializeApplet("lowlevel")

		// intialize extram applet (needed for sam9)
		print("-I- === Initialize extram ===")
		initializeApplet("extram")

		print("-I- === Initialize nandflash access ===")
		initializeApplet("nandflash")

		// erase then write files
		print("-I- === Load AT91Bootstrap ===")
		eraseWrite(0x00000000, "at91bootstrap-sama5d4_xplained.bin", true)

		print("-I- === Load u-boot environment ===")
		//erase redundant env to be in a clean and known state
		applet.erase(0x00100000, getEraseSize(0x20000))
		eraseWrite(0x00140000, ubootEnvFileName)

		print("-I- === Load u-boot ===")
		eraseWrite(0x00040000, "u-boot-sama5d4-xplained.bin")

		print("-I- === Load ITB image ===")
		eraseWrite(0x00180000, itbFileName)

		print("-I- === Load root file-system image ===")
		applet.erase(0x00800000, applet.memorySize - 0x00800000)
		applet.write(0x00800000, "microchip-graphics-image-sama5d4-xplained.ubi")

		print("-I- === Done. ===")
	}
And I verified that all elements are present in the .zip archive.

Best regards,
Nicolas

Return to “SAM-BA”

Who is online

Users browsing this forum: No registered users and 4 guests