MCF52259EVB - Can run demo from SRAM but not FLASH

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

MCF52259EVB - Can run demo from SRAM but not FLASH

Jump to solution
3,035 Views
FridgeFreezer
Senior Contributor I

Hi guys,

I am working on a project to port a system to the M52259 and have got myself a 52259EVB with the associated copy of Codewarrior (7.1.1a) .

 

I can load & compile the included demo (M52259EVB_example.mcp) and it runs on the board if you target the SRAM, but if I change the target to FLASH it fails with an illegal instruction:

 

20001D80: 4000            negx.b   d0

 

I'm quite rusty on the low-level stuff (all my recent C work has been on a pre-existing embedded environment) can anyone give me a nudge in the right direction?

 

Most confusing is that I'm using the copy of  CW supplied with the EVB, with the example project supplied on the CD, to build for a target defined as standard in the project, yet it doesn't work :smileysad:

Labels (1)
0 Kudos
1 Solution
830 Views
FridgeFreezer
Senior Contributor I

This morning I tried the same thing with the M52259DEMO board (and the associated CW project file) and the behaviour is exactly the same, it will run from RAM but not from Flash.

 

After a lot of fiddling around (these boards do not seem very well documented) I have managed to make the flash programmer work and both boards are now flashed and behaving as they should.

 

The annoying thing is there is nothing in the example projects or Demokit / EVB documentation to describe how to get a flash targetted build to run (and the "run" and "debug" buttons don't do it in CW). It was only through reading this thread about the bootloader that I found any information at all on flash programming:

http://forums.freescale.com/freescale/board/message?board.id=CWCFCOMM&thread.id=3234

And even then the Flash programmer needs different configurations (you need to load a .cfg file as well as an XML file it seems, and the BDM settings are different for the DEMO board and the EVB).

 

Anyway - it's working now, but I'm really not impressed with what is supposed to be a showcase for the M52259 & CodeWarrior. G++ is looking better value every day...

View solution in original post

0 Kudos
11 Replies
830 Views
FridgeFreezer
Senior Contributor I

Just to add, to check I haven't changed anything I deleted the project & unzipped it straight from the CD, I get the same exception with a different opcode but at the same address:

 

20001D80: 00009F60        ori.b    #0x60,d0

 


 

0 Kudos
830 Views
J2MEJediMaster
Specialist I

It sounds like you need to file a service request on that. Click here to be redirected to the service request page.

 

---Tom

0 Kudos
831 Views
FridgeFreezer
Senior Contributor I

This morning I tried the same thing with the M52259DEMO board (and the associated CW project file) and the behaviour is exactly the same, it will run from RAM but not from Flash.

 

After a lot of fiddling around (these boards do not seem very well documented) I have managed to make the flash programmer work and both boards are now flashed and behaving as they should.

 

The annoying thing is there is nothing in the example projects or Demokit / EVB documentation to describe how to get a flash targetted build to run (and the "run" and "debug" buttons don't do it in CW). It was only through reading this thread about the bootloader that I found any information at all on flash programming:

http://forums.freescale.com/freescale/board/message?board.id=CWCFCOMM&thread.id=3234

And even then the Flash programmer needs different configurations (you need to load a .cfg file as well as an XML file it seems, and the BDM settings are different for the DEMO board and the EVB).

 

Anyway - it's working now, but I'm really not impressed with what is supposed to be a showcase for the M52259 & CodeWarrior. G++ is looking better value every day...

0 Kudos
830 Views
DK1BN
Contributor III

Same here. The documentation seems to be really lousy and you have to look around to find some hints what could be the cause of some elementary problems.  My colleague was really lost( he is the softwareguy  not me ! :-)). He could flash  but he could  not debug in the flash area only in ram.

So please post what are the correct .cfg and .xml files for the M52259DEMO board.

 

 

Thanks

Walter

 

0 Kudos
830 Views
FridgeFreezer
Senior Contributor I
Glad it's not just me!

 

I used MCF52259_INTFLASH.xml and M52259DEMO.cfg / M52259EVB.cfg, you need to check the BDM settings too: The Demo board is "ColdFire V2-V4 JM60 OSBDM" and the EVB is "PEMICRO_USB".

 

My next problem is trying to compile & run code in CodeSourcery G++, which doesn't have the CW benefit of ready-made example projects or CPU headers (or if it does, I can't find them!) so it seems it's about the same level of annoying as CW, but in different ways and it's cheaper to buy :smileytongue:

 

Decisions, decisions!

0 Kudos
830 Views
martinw
Contributor III

Hi Guys,

This is a coldfire project?

If you are evaluating toolsets have a look at crossware - www.crossware.com.

We have used their tools extensively on a coldfire project (5472) for the last 3 years.  It's a small company and you'll find the response time to problem requests is very quick.

I found a problem in the linker (something that no-one had ever used before) and it was fixed in 24 hours.

0 Kudos
830 Views
FridgeFreezer
Senior Contributor I
Just for reference, here's the reply from Freescale's tech support to my (cancelled) service request:
Yes, you are correct. CodeWarrior for ColdFire DOES NOT behave like the
HC08 and HC12 tools when downloading code to internal FLASH.
Code MUST be downloaded by the Flash programmer to internal Flash of the
MCF52259 first. Once code is programmed in Flash it can be debugged
then.

We are sorry for not emphasis this issue in document and will update it
in new version. Sorry for the inconvenience this had caused to you.
0 Kudos
830 Views
DK1BN
Contributor III

Thanks for info. We encounter now a problem with flash programming. The first 64k  are ok but after that we get "Coldfire GDI Protocol Adapter : An error ocurred while trying to write memory".

OSBDM JM60 was updated and erasing all sectors is working. Our program is about 2C008  (about 3x 64k long) .

No idea so far :smileyhappy:.

 

 

Walter

 

0 Kudos
830 Views
mykepredko
Contributor IV

Hiya,

 

I must be particularly thick this morning, but I'm having the same problems but I can't figure out what I'm doing wrong from the descriptions here. 

 

Could somebody please point to the xml file that has to be downloaded first and how that is accomplished?  I've selected the M5223EVB initialization files (that's the board I'm working with) as as the CFM_MCF5223 Flash configuration.  So I believe that I'm doing the right things. 

 

The frustrating part of this, is I was able to burn the Flash successfully with a previous PC that had a hard disk crash. 

 

Thanx,

 

myke

0 Kudos
830 Views
DK1BN
Contributor III

OK , got it working ....  may be wrong .xml file for the programmer. We are using PE now and have some other problems. Get an exception error at the main() entry. I am not a  programmer :smileyhappy: but my software colleague who is an experienced C programmer could not figure it out either. 

 

 

 

0 Kudos
830 Views
DK1BN
Contributor III

Thanks will try it today. I did the Firmware update of the JM60 OSBDM yday. Did you use PE with the demoboard? On Codewarrior 6.2 with S08/Coldfire V1 we had not such problems like we are experiencing with the 7.1.2 version.

 

 

 

 

0 Kudos