cancel
Showing results for 
Search instead for 
Did you mean: 

Internal flash problem with memory mapping

pchignon
Associate II
Posted on September 15, 2005 at 11:57

Internal flash problem with memory mapping

4 REPLIES 4
pchignon
Associate II
Posted on September 15, 2005 at 07:16

Hi,

I noticed that the following code :

/* TEST FLASH INTERNE */

long *p=(long*) 0x000C0000UL;

long i=*p;

AsystTrace(''MAIN:1\r\n'');

FLASH_Init();

AsystTrace(''MAIN:2\r\n'');

FLASH_WritePrConfig(FLASH_B1F0, DISABLE);

AsystTrace(''MAIN:3\r\n'');

FLASH_SectorErase(FLASH_B1F0);

AsystTrace(''MAIN:4\r\n'');

FLASH_WordWrite(0x000C0000, i+1);

AsystTrace(''MAIN:5\r\n'');

i=*p;

correctly works when the function is execute in sector 0x000xxxxx But failed when map in 0x400xxxxx. The only thing change in my project is the linker option. I use winIDEA IDE with IAR compiler. If I found enough time, I will try with IAR only with a simpler projet.

But now, I don't find any good reason for my bug.

Is somebody has an idea?

Thanks,

pchignon
Associate II
Posted on September 15, 2005 at 08:49

Sorry, but my problem is not so simple.

You are right, I am mistaken. But the problem is still there.

But I have a question.

Is there something to be careful when the program jump from 0x00000000 to 0x40000000. And then, change the bootcr register to map ram at 0x00000000

Thanks,

pchignon
Associate II
Posted on September 15, 2005 at 10:57

Yes,

This is what I did.

I don't know why but during flash erase, the undefined handler is call, when I am executing code at 0x400xxxxx.

I also try to program from RAM but the problem is still there.

I think it is a problem with my linker. I don't understand exactly the meaning of the scater file but IAR use a .xlc file with the same kind of options.

pchignon
Associate II
Posted on September 15, 2005 at 11:57

Yes,

Thank you for your interest.

I think there is still something else.