hello,
Excuse to be still in the same issue, but already upgrad the boot
loader revision 6.3, and change the file .ld and the problem
persist!!! in first comand "iap_entry(command, result);" the arm stop!!!
I'm using LPC2129, that have 256K flash and 16K ram.
Anyone can help me??
Thanks
Domingos
I changed the following:
MEMORY {
flash : ORIGIN = 0, LENGTH = 248K
ram : ORIGIN = 0x40000000, LENGTH = 14K
}
__ram_size__ = 14K;
#define IAP_LOCATION 0x7ffffff1
void savesetup(struct SETUP *setup){
typedef void (*IAP)(unsigned int [],unsigned int[]);
unsigned int command[5];
unsigned int result[2];
IAP iap_entry;
//One copy of the structure in RAM
//struct SETUP setup;
//Pointer to the non volatile copy
//struct SETUP *nonvolatile;
//nonvolatile = (struct SETUP*)0x38000; // Points to page 14 in Flash
(LPC2129)
//copy to RAM (if you need)
//setup=*nonvolatile;
disableIRQ();
disableFIQ();
iap_entry=(IAP) IAP_LOCATION;
// get part ID
command[0]=54;
result[0]=0;
escreve_UART0("SEIL AL ");
iap_entry(command, result); // I do this just for a laugh
// result in result[1]
// prepare to erase
command[0]=50;
command[1]=14;
command[2]=14;
escreve_UART0("SEIL AL0 ");
iap_entry(command, result);
escreve_UART0("SEIL AL1 ");
if (result[0] != 0) {
escreve_UART0("bum");
enableIRQ();
}
// erase
command[0]=52;
command[1]=14;
command[2]=14;
command[3]=10000;
escreve_UART0("SEIL AL 1");
iap_entry(command, result); // erase the block - else you get old +
new data mixed !!!
escreve_UART0("SEIL AL 2 ");
if (result[0] != 0) {
escreve_UART0("bum");
enableIRQ();
}
// prepare to program
iap_entry=(IAP) IAP_LOCATION;
command[0]=50;
command[1]=14;
command[2]=14;
iap_entry(command, result);
if (result[0] != 0) {
escreve_UART0("bum");
enableIRQ();
}
// program
escreve_UART0("SEIL AL 3");
command[0]=51;
command[1]=0x3C000;
command[2]=(int)setup;
command[3]=512;
command[4]=10000;
iap_entry(command, result);
if (result[0] != 0){
escreve_UART0("bum");
enableIRQ();
}
enableIRQ();
_________________________________________________________
CEAC Cursos de forma\ufffd\ufffdo profissional - pe\ufffda informa\ufffd\ufffdes aqui.:
http://ceac.online.pt/Message
Re: [lpc2000] problem write in flash
2004-11-12 by dasbento@aeiou.pt
Attachments
- No local attachments were found for this message.