This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RedBoot "get MAC address" API - Reading flash config value from application


Guenter Ebermann wrote:
Hi Juergen,

2009/1/27 Jürgen Lambrecht <J.Lambrecht@televic.com>:
Our application clears the RedBoot ROM monitor's VVT, because we do not want
to have code executed from ROM (where RedBoot resides).
To be able to read the MAC address out of RedBoot's configuration stored in
flash, I copied code from ecos/packages/redboot/../fconfig.c and
ecos/packages/hal/common/../hal_if.c.
I use a recent ecos.

It works now, but it did not work first because I used the macro's from
ecos/packages/hal/common/../hal_if.h.
This does not work:
CYGACC_CALL_IF_FLASH_CFG_OP_SET(flash_config_op); //add flash config access
function to the VVT
(By debugging, I saw that the entry in the VVT (20) stays empty (NOP).)
ok = CYGACC_CALL_IF_FLASH_CFG_OP( CYGNUM_CALL_IF_FLASH_CFG_GET, \
"eth0_esa_data", \
mac_address, \
6);

Normally the CYGACC_CALL_IF_FLASH_CFG_OP macros are used to execute code
located in the RedBoot from within an application. The virtual vector
table is normally already setup
by RedBoot in this case.
If you do not want to call RedBoot code why bother with this macros anyway?
I want to keep my code independent of the type of build I make - with or without ROM monitor.
Originally we used the standard RAM build where 'CYGACC_CALL_IF_FLASH_CFG_OP' works.
But that RAM build had timing problems because of code in ROM.
Therefore, I build a "JTAGRAM" version, were I clear the VVT and let the application fill it. But then I also had to write code to let 'CYGACC_CALL_IF_FLASH_CFG_OP' work again..
This works:
hal_virtual_vector_table[CYGNUM_CALL_IF_FLASH_CFG_OP]=(CYG_ADDRWORD)(flash_config_op);
esa_ok = flash_get_config("eth0_esa_data", &enaddr[0], 6);

If you already duplicated the flash_config code from redboot it makes
no sense to setup the
virtual vector table. RedBoot itself also does not use the virtual
vector to call functions, it also uses
the flash_get_config calls directly. So the second call to
flash_get_config is enough.
Indeed, you're right.
best regards,
Guenter




-- Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]