buildroot-avr32-v2.1.0-rc10 env question

Go To Last Post
14 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I finally got everything loaded on my ngw100 :P
But I have some questions about setenv at the boot prompt.
I now have:
bootdelay=1
baudrate=115200
hostname=atngw100
ethact=macb0
ethaddr=00:04:25:1c:61:a4
eth1addr=00:04:25:1c:61:a5
tftpip=192.168.0.106
serverip=192.168.0.106
bootargs=console=ttyS0 root=/dev/mtdblock1 rootfstype=jffs2
bootcmd=fsload boot/uImage;bootm
stdin=serial
stdout=serial
stderr=serial

is this correct?

Dyan... KV9R

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I think so, yes. Are you having any problems?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I would change bootcmd to be "fsload /boot/uImage; bootm", but I do not think the first / is really needed. You can drop tftpip, serverip should be enough.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I'm just not sure what the MAC addr should be set to and
the behavior of ngw.example.net STATUS display is different and no DHCP

Dyan...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Your MACs seems good, I guess you have never erased the flash since you got your NGW (at least the environment area for U-Boot).

What do you mean about no DHCP? The DHCP server should still be running on the LAN-port.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

No the ENV variables are erased/changed when you load the new u-boot.bin after building buildroot 2.1.0-rc10. I updated the ENV using setenv and saveenv.

What I mean about DHCP is with the original build that the card came with, when you went to ngw.example.net and looked at the STATUS / DHCP it would show the MAC address, now everything is blank, the connect page is also very different. Is it just a format change?
Dyan...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

AFAIK the u-boot environment is not erased whey you upgrade the bootloader. Although, it will change if you never had any values in the first place.

Of course the MAC list for the DHCP server is blank, you erased the flash when upgrading ;) The web status page has also changed a bit, I think upstream webif was a bit updated. The webif application is very openwrt specific, so it does not integrate well into Buildroot.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

When you do: avr32program erase -fcfi@0
Doesn't it erase mtd0,mtd1 and mtd2 ?
Dyan...

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Yes, but you do not need to erase the entire flash to upgrade U-Boot, how could I know you did that ;)

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

True I did not mention doing an erase before programming the bootloader :oops:

Loading u-boot.bin 1.3.0-rc3 does create all the necessary ENV variables to boot off the SD card, makes it easier to upgrade .. No changing ENV variables until after rootfs.avr32_nofpu.jffs2-root and -usr have been programmed into mtd1 and mtd3.
Then you need to set the bootcmd, bootargs, ethaddr and eth1addr to the correct values.

Another interesting feature is that it also fixes the workaround bug for setenv ethaddr so that once you have put in the ADDR run saveenv and booted you can't change it... short of erasing mtd2.

The problem was I found that there were several discriptions of how to calculate the MAC address and in this case it looks like I used the correct one.
On my other NGW100 I used one of the other methodes :cry: that is why I now know what it takes to re-write ethaddr...

Being new to Linux this has been a real learning experiance ... Like they say in the Disney movie "Meet the Robinsons" Keep moving forward :lol:

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Doh, I see that the default bootargs and bootcmd for atngw100_defconfig should be altered to use the onboard flash.

A lot of bugs has been fixed with the new U-Boot. For example it now runs on the SDRAM, so you can upgrade U-Boot in U-Boot :) Please note everybody that this only applies to U-Boot version 1.3.0-rc3 and later releases.

The correct way to calculate the Ethernet MAC is on this page: https://www.avrfreaks.net/wiki/in...

You actually got two official MAC's with the NGW100.

Hans-Christian

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Just out of curiosity, where did you find the other (wrong) descriptions of how to calculate the MAC address?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well the link hce points out is very clear as to calculating the address on another site it was shown as 00:00:04:25:1C:50:00 + 2* S/N
With my S/N for that board as 2335 = 4670 = 123E

Sense the address has only 6 octets in a MAC address.
I thought I was to drop the leading 00:00's so I had it as 04:25:1C:50:12:3E. :oops:

I later found the link that hce pointed out and realized my error, that is when I found out about the ethaddr address being protected and no workaround, it is now corrected to 00:04:25:1C:62:3E

Most of the information is out there somewhere but it is offten difficult to understand so the novice (ME) comes to the wrong conclusion. Also the procedures are only for some of the releases, i.e.
http://www.atmel.no/buildroot/buildroot-doc.html the binaries shown are not the ones generated with rc10 :
linux-kernel-2.6.23
rootfs.avr32_nofpu.tar
rootfs.avr32_nofpu.jffs2-root
rootfs.avr32_nofpu.jffs2-usr
u-boot.bin

But that one was not that difficult to figure out.

Still I wondered about the correctness of my ENV variables and other defaults thus my post.
Dyan... "Keep moving forward"

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Looking at the defaults in atngw100_defconfig

#
# bootloader for target device
#
BR2_TARGET_U_BOOT=y
BR2_TARGET_U_BOOT_CONFIG_HEADER_FILE=""
BR2_TARGET_U_BOOT_CONFIG_BOARD="$(BR2_BOARD_NAME)_config"
BR2_TARGET_U_BOOT_SERVERIP=""
BR2_TARGET_U_BOOT_IPADDR=""
BR2_TARGET_U_BOOT_ETH0ADDR="04:25:fe:ed:00:18"
BR2_TARGET_U_BOOT_ETH1ADDR="8e:ed:2a:98:8b:2e"
BR2_TARGET_U_BOOT_BOOTARGS="console=ttyS0 root=/dev/mmcblk0p1 rootwait=1 fbmem=600k"
BR2_TARGET_U_BOOT_BOOTCMD="mmcinit; ext2load mmc 0:1 0x90250000 /boot/uImage; bootm"

I can see why I thought that the 04:25:1C:12:3E was correct. :) Dyan...