Go to nxp.com
Where is this place located?
to create and rate content, and to follow, bookmark, and share content with other members.
EEPROM to JK3
Discussion created by
Carlos Enrique Posso Sabogal
on Oct 23, 2006
on Oct 24, 2006 by bigmac
Show 0 Likes
HI. I need to save two bytes and to recover them soon. I am being based on document AN2504 to write and to read the Flash, but it does not work to me. I need a different example that it works with CodeWarrior and that makes the functions correctly.
This content has been marked as final.
Show 2 comments
(Required, will not be published)
Oct 24, 2006 2:40 PM
Check out FAQ-26240. (Enter this string in the Enter Keyword field at the upper right of this web page.) It references a number of application notes, which may be of use to you.
Show 0 Likes
Oct 24, 2006 2:57 PM
If my understanding of your problem is correct, you wish to write two bytes of data to flash, as part of the normal operation of your JK3 code. Assuming this needs to be done only infrequently, so as not to exceed the endurance limit for the flash, it is really only necessary to erase one page of flash (64 bytes), and re-program the first two bytes. There are no special measures required to directly read the data from flash. The first flash block would normally be chosen so that the remainder of the code can be write protected.
The code shown in AN2504 does far more than you require to do, and with more overheads, to cater for the more general case. However, the various other sources of documentation on the use of the ROM based routines are generally described in assembly code, rather than C. You did not say exactly what your problem is.
To use the ROM routines, the primary requirement is the use of specific locations in RAM, which would normally require six bytes for writing two data bytes only. However, I would suggest you look at AN1831, where a problem with the page erase routine, applicable to the JK3 and other devices, is discussed. This will involve a "page erase work-around", which requires use of a greater amount of RAM. I am not sure whether AN2504 actually takes this issue into account.
The use of the ROM routines is also discussed in AN2874, but not the page erase problem.
I have previously used a very simple assembly sub-routine to do the same task that you seem to require, but for the QY device that does not have the page erase issue. Let me know if you are interested in the code, and I will post it.
Show 0 Likes
Retrieving data ...
add 64GB eMMC in the imx8mq evk board
HOWTO: Update OpenSDA Firmware on EVB
HOWTO: Generate S-Record/Intel HEX/Binary file
HOWTO: Add custom SDK into existing project
HOWTO: Create FreeRTOS project in S32 Design Studio