Duplicate MAC Addresses and Serial Numbers

Hi @Gouwa .
The serial number on my VIM is 123456789abcdef , How to change?
Can I change the variable in u-boot “androidboot.serialno”?

PS . Change variable “androidboot.serialno” not working

Are you on Android or Ubuntu?
I changed the variable in u-boot “androidboot.serialno”.
That’s ok on Android, but you need to rebuild the u-boot source code and reflash the u-boot.bin

####1. Modify the file in u-boot ‘board/khadas/configs/kvim.h’

diff --git a/board/khadas/configs/kvim.h b/board/khadas/configs/kvim.h
index 8f7a3e4..2a0e353 100644
--- a/board/khadas/configs/kvim.h
+++ b/board/khadas/configs/kvim.h
@@ -107,7 +107,7 @@
             "else fi;"\
             "\0"\
     "storeargs="\
-     "setenv bootargs ${initargs} androidboot.selinux=${EnableSelinux} logo=${display_layer},loaded,${fb_addr},${outputmode} maxcpus=${maxcpus} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=${cvbsmode} hdmitx=${cecconfig} cvbsdrv=${cvbs_drv} androidboot.firstboot=${firstboot} jtag=${jtag}; "\
+     "setenv bootargs ${initargs} androidboot.selinux=${EnableSelinux} logo=${display_layer},loaded,${fb_addr},${outputmode} maxcpus=${maxcpus} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=${cvbsmode} hdmitx=${cecconfig} cvbsdrv=${cvbs_drv} androidboot.firstboot=${firstboot} jtag=${jtag} androidboot.serialno=7654321abcdef; "\

####2. Rebuild u-boot

$ cd <path-to-your-project>/uboot
$ make CROSS_COMPILE=aarch64-linux-gnu- kvim_defconfig
$ make CROSS_COMPILE=aarch64-linux-gnu-

####3. Upgrade bootloader via TFTP

kvim# tftp 1080000 u-boot.bin
kvim# store rom_write 1080000 0 100000
kvim# defenv
kvim# saveenv
kvim# reset

About more informations for loading images with uboot via tftp, look LoadImagesWithUBootViaTFTP

3 Likes

CONFIRM, It Works, thanks

Not sure I got it right… How do I set following in Android Nougat built from source?

  • serial number
  • device id
  • MAC address of ethernet
  • MAC address of wi-fi
  • MAC address of bluetooth

@Terry What are the variables (androidboot.?) for ethernet, WiFi and Bluetooth MAC addresses?

In my case I didn’t succeed - even with those added to uboot/board/khadas/configs/kvim.h:

None of MAC addresses were set…

List the steps for reference:

  • Setup a new MAC address:
kvim# setenv ethaddr “00:15:18:01:81:32”
  • Keep the changes persistent:
kvim# saveenv
  • Reboot
kvim# reboot

About WI-FI and Bluetooth MAC addresses, I still don’t try to modify it.
You can refer to the docs

1 Like

Hi Terry,

so if I understood correctly (ok well, more guessing, based on own experience and doc what I’m not really able to read)
S905X has three area where data can be stored

eFuses (most likely OTP area in chip - needs atleast kernel driver)
Nand (not use in VIM, like spi/etc…)
EMMC (in use)

so Khadas team not writing anythying into eFuses, so every VIM get random mac every starts, till some “own” mac is written in special emmc area, but anytime you reflash emmc, you lost your settings, right?

so is there any plan implement patch or include support for that eFuses?

1 Like

Yes, You are right .
We will take a look for OTP and add the support for it.
:smile:

@Terry any news on that? :slight_smile:

Are these supposed to be executed when Android is booted on Khadas or when?

I think you need type those while in uboot

1 Like

Is there a way to stop while ubooting or I need to execute something like following?

adb reboot uboot

I would only try to use an USB to serial cable and keep enter key pressed while the vim boots up

1 Like

Unfortunately even if I hold ENTER, it boots Android… However, when I was holding POWER, then pressed RESET I was presented with Android Recovery menu, so I chose Reboot to Bootloader. Looks like I’m in uboot:

But now I can’t get out :frowning: Reboot command keeps returning me back to this nasty bootloader and Android doesn’t boot…

Update:
Figured how to get out: from Android recovery choose to mount /system and then boot system - Android loads then.

Anyway, even though I’ve seen:

This MAC address is still not present on device when it boots :frowning:

Interestingly only ethernet MAC address changes - it seems WLAN and Bluetooth addresses remains the same over reboots.

The only way I managed to successfully set up ethernet MAC address was executing following when Android was booted:

So the ethernet MAC was set, but it was reset after reboot :frowning:

Hi, Gytis:
Any new process on this?

May be you can try with a new MAC Address, as some invalid address may not works.

Well, I generated MAC address using this generator and it still does not persist :worried:

But after reboot it’s again random ethernet address…

The ethernet address is invalid.
You can try to use the mac ‘98:aa:fc:60:44:ca’
Thanks.

1 Like

Yes, that worked! :slight_smile:

How do you know when ethernet MAC address is valid?

The second bit must be even. You can try to set ethaddr following below list

  • 98:EA:4F:10:DF:FD
  • 96:EA:4F:10:DF:FD
  • 94:EA:4F:10:DF:FD
  • 92:EA:4F:10:DF:FD
  • 90:EA:4F:10:DF:FD
1 Like

Just confirming that this method works as expected on built Ubuntu image as well :blush:

Any idea how to burn WLAN and Bluetooth MACs?