Reading mac address from EEPROM during flashing

Hi,

is there a way to read ethernet mac address from on board EEPROM on tx1 during flashing.
Currently flash script, reads boradid and boardversion using binary chkbdinfo from bootloader folder.
Is there any script to read mac address? or any other way I can get mac address of ethernet during flashing??

Thanks,
Prathamesh

Please take a look and try.

Jetpack-3.2.1/64_TX1/Linux_for_Tegra/bootloader$ ./chkbdinfo 
usage: chkbdinfo [options] <input file>
  Where [options] are:
	[--partnumber|-p] --------- Dump Board Part Number
	[--class|-c] -------------- Dump Board Class
	[--assetid|-a] ------------ DUMP Asset ID
	[--id|-i] ----------------- Dump Board ID
	[--sku|-k] ---------------- Dump Board SKU
	[--fab|-f] ---------------- Dump Board FAB number
	[--revision|-r] ----------- Dump Board Revision
	[--wifi|-w] --------------- Dump WiFi MAC
	[--btmac|-b] -------------- Dump BT MAC
	[--gigabitethernet|-g] ---- Dump Gigabit Ethernet MAC
	[--version|-v] ------------ Dump Board Info Version

Hi,

what is the input file in the command above?
when I am giving cvm.bin as input file (found it in flash.sh script, the way boardid is read)
but it is failing.
There is also tegraflash.py file, can we use it outside flash script to read ethernet mac address.
If yes then what is the full command to read it.
I am trying with following command, but it need some extra arguments
python tegraflash.py --chip 0x21 --applet nvtboot_recovery.bin --cmd dump eeprom
Should the board be in recovery mode to run tegraflash.py script.

Thanks,
Prathamesh

patyarahate,

I think it should also be the cvm.bin. What error did you see?

Hi Wayne,
Could you please provide the complete command to read the MAC address from TX1.

I see the below error.

user@kickseed:~/tx1_28.2_rel1/linuxfortegra/bootloader$ ./chkbdinfo -g cvm.bin
ERROR: loading input (cvm.bin)

Thanks
Kishor

rkiskum,

I just went through the whole script and notice that this command is being bypassed on tx1 usecase. That is why you cannot find cvm.bin during the flash process.

Could you tell us why you need to enable this during flash? I can help discuss this issue with internal team.

As for your reference, “tegraflash_internal.py” → tegraflash_dump_eeprom

Hello Wayne,
Could you please let me know how the below command could be used.
““tegraflash_internal.py” → tegraflash_dump_eeprom”?

When i run tegraflash.py command I get below screen, meaning one of the options passed is not correct
user@ubuntu:~/tx1_28.2/Linux_for_Tegra/bootloader$ python tegraflash.py --chip 0x21 --applet nvtboot_recovery.bin --cmd dump eeprom boardinfo cvm.bin
Welcome to Tegra Flash
version 1.0.0
Type ? or help for help and q or quit to exit
Use ! to execute system commands


Usage: dump [options]

Following types can be dumped

ram [ ] [file] : Dumps the complete ram if start offset and
size are not specified.
ptm [file] : Dumps only the PTM traces.
custinfo [file] : Dumps customer information
ptm & custinfo Not Valid for t186
eeprom <eeprom_module> [file] : Dumps the contents of EEPROM
based on module

Is the command I am giving is correct?
Is there a way I can download cvm.bin file from somewhere?

Thanks,
Prathamesh

patyarahate,

Let me explain it in detail.

cvm.bin should be generated if using your command. However, somehow we bypass the generation of this file for tx1 only. Thus, cvm.bin is generated during flashing tx2 but not seen in tx1 usecase.

And sorry that I didn’t notice your usecase is on tx1 in first glance of this thread.

If you want to look into where it is bypassed, please find the file “tegraflash_internal.py” under bootloader and take a look at the function “tegraflash_dump_eeprom”.

I cannot decide whether we can disable the bypass and need to discuss with internal team, so please give us more info about why you need to dump this info during flash.

Please replace below nvtboot file in your Linux_for_Tegra and the flash script.

nvtboot.tar.gz (251 KB)

The patch for script

---

diff --git a/scripts/tegraflash_internal.py b/scripts/tegraflash_internal.py
index 87b9702..8346f0a 100755
--- a/scripts/tegraflash_internal.py
+++ b/scripts/tegraflash_internal.py
@@ -894,8 +894,20 @@
     values.update(args)
     is_tegrarcm_command = False;
 
-    if int(values['--chip'], 0) == 0x21: # Bypass fetching t210 eeprom data
+    if int(values['--chip'], 0) == 0x21:
+        info_print('dump EEPROM info')
+        command = exec_file('tegrarcm')
+
+        if len(params) > 1:
+            out_file = params[1]
+        else:
+            out_file = 'cvm.bin'
+
+        out_file = tegraflash_abs_path(out_file)
+        command.extend(['--oem', 'platformdetails', 'eeprom', out_file])
+        run_command(command)
         return
+
     if len(params) == 0:
         print("Error: EEPROM module not specified")
         return

The whole process is

  1. sudo ./tegraflash.py --chip 0x21 --applet nvtboot_recovery.bin --cmd “dump eeprom boardinfo cvm.bin”
    → A cvm.bin file would be generated.

  2. run chkbdinfo binary with -w and cvm.bin as input
    → It would dump the wifi mac

Hi Wayne,
Thank you for the binaries and the patch files. I could dump wlan IP correctly but ethernet address looks to be incorrect. (note the difference in endianness)

mach1/bootloader$ sudo ./chkbdinfo -w cvm.bin
28:6F:79:4B:04:00
ifconfig wlan0
wlan0 Link encap:Ethernet HWaddr 00:04:4b:79:6f:28

mach1/bootloader$ sudo ./chkbdinfo -g cvm.bin
01:00:0D:00:84:08
ifconfig eth0
eth0 Link encap:Ethernet HWaddr 00:04:4b:79:6f:2a

Could you please check. FYI the below is the dump.

mach1/bootloader$ sudo ./chkbdinfo -c cvm.bin
8
mach1/bootloader$ sudo ./chkbdinfo -a cvm.bin
0324516188765���������������������������������������������������������������NVCB
mach1/bootloader$ sudo ./chkbdinfo -i cvm.bin
2180
mach1/bootloader$ sudo ./chkbdinfo -k cvm.bin
1000
mach1/bootloader$ sudo ./chkbdinfo -f cvm.bin
400
mach1/bootloader$ sudo ./chkbdinfo -r cvm.bin

mach1/bootloader$ sudo ./chkbdinfo -w cvm.bin
28:6F:79:4B:04:00
mach1/bootloader$ sudo ./chkbdinfo -b cvm.bin
29:6F:79:4B:04:00
mach1/bootloader$ sudo ./chkbdinfo -g cvm.bin
01:00:0D:00:84:08
mach1/bootloader$ sudo ./chkbdinfo -v cvm.bin
1.0

Thanks
Kishor

Seems a minor error in chkbdinfo binary. Please try this one, I’ve added some patch to it.

chkbdinfo.tar.gz (295 KB)

Hi Wayne,
Thank you for the updated binary, we are able to read Eth MAC address.

Further we run a custom script to do the below after placing the TX1 in recovery mode.

  1. Create cvm.bin (sudo ./tegraflash.py --chip 0x21 --applet nvtboot_recovery.bin --cmd “dump eeprom boardinfo cvm.bin”)
  2. Read Eth MAC address (eth_mac=$(./chkbdinfo -g cvm.bin)
  3. Flash the image (sudo ./flash.sh jetson-tx1 mmcblk0p1)

What we observed is the step 3 fails saying
Error: probing the target board failed.
Make sure the target board is connected through
micro-B USB port and is in recovery mode.

On the TX1 serial port we see
[0007.844] Enabled early print
[0007.847] [TegraBoot] (version 00.00.2014.50-mobile-3222e3f6)
[0007.852] Processing in recovery mode
[0007.856] A02 Bootrom Patch rev = 63
[0007.859] Power-up reason: pmc por
[0007.862] Established communication link with host
[0008.871] NvTbootI2cWrite(): error code 0x00045100 Error while starting write transaction
[0008.879] NvTbootI2cDeviceRead(): error code 0x00045001 Error while sending the offset to slave
[0008.888] NvTbootI2c: Read failed for slave 0xac, offset 0x00 with error code 0x00045001

I would like to know is it possible to run the tegraflash.py command and further flash the TX1 module together?
We could place the TX1 module again in recovery and run the flash command successfully.

Thanks
Kishor

rkiskum,

If you look into the log during flash, it should have something like “./tegraflash.py …”, please try to add --cmd “dump eeprom boardinfo cvm.bin” into it.

This issue would be fixed in next TX1 release. If anyone needs to use it in rel-28.2, please just follow up previous comments.

Thanks.