How to get module_type, module_id and MAC

Hi, I want to get the module_type, module_id and MAC of a Khadas device preferably via flashing tool. Thanks

Hello @alarraya.dasgate

I’m not sure what you want exactly, could you please provide more information?

I want to be able to get module_type, module_id and MAC of a Khadas device connected to a PC via USB-C, due to the fact that I work for a company which needs to flash their fleet of devices without knowing that data in the first place. If that information is gotten via flashing tool better.

More specifically we are looking for 3 values:

  • Unique identifier of a Khadas, such as a manufacturing serial number
  • Unique identifier of the type of Khadas, such as product serial number. This identifier narrows the suite of compatible software with the device version.
  • MAC of the device

Regarding the ways to obtain such information, we expected to obtain it through the USB interface that we’re already using for flashing. We would like to completely identify the device by running a script even before of connecting if to network.

Does the flashing tool ‘burn-tool’ provide any way to get this information? Otherwise, how could we get it through USB interface by scripting?

We’ve seen that by ‘/opt/update identify’ we can see the firmware version, but it doesn’t helps us at all

Which board you are talking about ?

For VIM1S, VIM4.

You can get mac and serial number from the system node.

cat /sys/class/efuse/mac
cat /sys/class/efuse/usid 

If you just mean Unique identifier, you can use the cpu id.

cat /proc/cpuinfo | grep Serial
1 Like

We are using it for VIM3l, but we would want to be able in the future to get the model board with some command, is that posible?

Hello @alarraya.dasgate

For VIM3L, this is no verdor serial number, but you can get the unique cpuid.

cat /proc/cpuinfo | grep Serial

And MAC:

cat /sys/class/efuse/mac

this command:

cat /sys/class/efuse/usid 

returns us ‘Bad address’ although the file is there, do you know why that happens?

Hello @alarraya.dasgate

If you use VIM3L, there is no data on this node.

Do we have an alternative?

Hello @alarraya.dasgate

Waht you want to do? If you just need a unique number, you can get from the cpuid.

We’ve come to the conclusion that none of these solutions fit our need due to the fact that we want to acquire those identifiers exclusively with the device connected via usb, without previously have logged in to it. Is there a way to plug in the board with the usb and before flashing it or in the process of flashing it to get the info?

Yes, For VIM3/3L you can get the chipid from the usb.

Use the update tool here: utils/aml-flash-tool/tools/linux-x86 at master · khadas/utils · GitHub

Connect the board to your PC whti the usb cable and put the board enter maskrom mode via TST.

Use the command below to get the chipid:

nick@Nick:~/work/code/git/utils/aml-flash-tool/tools/linux-x86$ ./update chipid
This firmware version is 3-2-0-0
[update]idVer is 0x302
[update]get chpid by chip info page
ChipID is:0x503846393934060000221301

That’s great, in case we had other model boards were used could the same command be applied? Is there a way to get the MAC address like that?

For VIM1/VIM2/VIM3/VIM3L you can use the same way above.

For VIM4 and VIM1S you can use the steps below:

Adnl Tool: utils/aml-flash-tool/tools/adnl at master · khadas/utils · GitHub

nick@Nick:~/work/code/git/utils/aml-flash-tool/tools/adnl$ ./adnl devices
00d9c31d0490211200000000	Aml_DNL

You can’t get the mac address in this way.