This is the mail archive of the
ecos-patches@sourceware.org
mailing list for the eCos project.
[Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
- From: bugzilla-daemon at bugs dot ecos dot sourceware dot org
- To: ecos-patches at ecos dot sourceware dot org
- Date: Tue, 10 Jul 2012 10:02:28 +0100
- Subject: [Bug 1001561] Internal flash driver for Freescale TWR-K60N512 board
- Auto-submitted: auto-generated
- References: <bug-1001561-104@http.bugs.ecos.sourceware.org/>
Please do not reply to this email. Use the web interface provided at:
http://bugs.ecos.sourceware.org/show_bug.cgi?id=1001561
--- Comment #28 from Ilija Kocho <ilijak@siva.com.mk> 2012-07-10 10:02:21 BST ---
Created an attachment (id=1819)
--> (http://bugs.ecos.sourceware.org/attachment.cgi?id=1819)
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]
> 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.