This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: Limit region of flash used by RedBoot for FIS?
In gmane.os.ecos.general, you wrote:
>>> CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK - default value is (-1) which
>>> puts the FIS directory in the last erase block of the device.
>>> Just set it to -(N+1), where N is the number of erase blocks that
>>> you don't want RedBoot to touch.
>>
>> Ah. Thanks. It wasn't apparent (at least to me) from the
>> documentation for that option that anything beyond that block
>> would be untouched. It might be good to add that useful bit of
>> info to the comment for that option.
>
> Im not actually sure this is true. I suggest you look
> carefully at the code before you accidental stomp over your
> top 1Mbyte.
I've already stomped on it, and my board is now floating
belly-up. I'm going to drop if off with the HW guy and have it
re-programmed -- I can't get the Altera JTAG flash-programmer
program to work under Linux, and I'm too stubborn to install
Windows and several gigabytes (literally!) of Altera SW.
> In fact a quick examination of fis_init() suggests it does
> erase after the end of the cfg/fis blocks.
Sure looks like it always erases all the way to the end in
the following snippet from fis_init()
482 // Lastly, anything at the end, if there is any
483 if ( erase_start < (((CYG_ADDRESS)flash_end)+1) ) {
484 erase_size = ((CYG_ADDRESS)flash_end - erase_start) + 1;
485 if ((stat = flash_erase((void *)erase_start, erase_size,
486 (void **)&err_addr)) != 0) {
487 diag_printf(" initialization failed at %p: %s\n",
488 err_addr, flash_errmsg(stat));
489 }
490 }
Previously, there's a section that calculates fis_addr based on
CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK, but flash_end isn't
affected by CYGNUM_REDBOOT_FIS_DIRECTORY_BLOCK.
For a short-term fix, I'm going to change the value
CYGNUM_FLASH_BASE_MASK to make the strata driver ignore the top
half of the flash.
--
Grant Edwards grante Yow! PUNK ROCK!! DISCO
at DUCK!! BIRTH CONTROL!!
visi.com
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss