Error in running with const allocated over 128k of flash

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Error in running with const allocated over 128k of flash

4,114 Views
fabiomo
Contributor I
I use MCF52233 (256k of flash) and Codewarrior 6.3
I have a program greater than 128k of flash and this problem:
If I compile from address 0 the program goes well.
If I compile from address 0x5000, because I have implemented a bootlader, some const (that are allocated over 128k) result corrupted. I can say this because I see on the display some const (graphics) wrong. Variables are well shown on the display.

If I compile from addess 0x500 and the program is less than 128k it goes well.

Code mode and data mode is already far (32bit)

Can someone help me?
best regards
Fabio

Labels (1)
0 Kudos
5 Replies

503 Views
fabiomo
Contributor I
I have noted that it isn't a runtime error, it isn't an error of accessing the flash over the 128k.
But it is an error of the bootloader.
In the first location I have the code, in the higher memory I have the const, the const string that I use to draw the graphics in the display..and these, over the 128k, are written bad from the bootloader. It is very strange

I think there is some settings in the compiler/linker that I don't have considered
Now I try to define these like "const far" or something of similar...
I don't understand...
0 Kudos

503 Views
Technoman64
Contributor III
Have you taken into consideration the FLASH memory protection and status values located in ROM starting at adress 0x0400 to 0x0418?
 
These locations set the access rights for the 256k range of FLASH memory. If these are configured incorrectly an access vilolation exception will occur.
0 Kudos

503 Views
fabiomo
Contributor I
thank's Technoman, yes I have considered that problem, I have solved with these 2 instructions:

move.l   #0x161,d0      /*workaround 1 due to the Internal FLASH Speculation error in the first devices*/

movec   d0,RAMBAR0

best regards
FAbio


Message Edited by fabiomo on 2008-01-04 07:12 AM
0 Kudos

503 Views
mjbcswitzerland
Specialist V
Hi Fabio

Here's a link to more details fo the problem observed:
http://forums.freescale.com/freescale/board/message?board.id=CFCOMM&message.id=3116&query.id=5537#M3...

For anyone else who may experience similar effects or would like to understand more, please see Fabio's thread at the uTasker forum where there are more details:
http://www.utasker.com/forum/index.php?topic=142.0

Regards

Mark

www.uTasker.com


0 Kudos

503 Views
fabiomo
Contributor I
sorry Mark if I was rude because I didn't explaine that YOU have solved my problem in utasker forum.
I cannot explain why with this modification the bootloader go, but Mark has done it in the link he has writed in previous message.
Yes I was very rude..sorry mark
With your work I think I'll never solved my problems...

thank you Technoman64 for the reply

best regards
Fabio

0 Kudos