Hai all;
I am working for an automotive project using LPC 2368.Here I want to store data from RAM to 512k FLASH and to read back while program is running.
I wrote some programs such as IAP for LPC2129 and Flash programming from C:\Keil\ARM\FLASH\LPC_IAP2_512.
In both cases while writing data to Flash from RAM(I wrote some values to RAM),the data in FLASH remain zeros,but in a RED colour.
Will you please tell me ,What is the reason behind this.
Sincerely shamsudheen OP
Dear sir;
All the code expect the following code is working in MCB2300 board.Here I am using the selected flash sector as a storage device(Like EEPROM).That is , I want to write some data to selected Flash Sector and read back to some other RAM location as above in the program while my program is running.
In simulator I can read data from flash to RAM using same code below , but in target it is not working.If I am putting following code in program it is not working in Target(MCB2300) .That is , I canot read the data back to RAM.
/*Reading From flash to RAM*/
for(i=0; i< sizeof(DESTbuf) ; i++) {
DESTbuf[i]=*((unsigned char *)0x00058000+i); }
}
Will be there any other reading mechanism from FLASH to RAM.
We having a function for copying RAM to FLASH,but will be there any function to copy data from FLASH to RAM.
Sincerely Shamsudheen OP
The code for copying Flash to RAM is correct and works on my LPC2368. You say that it is not working. Can you be more specific ?
You can check the memory contents at 0x58000 in the Memory window when you debug your application with ULINK. Then compare this to the buffer in RAM after you execute the lines for reading.
Hi Dear Shamsudheen!
I am trying to write some data to flash memory of LPC23xx , i have also used the same Flash code provided in the Keil Folder..LPC_IAP2_512...and using the main function same as you have posted which is as below..
#include "lpc23xx.h" #include "..\FlashOS.H" #include "typedef.h"
int main() {
U8 bTempBuff[512]={1,2,3,4,5} ; //RAM MEMORY LOCATION
U8 bStoreToRam[512]={'\0'}; //STORE TO RAM LOCATION
U8 b_Count = 0;
Init(0x00058000,4096000,2);
EraseSector (0x00058000); //ERASE SECTOR NUM
ProgramPage(0x00058000, 512 ,bTempBuff);
return(0);
But i get the following error after compilation can you point out what could be the problem...
LPC_IAP2_512.sct(7): error: L6236E: No section matches selector - no section to be FIRST/LAST. LPC_IAP2_512.sct: Not enough information to list image symbols. LPC_IAP2_512.sct: Not enough information to list the image map. LPC_IAP2_512.sct: Finished: 2 information, 0 warning and 1 error messages. "LPC_IAP2_512.axf" - 1 Error(s), 0 Warning(s).