* [U-Boot] U-boot : compare read and expect value
@ 2012-12-10 10:58 Khalid Tourabi
2012-12-10 12:06 ` Wolfgang Denk
0 siblings, 1 reply; 4+ messages in thread
From: Khalid Tourabi @ 2012-12-10 10:58 UTC (permalink / raw)
To: u-boot
Hi,
I'm newbie and I want to use scripts to test the board peripherals (I2C,
SPI, LAN, PCIe, USB, ...) using u-boot.
My problem is how to compare the reading with the expected value?
the reading is in an environment variable? If so which one?
I searched the forums and docs without success.
Thanks & Best Regards,
Khalid
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] U-boot : compare read and expect value
2012-12-10 10:58 [U-Boot] U-boot : compare read and expect value Khalid Tourabi
@ 2012-12-10 12:06 ` Wolfgang Denk
[not found] ` <50C5F2D6.5060204@planar.com>
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2012-12-10 12:06 UTC (permalink / raw)
To: u-boot
Dear Khalid Tourabi,
In message <50C5C063.2020600@planar.com> you wrote:
>
> I'm newbie and I want to use scripts to test the board peripherals (I2C,
> SPI, LAN, PCIe, USB, ...) using u-boot.
> My problem is how to compare the reading with the expected value?
> the reading is in an environment variable? If so which one?
> I searched the forums and docs without success.
Have a look at the setexpr command...
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Ein weiser Herrscher kann in einem gro?en Land mehr Gutes bewirken
als in einem kleinen - ein dummer Herrscher aber auch viel mehr Un-
fug. Da weise Herrscher seltener sind als dumme, war ich schon immer
gegen gro?e Reiche skeptisch. - Herbert Rosendorfer
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] U-boot : compare read and expect value
[not found] ` <50C5F2D6.5060204@planar.com>
@ 2012-12-10 14:58 ` Wolfgang Denk
2012-12-10 18:24 ` Khalid Tourabi
0 siblings, 1 reply; 4+ messages in thread
From: Wolfgang Denk @ 2012-12-10 14:58 UTC (permalink / raw)
To: u-boot
Dear Khalid Tourabi,
please don't top post / full quote, and keep the mailing list on Cc:
In message <50C5F2D6.5060204@planar.com> you wrote:
>
> Thanks for your answer.
>
> setexpr command allows set the result operation in an environment
> variable.
> But I want to set the result command (string) in an environment
> variable to compare it with the expect value.
Build it from parts. Start with putting the expected value in an
environment variable, so you can use setexpr to compareit against the
actual value. Then use conditionals to react as needed. Use standard
shell scripting methods.
Best regards,
Wolfgang Denk
--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You can't have everything... where would you put it? - Steven Wright
^ permalink raw reply [flat|nested] 4+ messages in thread
* [U-Boot] U-boot : compare read and expect value
2012-12-10 14:58 ` Wolfgang Denk
@ 2012-12-10 18:24 ` Khalid Tourabi
0 siblings, 0 replies; 4+ messages in thread
From: Khalid Tourabi @ 2012-12-10 18:24 UTC (permalink / raw)
To: u-boot
Dear Wolfgang Denk
> Dear Khalid Tourabi,
>
> please don't top post / full quote, and keep the mailing list on Cc:
Ok sorry thanks.
>
> In message<50C5F2D6.5060204@planar.com> you wrote:
>> Thanks for your answer.
>>
>> setexpr command allows set the result operation in an environment
>> variable.
>> But I want to set the result command (string) in an environment
>> variable to compare it with the expect value.
> Build it from parts. Start with putting the expected value in an
> environment variable, so you can use setexpr to compareit against the
> actual value. Then use conditionals to react as needed. Use standard
> shell scripting methods.
>
> Best regards,
>
> Wolfgang Denk
>
I added setexpr command, but I don't understand how to use it for my need.
For example :
u-boot# set expct "FF7F7F7F7F7F7FC2"
u-boot# sspi 8 64 9F
FF7F7F7F7F7F7FC2
u-boot#
This SPI command allows to read the NVRAM code ID, I want to compare
with $expct unsuccessfully
u-boot# if test "sspi 8 64 9F" = $expct ; then echo Success; else
echo Error; fi;
Success
u-boot# set expct "FF7F7F7F7F7F7FC"
u-boot# if test "sspi 8 64 9F" = $expct ; then echo Success; else
echo Error; fi;
Success
$expct either equal to "FF7F7F7F7F7F7FC2" or "FF7F7F7F7F7F7FC" the
result of if condition is the same.
Many Thanks for your help.
Khalid
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-12-10 18:24 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-12-10 10:58 [U-Boot] U-boot : compare read and expect value Khalid Tourabi
2012-12-10 12:06 ` Wolfgang Denk
[not found] ` <50C5F2D6.5060204@planar.com>
2012-12-10 14:58 ` Wolfgang Denk
2012-12-10 18:24 ` Khalid Tourabi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox