[ECOS] RedBoot "get MAC address" API - Reading flash config value from application

Guenter Ebermann guenter.ebermann@googlemail.com
Tue Jan 27 16:02:00 GMT 2009


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?

> 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.

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



More information about the Ecos-discuss mailing list