- coldfire: how to use internal flash?
- Posted by Günther Brunner on April 1st, 2004
Hi,
I am using a Motorola EVB (M5282EVB), Codewarrior and P&E Wiggler to
perform firmware download. It works fine using external RAM for storing
code. However I am not able to download code into internal flash. Every
time I edit the corresponding section in linker file, I get an
errormessage pointing to an error in p&e-dll.
Does anybody of you know how to set up my system to download firmware
into internal flash?
Thanks in advance.
G.B.
- Posted by Casey on April 1st, 2004
Günther Brunner said...
You don't really download it into flash... you need to use the built-in
flash programmer to write the firmware into the internal flash before
debugging.
Set up the IDE Preferences->Flash Programmer to use the
Internal_M5282.pfe personality file and the P&E Wiggler for Comm I/O.
I hope you have better luck debugging while running in flash than I
have. I've had a devil of a time because of getting "number of
breakpoints exceeded" errors when I have zero breakpoints set. There is
a limitation in that you can only have one breakpoint at a time, so you
need to delete one when you reach it before single stepping.
Casey
- Posted by Günther Brunner on April 2nd, 2004
Casey wrote:
Ok, I did that. I took the default "hello world"-application generated
by CodeWarrior and tried to send it to the internal flash programmer
(btw: can one delete it by mistake?). But the code download passes very
fast. So I verified the code and noticed that there is a difference
between .s19 file and code in flash. The only change I made on
CodeWarrior project was to modify M5282EVB_RAM.lcf. I changed line:
TEXT (RX) : ORIGIN = 0x00000500, LENGTH = 0 # using External DRAM
to
TEXT (RX) : ORIGIN = 0xF0000500, LENGTH = 0 # using External DRAM
to point to internal flash memory. All dip switches on EVB are set "ON".
Is there anything else I have to do?
G.B.
- Posted by Casey on April 2nd, 2004
Günther Brunner said...
Are you using Flash Programmer->Connect from the main menu?
How do your interrupt vectors get set? My vectors are stored in flash
starting at 0xF0000000. The flash is initially at 0x00000000 after
power on reset before FLASHBAR is set. The start-up code sets up a
small routine in ram to set FLASHBAR for 0xF0000000, jumps to that
routine, jumps back to startup code (now in 0xF0000000 space), copies
vectors to RAM and continues.
I have SW1-8 and SW1-9 set OFF for internal 32-bit boot from flash.
Reset vector points to setup code also in flash.
Casey
- Posted by Brunner on April 3rd, 2004
Casey wrote:
Yes, I do. If I try to select "Program" a message occurs that says flash
programming was completed. But in fact nothing was done. The verify
command fails.
So I think my code was not transfered to internal flash programmer. Do I
have to configure the dip switches before programming flash memory? Do
you know anything else I could check?
G.B.
- Posted by Casey on April 3rd, 2004
Brunner said...
You might try turning 8 and 9 OFF first, but it may not make a lot of
difference.
Make sure you have IDE Preferences->Flash Programmer->Target Setup->
Configuration file set up to the correct *.cfg for your flash target and
Program Selection->Target file set to the S-record file with flash addresses
in it.
Having said all that, I don't really use the CodeWarrior flash programmer.
CFflasher is a lot easier to work with and works fine with the same cable.
Exit CW, fire up CFflasher, program flash, go back to CW.
If you don't already have CFflasher, you can get it here:
e-www.motorola.com/files/soft_dev_tools/software/programmers/CFFLASHER.zip
Btw, I'm still rather new to the 5282 tools myself.
Casey
Casey
Some days you are the bug, some days you are the windshield.
- Posted by Günther Brunner on April 5th, 2004
Casey wrote:
I took the standard .cfg file (without changes). I logged the messages
from programmer and it says
"Last flash operation was cancelled. Automatically reset the target."
But I did not cancelled the operation! It cancels by himself. Verifing
does work. It recongnized that the code downloaded with CW does not
match and after flashing with CFflasher it says everything is okay.
Yes, that works. However I need Codewarrior to start my program (button
"run"). It has to be possible to get it running without Codewarrior (I
turned switch 8/9 off).
Btw: You don't have to close CW...
So am I.... :-)
Thanks for your help. Maybe metrowerks could help me with getting it
programmed with CW.
G.B.