Problem with prebuilt linux distribution and SAM-BA

Microchip in-system programming solution: SAM-BA

Moderators: nferre, fab

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

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

// initialize NAND flash applet

// 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),
- zImage-sama5d4-xplained.bin
- atmel-xplained-demo-image-sama5d4-xplained.ubi ( I have demo_linux_nandflash_usb.qml)

What should I do?
Site Admin
Posts: 226
Joined: Wed Feb 14, 2007 11:17 am

Re: Problem with prebuilt linux distribution and SAM-BA

Fri Sep 11, 2020 5:22 pm


Please check the ready-made package for flashing sama5d4 xplained with 2020.04 graphics poky image: ...
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) ===")

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

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

		// 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,

Return to “SAM-BA”

Who is online

Users browsing this forum: No registered users and 3 guests