Greetings all,
I am still in my quest to get the MCF52233 DEMO boar running.
The board comes with a CD, and within the CD I found a software example that I am trying to get up and running on the board.
The path in the CD for the software is: "..\files\M52233DEMO\Software_Examples\ColdFire_Lite_DEMO".
After some trouble, I managed to compile the "ColdFire_Lite" target and I managed to upload it to the board. But it didn't work as expected.
When I run the program step by step, I see that the first instruction that it tries to execute is (MCF52235._lo.s):
/******************************************************************** * * This is the main entry point upon hard reset. The memory map is * setup based on linker file definitions, then the higher level * system initialization routine is called. Finally, we jump to the * "main" process. */asm_startmeup:_asm_startmeup: /* Save off reset values of D0 and D1 */ move.l d0,d6 move.l d1,d7
But uppon trying to execute "move.l", it jumps to an exception handler:
/******************************************************************** * This routine is the lowest-level exception handler. */ asm_exception_handler:_asm_exception_handler: lea -16(SP),SP movem.l D0-D1/A0-A1,(SP) lea 16(SP),A1 move.l A1,-(SP) jsr mcf5xxx_exception_handler lea 4(SP),SP movem.l (SP),D0-D1/A0-A1 lea 16(SP),SP rte
Following the code I see this exception tries to print the following message:
printf(EXCEPTFMT, "Illegal instruction", MCF5XXX_SF_PC(framep));
I dont get any message through the serial port but I believe it is because it has not yet been initialized.
Now, my question is: How come I get an illegal instruction if this software is made specificaly for the MCF52233?
What am I doing wrong?
Just as a side note (this may not be a solution to your current problem) - you will not be able to get any Coldfire Lite based program running when compiled with Codewarrior 7.2, and you will not find that mentioned on the Freescale web site either. To be able to run Coldfire lite programs they must be compiled with Codewarrior 7.1.
The reason for that is because Codewarrior 7.2 uses a different method of passing parameters to functions (REG_ABI, via CPU registers). Coldfire Lite uses some assembly language routines that get parameters passed to it using STD_ABI (via stack).
Even though Coldfire Lite will compile fine on Codewarrior 7.2, it will crash shortly after the program is run on the target.
I have a modified version of Coldfire Lite available that does work when compiled with CW7.2, see http://www.mvdh.be/cf_lite_patched.html. But make sure to read the comments...
Thank you Marc!
This is actually exactly what has been happening to me.
I managed to compile and flash the board but the program would crash in the very beginning of the code, during initialization.
I will try to recompile it with CW7.1 and write back here my experience.
Some more information:
I created a new project using Processor Expert and I managed to make it run on the demo board. But it will only work if I choose INTERNAL_RAM as target. If I choose INTERNAL_FLASH it behaves like the demonstration software. It appears as if I am not managing to program the MC52233 Flash memory correctely...
Ok... I got further...
Apparently I have to program the Flash manualy, using the tools->Flash Programmer....