reset permanent boot environment

Applications, development tools, FPGA, C, WEB
Post Reply
ganssauge
Posts: 2
Joined: Tue Sep 23, 2014 7:11 pm

reset permanent boot environment

Post by ganssauge » Tue Sep 23, 2014 7:25 pm

I managed to compile the RP ecosystem from the github repository and the resulting image bootet the first time :)
Now I'm trying to add python to my buildroot.
That obviously increases the size of the ramdisk image such that it does not fit anymore in the memory area reserved for it at the moment.
I think I found the necessary changes (OS/u-boot/u-boot-xlnx/include/configs/zynq_red_pitaya.h) where I need to specify another address where the devicetree should be loaded.

Code: Select all

/* Default environment */
#define CONFIG_EXTRA_ENV_SETTINGS       \
        "ethaddr=00:26:33:14:50:00\0"   \
        "hw_rev=B\0"    \
        "prod_date=12/22/13\0"  \
        "serial=00000000\0"     \
    "kernel_image=uImage\0"     \
        "ramdisk_image=uramdisk.image.gz\0"     \
        "devicetree_image=devicetree.dtb\0"     \
        "bitstream_image=system.bit.bin\0"      \
        "loadbit_addr=0x100000\0"       \
        "kernel_size=0x500000\0"        \
        "devicetree_size=0x20000\0"     \
        "ramdisk_size=0x5E0000\0"       \
        "fdt_high=0x20000000\0" \
        "initrd_high=0x20000000\0"      \
        "sdboot=echo Copying Linux from SD to RAM... && " \
                "mmcinfo && " \
                "fatload mmc 0 0x3000000 ${kernel_image} && " \
                "fatload mmc 0 0x2E00000 ${devicetree_image} && " \
                "fatload mmc 0 0x2000000 ${ramdisk_image} && " \
                "bootm 0x3000000 0x2000000 0x2E00000\0"
Now the resulting image doesn't boot anymore - at least not with autoboot :(
When I say "env print" in uboot I can see that the sdboot still has 2A00000 as the load address for the devicetree, and I suspect that there somehow exists some non volatile memory on the board where that value is stored.

When I issue the "env default -a" command to uboot and afterwards issue the "boot" command my image boots and python is available :)

Now comes my question:
How do I reset that non-volatile memory to contain my changed sdboot script?
I tried "env save" and that says "Saving Environment to EEPROM..." but at the next reset the old settings reappears.

Cheers,
Gottfried
Last edited by ganssauge on Wed Sep 24, 2014 4:24 pm, edited 1 time in total.

ganssauge
Posts: 2
Joined: Tue Sep 23, 2014 7:11 pm

Re: reset permanent boot environment

Post by ganssauge » Wed Sep 24, 2014 4:20 pm

[Replying to my own message]
In the meantime I found out about the fw_printenv/fw_setenv commands.
I suspect the following should work:

Code: Select all

fw_setenv sdboot 'echo Copying Linux from SD to RAM... && mmcinfo && fatload mmc 0 0x3000000 ${kernel_image} && atload mmc 0 0x2E00000 ${devicetree_image} && fatload mmc 0 0x2000000 ${ramdisk_image} && bootm 0x3000000 x2000000 0x2E00000'
but fw_printenv issued directly afterwards shows that this has no effect :(:

Code: Select all

redpitaya> fw_printenv
bootcmd=run $modeboot
bootdelay=3
baudrate=115200
ipaddr=10.10.70.102
serverip=10.10.70.101
prod_date=12/22/13
kernel_image=uImage
ramdisk_image=uramdisk.image.gz
devicetree_image=devicetree.dtb
bitstream_image=system.bit.bin
loadbit_addr=0x100000
kernel_size=0x500000
devicetree_size=0x20000
ramdisk_size=0x5E0000
fdt_high=0x20000000
initrd_high=0x20000000
sdboot=echo Copying Linux from SD to RAM... && mmcinfo && fatload mmc 0 0x3000000 ${kernel_image} && fatload mmc 0 0x2A00000 ${devicetree_image} && fatload mmc 0 0x2000000 ${ramdisk_image} && bootm 0x3000000 0x2000000 0x2A00000
ethaddr=00:26:32:F0:04:09
nav_code=4662
hw_rev=1.1
serial=141600029
redpitaya>
so, what's wrong?

Post Reply
jadalnie klasyczne ekskluzywne meble wypoczynkowe do salonu ekskluzywne meble tapicerowane ekskluzywne meble do sypialni ekskluzywne meble włoskie

Who is online

Users browsing this forum: No registered users and 25 guests