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

Jürgen Lambrecht J.Lambrecht@televic.com
Tue Jan 27 15:18:00 GMT 2009


Hello,

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);
I also tried this, but it did not work:
    info.key = "eth0_esa_data";
    info.val = (void *)&enaddr[0];
    info.type = 6;
    info.offset = 0;
    esa_ok = CYGACC_CALL_IF_FLASH_CFG_OP2(CYGNUM_CALL_IF_FLASH_CFG_GET, 
&info);

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);

So I'm curious to know why the macro's from 
ecos/packages/hal/common/../hal_if.h do not work.

Kind regards,
Jürgen


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