This is the mail archive of the ecos-patches@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]

[Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board


Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001561

--- Comment #31 from Nicolas Aujoux <nau@csm-instruments.com> 2012-07-10 14:24:46 BST ---
Hi Ilija,

Thank you for your help. I move the function into RAM as you mentionned and it
works well. 
I added the patches that implement this functionnality and remove the flash
limitation.

Nicolas

(In reply to comment #28)
> Created an attachment (id=1819)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1819) [details]
> K60 Redboot-Flash ECM file
> 
> Hi Nicolas
> 
> (In reply to comment #27)
> > Created an attachment (id=1807)
 --> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1807) [details]
[details]
> > Hal part of the patch
> 
> I have tested it at seems to work. With attached ECM applied I could use "fis
> init" and "fconfig -f".
> 
> There's, however, one limitation - we can't write to the flash bank that
> contains Redboot itself. This is easily achieved by placing
> flashCommandSequence() in RAM (only one function goes to RAM - good software
> design :) ).
> 
> eCos has provision for this with ".2ram" memory section(s). You just need to
> add the __attribute__ to the function declaration:
> 
> -- Code snippet ---
> static int flashCommandSequence(cyg_uint8, cyg_uint8*) __attribute__((section
> (".2ram.flashCommandSequence")));
> 
> -- snippet end ---
> 
> Now that we have it working, you can remove REDBOOT_IMAGE_SIZE macro as fis
> will recognize and reserve the Redboot area.
> Note: Flash configuration record 0x400-0x40f still must be protected from
> accidental writing.
> 
> -- Code snippet ---
> 
> CYG_FLASH_DRIVER(hal_kinetis_flash,
>                  &cyg_kinetis_flash_funs,
>                  0,
>                  CYGMEM_REGION_flash,
>                  (CYGMEM_REGION_flash + CYGMEM_REGION_flash_SIZE - 1),
>                  1,        //number of block info
>                  cyg_flash_kinetis_block_info,
>                  &hal_kinetis_flash_priv);
> 
> -- snippet end
> 
> Next things we should address are support for other parts: K40, K70 and
> automatic Flash type/size recognition.
> 
> Ilija

-- 
Configure bugmail: http://bugs.ecos.sourceware.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


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