Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Does it possible to flash NVRAM from U-Boot via the serial port? I know its possible from U-Boot to upload the firmware to router memory and install it. Here is an example, showing how to unbrick router with Serial Line Recovery, using HyperTerminal in Windows to transfer binary. Is it possible to use the same method for reflashing NVRAM by loading nvram backup from U-Boot via the serial port?(the host OS Windows).
Cable modem appears to have nvram corrupted. U-Boot 1.2.0 bootloader is working, I can connect to modem via serial interface, view boot process and upload firmware.
I dont know to which memory address to upload the nvram to.
Code:
loady 0x007b0000
What are the next steps after the upload is complete? (erase the NVRAM, then copy new, reset?)And what's target addresses in memory?
I dont think the command 'erase' writes into NVRAM....
Look for an embedded app meant for writing data to nvram....Or you can write it by your own..
(*addr) = 0x0000;
Use tftp to get the nvram content into the RAM (any non-active empty space ex: 0x200000) ...Then use:
cp.b <copied_RAM_addr> <NVRAM physical address: get it from mapping table in u-boot> <size of content>
I dont think the command 'erase' writes into NVRAM....
Look for an embedded app meant for writing data to nvram....Or you can write it by your own..
(*addr) = 0x0000;
Use tftp to get the nvram content into the RAM (any non-active empty space ex: 0x200000) ...Then use:
cp.b <copied_RAM_addr> <NVRAM physical address: get it from mapping table in u-boot> <size of content>
I think this should work...
I mean with command 'erase' old data should be erased first (as writing to flash memory may fail when the target area has not been erased). I don't have embedded app, I mean use U-Boot commands.
I want try Hyperterminal to transfer nvram content into the RAM.
For erase command, is this correct [start] [end] addresses for "nvram"?
erase 0x007b0000 0x00800000
What specifically is the non-active empty space address in my case?
NVRAM physical address from mapping table in u-boot: is it 0x007b0000?
How to get size of content bytes, NVRAM.bin in proper format?
I mean with command 'erase' old data should be erased first (as writing to flash memory may fail when the target area has not been erased). I don't have embedded app, I mean use U-Boot commands.
I want try Hyperterminal to transfer nvram content into the RAM.
For erase command, is this correct [start] [end] addresses for "nvram"?
erase 0x007b0000 0x00800000
erase cmd is meant for erasing flash (NOR/NAND) and erase basincally mean wrirting 0xfffff...
So after u execute erase with your NVRAM addr, it internally checks whether those addr come in constraint of addr mapped under flash area....Since nvram addr are not flash addr...it ignores writing to ur specified area....
so ur cmd erase 0x007b0000 0x00800000
doesnt work hopefully....
Jst write your own app wth instrs as below:
for loop with nvram constraint addr
{
*(volatile unsigned long *)addr = 0xffffffff (or) 0x0000;
incr add wth 4;
}
Quote:
What specifically is the non-active empty space address in my case?
find out what RAM addr does your bootloader/kernel uploader app uses in boot loader env.
Coz, these cmds use empty space in RAM to copy data from tftp to RAM and then to flash via cp.b/w/l
Normally uboot resides at bottom region of RAM... So, i think you can use top area of ram to copy nvram image/content.
Quote:
NVRAM physical address from mapping table in u-boot: is it 0x007b0000?
Yes it is: You can even check it in bootloader/include/configs/processor-name_configs.h
You should find all the interface mapping here.......
Quote:
How to get size of content bytes, NVRAM.bin in proper format?
Ohh, I have no firmware source code at all, so can't check bootloader/include/configs/processor-name_configs. U-boot have the following commands. Host OS is Windows as well.
When doing firmware update from TFTP server, the firmware Load address is 0x80000100: can it be used as non-active empty space for loading nvram?
Ohh, I have no firmware source code at all, so can't check bootloader/include/configs/processor-name_configs. I can only use this U-boot commands available. Host OS is Windows as well.
So, nvram does not allows writing to specified area. But when the target area hasn't been erased, or if its write-protected, writing to flash memory may fail. Is there a solution with U-Boot then?
I just re-read the guide about Flashing from U-boot, there are mentioned commands 'erase the NVRAM'. Perhaps I'm missing something.
You can use "mw" command to write/erase NVRAM area from the commands link you hve given ...
ex: mw.l <addr> <data> <Length of memory/4>
Quote:
When doing firmware update from TFTP server, the firmware Load address is 0x80000100: can it be used as non-active empty space for loading nvram?
Yes you can use same addr....for copying NVRAM.bin to RAM (from tftp command) and then copy that image from RAM ( 0x80000100) to NVRAM physical area (0x007b0000) using cp.b cmd & specifying the size of image....
Better hve a linux OS....Coz i dont have idea of tftp in windows...If you know you can carry on!!!
Thanks for tips. I found the sequence of commands U-boot use for upgrades. Based on this it should be:
Code:
tftp 0x80000100 nvram.bin
protect off 0x007b0000 +0x00050000
erase 0x007b0000 +0x00050000
sleep 3
cp.b 0x80000100 0x007b0000 0x00050000
protect on 0x007b0000 +0x00050000
I tried commands, but got error 'bad address format' (I tried also another representation of addresses):
Code:
=> tftp 0x80000100 NVRAM.bin
TFTP from server 192.168.100.2; our IP address is 192.168.100.1
Filename 'NVRAM.bin'.
Load address: 0x80000100
Loading: T #################################################################
done
Bytes transferred = 327680 (50000 hex)
=> protect off 0x007b0000 +0x00050000
Error: end address (0x007fffff) not in flash!
Bad address format
=> protect off 0x7b0000 +0x50000
Usage:
protect - enable or disable FLASH write protection
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.