[SAMA5D2 Xplained] Sam-ba 3.1.2 problems with eMMC flash

Discussions about all user software around SAM Series.

Moderator: nferre

cimcim49
Posts: 3
Joined: Mon Jun 20, 2016 11:15 am

[SAMA5D2 Xplained] Sam-ba 3.1.2 problems with eMMC flash

Mon Jun 20, 2016 11:56 am

Hello all,
I'm trying to flash the eMMC of the sama5d2 Xplained demo board using sam-ba 3.1.2, but it doesn't work.
I also tried to flash a SD card plugged into the sdmmc connector, but it leads me to the same results.

Process:

Code: Select all

- plug jumper JP9
- removing SD card
- connect the USB port J23 (A5-USB-A, power the board)
- waiting to have the device discovered by windows 7
- removing jumper JP9
- plugging the SD card (if trying to flash sdmmc1 instead of eMMC)
- executing sam-ba with command (using a bash on windows, or the windows "cmd" stuff):
    ./sam-ba_3.1.2/sam-ba -x test_sdmmc-usb.qml
below, the contents of my test_sdmmc-usb.qml

Code: Select all

import SAMBA 3.1
import SAMBA.Connection.Serial 3.1
import SAMBA.Device.SAMA5D2 3.1

AppletLoader {
	connection: SerialConnection {
		//port: "ttyACM0"
		//port: "COM85"
		//port: "COM5"
		//baudRate: 57600
	}

	device: SAMA5D2 {
		// this configuration is suitable for the sama5d2-xplained:
		// board: "samad2-xplained"
		config {
			// SDMMC0 (eMMC)
			// sdmmcInstance: 0
			// SDMMC1 (SD/MMC slot)
			sdmmcInstance: 1
			// Partition 0 (User Partition)
			// Partition 1 (1st boot partition)
			sdmmcPartition: 0
			sdmmcBusWidth: 4
			sdmmcVoltages: 5
		}
	}

	onConnectionOpened: {
		// read and display current BSCR/BUREG/FUSE values
		//print("-I- === Boot config value ===")
		//appletInitialize("bootconfig")
		//printBootConfig();

		// initialize SD/MMC applet
		print("-I- === Initialyse MMC ===")
		appletInitialize("sdmmc")

		//print("-I- === Erase SD Card ===")
		//appletErase(0, connection.applet.memorySize)

		// write file
		print("-I- === Write on MMC ===")
		//appletWrite(0, "filesystem_image.raw", false)
		appletWrite(0, "linux4sam-poky-sama5d2_xplained-5.3.img", false)

	}

	// read and display current BSCR/BUREG/FUSE values
	function printBootConfig() {
		var bscr = appletReadBootCfg(BootCfg.BSCR)
		print("BSCR=" + Utils.hex(bscr, 8) + " / " + BSCR.toText(bscr))
		var bureg0 = appletReadBootCfg(BootCfg.BUREG0)
		print("BUREG0=" + Utils.hex(bureg0, 8) + " / " + BCW.toText(bureg0))
		var bureg1 = appletReadBootCfg(BootCfg.BUREG1)
		print("BUREG1=" + Utils.hex(bureg1, 8) + " / " + BCW.toText(bureg1))
		var bureg2 = appletReadBootCfg(BootCfg.BUREG2)
		print("BUREG2=" + Utils.hex(bureg2, 8) + " / " + BCW.toText(bureg2))
		var bureg3 = appletReadBootCfg(BootCfg.BUREG3)
		print("BUREG3=" + Utils.hex(bureg3, 8) + " / " + BCW.toText(bureg3))
		var fuse = appletReadBootCfg(BootCfg.FUSE)
		print("FUSE=" + Utils.hex(fuse, 8) + " / " + BCW.toText(fuse))
	}
}
The communication with the xplained board works and it detects the SD card (or the eMMC), but it seems that the writing never starts, it just stands doing nothing...

The bash output:

Code: Select all

$ ./sam-ba_3.1.2/sam-ba.exe -x test_sdmmc-usb.qml
Opening serial port 'COM11'
Connection opened.
-I- === Initialyse MMC ===
Detected memory size is 3046637568 bytes.
-I- === Write on MMC ===
the output catch on the serial line on the same time:

Code: Select all

Applet 'SD/MMC' from softpack 1.3 (v1.3-33-g563f963).
Initializing SDMMC1, user partition, 4-bit, 1.8V/3.3V
-I- Device clk 400 kHz
-W- CMD52 ended with error flags 0001, cmd status ERR_NO_RESPONSE
-E- Cmd52 ERR_NO_RESPONSE
-W- CMD5 ended with error flags 0001, cmd status ERR_NO_RESPONSE
-E- Cmd5 ERR_NO_RESPONSE
-I- SDHC MEM
-I- Device clk 49500 kHz
High-capacity SD card v3.0x, 4-bit data, in HS mode at 49500 kHz
Device memory size: 15193 MiB, 31116288 * 512B
SD/MMC device initialization successful
Buffer Address: 0x22b608
Buffer Size: 83968 bytes
Page Size: 512 bytes
Memory Size: 5950464 pages

If anyone has already do that, can you explain me what is my error ?

Tanks to all,
regards,
cimcim
cimcim49
Posts: 3
Joined: Mon Jun 20, 2016 11:15 am

Re: [SAMA5D2 Xplained] Sam-ba 3.1.2 problems with eMMC flash

Tue Jun 28, 2016 10:11 am

Ok, just to close this thread, if it can help some others:
it seems that there's an issue in the ROM code of revision A and B of the sama5d2 which forbids booting (see in errata) from eMMC but also flashing on eMMC from sam-ba.
nferre
Site Admin
Posts: 166
Joined: Wed Feb 14, 2007 11:17 am

Re: [SAMA5D2 Xplained] Sam-ba 3.1.2 problems with eMMC flash

Tue Jul 04, 2017 11:43 am

Hi,

Booting from eMMC on sama5d2 revB: yes.
Preventing using SAM-BA to access eMMC: no.

However, you can test newer revisions of SAM-BA (3.2.x) which I tested working well for eMMC flashing:
https://github.com/atmelcorp/sam-ba/releases
cimcim49
Posts: 3
Joined: Mon Jun 20, 2016 11:15 am

Re: [SAMA5D2 Xplained] Sam-ba 3.1.2 problems with eMMC flash

Mon Oct 09, 2017 5:08 pm

Hi,
it seems that rev C of sama5d2 fix all issues on emmc support (flashing using sam-ba and booting)
Did someone have any feedback about it ?

Return to “Software”

Who is online

Users browsing this forum: No registered users and 0 guests