Discussion:
[U-Boot-Users] Using memory value in a hush shell script?
mitsy
2006-08-17 15:52:37 UTC
Permalink
What is the best way to use a value in a memory location in a hush
shell scritpt that gets run with autoscript?

For example, say a CRC value for area 20000000 -- 20001000 is stored
in a flash, at location 12345678. If I wanted to verify a crc against
this value, I'd like to pass the value at address 12345678 as a last
argument.

crc32 -v 20000000 1000 (data @ 12345678)

or is it better to just read the value from flash, store it in a local
variable and use it?
Wolfgang Denk
2006-08-17 20:04:53 UTC
Permalink
Post by mitsy
What is the best way to use a value in a memory location in a hush
shell scritpt that gets run with autoscript?
Use the "itest" command.
Post by mitsy
For example, say a CRC value for area 20000000 -- 20001000 is stored
in a flash, at location 12345678. If I wanted to verify a crc against
this value, I'd like to pass the value at address 12345678 as a last
argument.
"itest" can use a pointer and dereference it, so you can pass the
address instead of the value.
Post by mitsy
or is it better to just read the value from flash, store it in a local
variable and use it?
There is no easy way to read a value from memory and store it in a
variable.

Best regards,

Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You can observe a lot just by watchin'. - Yogi Berra
mitsy
2006-08-17 21:14:36 UTC
Permalink
Great. Thank you Wolfgang.
Post by Wolfgang Denk
Post by mitsy
What is the best way to use a value in a memory location in a hush
shell scritpt that gets run with autoscript?
Use the "itest" command.
Post by mitsy
For example, say a CRC value for area 20000000 -- 20001000 is stored
in a flash, at location 12345678. If I wanted to verify a crc against
this value, I'd like to pass the value at address 12345678 as a last
argument.
"itest" can use a pointer and dereference it, so you can pass the
address instead of the value.
Post by mitsy
or is it better to just read the value from flash, store it in a local
variable and use it?
There is no easy way to read a value from memory and store it in a
variable.
Best regards,
Wolfgang Denk
--
Software Engineering: Embedded and Realtime Systems, Embedded Linux
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You can observe a lot just by watchin'. - Yogi Berra
Loading...