different ways of programming MCF52233

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

different ways of programming MCF52233

5,464 Views
wolfgarb
Contributor I
Hi,
i have one M52233DEMO evaluation board and i program it throught USB.
Does anyone know different ways of programming M52233?


Message Edited by wolfgarb on 2008-12-09 05:47 PM
Labels (1)
0 Kudos
Reply
15 Replies

1,547 Views
RichTestardi
Senior Contributor II
Hi,
 
I'm not 100% sure of your question, but if you're asking about compilers/development environments, then two I can suggest are:
 
  CodeWarrior Special Edition v7.1
  Sourcery G++ Lite Edition for ColdFire
 
If you are asking for ways to manipulate the flash memory on the chip, you can use one of:
 
  Tools -> Flash Programmer, from CodeWarrior (uses USB)
  a standalone programmer, PROGCFZ, from PE Micro (uses USB; I have not used this)
  QSPI/EzPort (does not use USB)
 
The QSPI/EzPort mechanism requires a master mode QSPI device to initiate the programming, and the MCU boots in slave mode, ready to accept commands to manipulate its flash.
 
I have sample code to clone one MCU's flash to another using QSPI/EzPort, in skeleton.zip, here: http://www.cpustick.com/downloads.htm
 
You need a cable from master to slave that looks like:
 
> help clone
clone cable:
  master     slave
  ---------  ----------------
  qspi_clk   qspi_clk (ezpck)
  qspi_din   qspi_dout (ezpq)
  qspi_dout  qspi_din (ezpd)
  qspi_cs0   rcon* (ezpcs*)
  scl        rsti*
  vss        vss
  vdd        vdd
>
 
If you can give me a bit more detail what you want to do, then I can probably give you a better answer...
 
-- Rich
 
0 Kudos
Reply

1,547 Views
wolfgarb
Contributor I
Hi,
thanks for answering.
Sorry for not being more detailed in my question.
The enviroment that i´m working is Freescale CodeWarrior with M52233DEMO demo board.
When i download my codes to the mcu, i use USBMICRO to do this.
But i made a board with this mcu and i don´t want to use USB to download my codes. I was using Freescale USB-TAP (BDM cable) to download my codes into my MCU. But i want more options to do this because i have only one cable and more persons im my class need to use the boards.
Is there more options to download codes in my mcu besides USB and BDM?


Message Edited by wolfgarb on 2008-12-09 07:09 PM
0 Kudos
Reply

1,547 Views
RichTestardi
Senior Contributor II
Hi,
 
I understand.  It sounds like what you really want is an Ethernet bootloader, so each student can download their own bits?
 
I actually have a skeleton source code project (where folks can add their own code) at the link above, which allows you to do this for the MCRF52233.
 
Alternately, at the risk of running us down a rathole :smileyhappy:, the software I wrote is specifically designed for a classroom environment, and allows students to trivially connect *any* PC to *any* board, and program it with an MCU-resident programming environment (i.e., you load the OS onto the board once, and then students can write and rewrite programs on it).
 
The software also happens to know how to manipulate most of the internal peripherals on the MCU for things like analog/digital I/O, timers, etc. -- you can see details at www.cpustick.com and there is a 52233 version on the Downloads page, which just gets an IP address via DHPC and then the students can log in and program the MCU that way.  If you have a zigbee chip on your board, you can even control the MCU wirelessly. :smileyhappy:
 
If you want to discuss any of this offline, I'm at rich@testardi.com -- I'm specifically trying to bring this stuff to the class room (high schools, in particular), so I'm always interested in talking to folks about it!
 
-- Rich
 
 
 
0 Kudos
Reply

1,547 Views
wolfgarb
Contributor I
With PIC18f452 i downloaded a bootloader into the MCU with ICD2. So a could download firmwares into the mcu without ICD2, only by serial RS232. Is it possible to do the same with M52233?
0 Kudos
Reply

1,547 Views
RichTestardi
Senior Contributor II
> With PIC18f452 i downloaded a bootloader into the MCU ...
 
Yes, you can certainly do that, as well.
 
There are lots of ways to write bootloaders, and since your (students') PCs probably have RS-232, that makes a lot of sense (as does Ethernet).
 
One thing I should mention is the bootloader I wrote (intentionally) replaces itself on every boot...  So if you load broken code (or, for example, code that does not have the bootloader linked in), you can thwart it.  To make a more stable bootloader, you'd want to never overwrite it and use an indirect Interrupt Vector table, like I do for the Badge Board with the 51JM128.
 
(Now if you load StickOS and the students interface to that to write their programs, there is no way I know to thwart that, on the other hand.  You can even watch what they are doing wirelessly, if you have the zigbee transceiver! :smileyhappy:
 
-- Rich
 
0 Kudos
Reply

1,547 Views
RichTestardi
Senior Contributor II
PS and if you want to see examples of "classroom embedded systems" I was envisioning (which might target a younger audience than you are), check out:
 
 
I hope to start working on a full curriculum next, following a PIC32 port.
 
The second link shows how trivial it is to make wireless embedded systems, with StickOS, as well...  There are schematic PDFs and gerber files (for the PCB trace antenna), as well, if you want to see how the zigbee chip is connected.
 
-- Rich
 
0 Kudos
Reply

1,547 Views
wolfgarb
Contributor I
Hey!
Very nice these examples!!! i'm analyzing them!
very good!
0 Kudos
Reply

1,547 Views
wolfgarb
Contributor I
Hey,
i sent you an e-mail.
Me too! I get really excited about this! :smileyhappy:
 
0 Kudos
Reply

1,547 Views
RichTestardi
Senior Contributor II
Hi,
 
I'm not sure if you ever got my e-mail, so I thought I'd reply here to be safe.
 
I had a couple of extra hours today (11 Dec, 2008), so I created a minimal project for you that has two targets...  The main target, "52233" is for you to build your bootloader (a pre-built one is in the bin directory) and then you program this to the student boards (or your DEMO board), at flash address 0x00000.  When you reset the board and run it, it will talk to the serial port (uart 0) at 115200 baud, 8 data bits, and no parity -- you must have hardware flow control enabled on the PC terminal emulator to slow down the input from the PC to flash programming speeds The bootloader will print this message to the serial port:
 
  paste S19 upgrade file now...
 
The student can then build the other target ("student" -- a pre-built one is also in the bin directory), which loads at flash address 0x20000 using the student_main.c file.  They build their s19 file (student.elf.S19) and then paste it into the terminal emulator window where the above message was printed.
 
The bootloader will copy their program to 0x20000 and beyond, and then immediately start running it.
 
They can reset the board to try again.
 
Here is a display showing how I downloaded and ran the sample student.elf.S19, which just (re-)configures the serial port and prints "hello world!\n" to it: hyper.jpg
 
The full archive is attached.  If you have any problems with it, let me know and I'm happy to help.  (And if it doesn't do what you want, that's fine, too -- I just had a couple of extra hours today and thought I'd take a crack at it.)
 
Good luck!
 
One other thing...  If you install the UCTS0* jumper on the demo board, or if you have that line hooked up on your boards, you probably should remove the line in main.c that turns it on as a digital output -- I forgot to remove that one...  I.e., just delete:
 
pin_declare(PIN_CTS0, pin_type_digital_output, 0);
 
As it will fight with your input buffer.  Oops!
 
-- Rich
 
PS I removed the freescale headers from pedro.trim.zip since I never like to repost someone else's files...  You just need to add MCF52233*.h to your headers directory and the project should build fine.
 
Message Edited by t.dowe on 2009-09-02 05:26 PM
0 Kudos
Reply

1,547 Views
MCF52233
Contributor III

 

Hi Rich, 

 i read ur solution and found very helpful ,also try it but never success or i can say i'm confuse.

 I compile and flash the program (MCF52233 ), which shows... paste S19 upgrade file now...

on hyperterm. How can i put student.s19 ? i'll try it using hyperterm send file but with no success..

 can u put more light on this??

 

 

 

0 Kudos
Reply

1,547 Views
RichTestardi
Senior Contributor II

Once it says to paste the S19 file, you're in the home stretch!

 

Just open the (student) S19 file in notepad, select Edit->Select All, and then Edit->Copy.

 

Then go back to HyperTerminal and select Edit->Paste To Host.

 

The student S19 should load, reset, and then run.

 

-- Rich

 

0 Kudos
Reply

1,547 Views
MCF52233
Contributor III

Thanks Rich ,

  I really dont click this , but still i hv no success. i hv mcf52233DEMO board , is there are any jumper setting or  something 

that i cant feagure it out? When i paste image onto it , gives message like record not found.

It is also really helpful to everyone if u point out link which described S19 image description i.e how to decode it?

0 Kudos
Reply

1,547 Views
RichTestardi
Senior Contributor II

If when you paste the S19 into the terminal emulator, you get an error indicating a bad record format, you're almost there...

 

You can see the record format that is expected in the sources/flash.c file, in the routine flash_download().

 

Your S19 file should look like the one in bin/student.elf.S19 (in your zip file), starting and ending with similar lines.

 

Again, you want to open the S19 in notepad, Ctrl-A, Ctrl-C, and then paste the result into the hyperterminal window.  You might have to step thru with the debugger if you're getting a format error and see exactly why...  It will also help if you post the exact error message (you can also find it in flash.c and figure out what is up from there).

 

Have you tried pasting the student.elf.S19 file directly from the zip?

 

-- Rich

 

student.elf.S19

 

Message Edited by t.dowe on 2009-09-02 05:22 PM
0 Kudos
Reply

1,547 Views
MCF52233
Contributor III

sorry rich ,

sorry for so late reply ,thanks for ur patience.

and now i got it.

thanks once again. 

0 Kudos
Reply

1,547 Views
RichTestardi
Senior Contributor II
PPS and if you did want to put StickOS on your boards, it is as easy as loading it onto your DEMO board, connecting the 7 wires above to your slave boards, and then running the (RAM based) Flasher project found in skeleton.zip to clone the DEMO board flash to the target board -- that's how I program my target boards.  Once you've done that once, students can use the target boards with just an Ethernet (or zigbee! :smileyhappy: connection to them.  (Sorry, I get really excited about this! :smileyhappy:
 
 
0 Kudos
Reply