Very Basic Questions

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

Very Basic Questions

2,331 Views
Eggmania
Contributor I
Hello.
 
I've been using CW for the HCS12X and and migrating over to ColdFire.  Oddly enough the CW IDE for ColdFire has some differences and I'm confused by a few things.
 
*> The user's manual for the M52233Demo board says that you should run and debug your code in internal ROM before migrating over to flash for regular use.  But I do not see anything explaining that process.
 
*> The HCS12X version of CW debugged in a separate simulation window.  Is anything like this available for ColdFire?
 
*> I get strange errors trying to compile the default projects that get created by the IDE.  A C++ project will only compile if I pick Console as the target.  For example if I pick 'UART Debug' or 'Internal ROM' I get these errors:
 
Error   : declaration syntax error
Int_handlers.c line 14   extern "C" { 
Error   : declaration syntax error
Int_handlers.c line 191   }
Error   : ')' expected
fec.c line 193    nif->receive = (void (*)(NIF_t*))&fec_receive; 
Error   : declaration syntax error
mcf5xxx.c line 10   extern "C" { 
Error   : declaration syntax error
mcf5xxx.c line 511   }
Error   : declaration syntax error
mcf52233_sysinit.c line 340   }
 
Are there some other project settings I have to set somewhere to use these other modes?
 
*> A C project will compile under any mode, but if I run it under 'Internal ROM' I get an error when I try to step through the code.  The first line it starts with is
 
jmp _asm_startmeup
 
and I get a Windows pop-up error box with the message
 
Exception vector name : Address error
 
Any thoughts on this one?
 
I'm also puzzled as to what manual I should be using to learn to program the MCU on the board.  I'd thought we had the MCF52233, but no chip on the board has that name.  I see an MC9S12UF and a PCF52233CAF60, neither of which I see manuals for.  Freescale's product page for the demo board lists a manual for a genenric chip family.
 
 
 
Labels (1)
0 Kudos
Reply
2 Replies

779 Views
admin
Specialist II
The MC9S12UF32 is an HCS12 device dedicated the on-board USB BDM.  You should not try to access this device
 
The target MCU for your board is the PCF52233CAF60.  PCF signifies a pre-production device similar in all functions to the production MCF device.
0 Kudos
Reply

779 Views
SimonMarsden_de
Contributor II
Hi

I'll try to answer some of your questions...

I don't think the user manual should suggest starting with 'Internal ROM' as the target BEFORE migrating to Flash. This target IS the one to build when Flashing the code into the on-chip Flash (which CW is calling Internal ROM).

Instead you should start with a target like 'Console Debug' or 'UART Debug'.

The difference between the targets is as follows:

:smileyinfo: The 'Console Debug' and 'UART Debug' targets run out of the processor's on-chip SRAM. The debugger loads the code into the SRAM via the BDM cable before running it. This means that it's very quick to test code without having to burn it into Flash. (Note: Some ColdFire processors have external SDRAM, and for these processors the corresponding CodeWarrior project may locate the code in the SDRAM instead).

The 'Internal ROM' target runs out of Flash. After building it, you need to program the executable into Flash using CodeWarrior's Flash Programmer tool. (The debugger cannot download code into the Flash)

If you try to run the target without programming the Flash, the debugger will connect to the board via the BDM and try to execute uninitialised/stale Flash. This explains why your attempt to execute the code was giving the 'Address Error' exception.

(ii) The 'Console Debug' and 'UART Debug' targets differ in that the 'Console Debug' target performs I/O - printf(), getc(), etc - by opening a window on the PC. This is achieved by a special library linked into the 'Console Debug' target which causes I/O routines to communicate with the debugger via the BDM cable.

The 'UART Debug' and 'Internal ROM' targets perform I/O using the UART, so you would need to connect the board to a terminal emulator on the PC using a serial port.


CodeWarrior does have a ColdFire simulator, allowing you to run code without hooking up to a real board. However, I've barely used it so I can't comment on its effectiveness.

I don't know what's causing your compile error. Creating a new C++ project from stationery works OK for me.


Hope this helps
0 Kudos
Reply