Coldfire BDM with the prop
Ale
Posts: 2,363
Here is the code and the description of the circuit used. The Source contains some comments and points to be taken into account because the manual is a bit loose in details, sometimes.
MIT License applies
** Original Text **
I got this project I'm working on, a remake of some propeller powered board where I need a bit more memory and much more speed. Going back and forth I decided to use the Coldfire 5206e (got 3 of them some years back). Programming tools using BDM are quite expensive I mean plenty expensive. As the protocol is written down in the manual I decided to use it for a propeller powered dongle that can talk to the CF but with a small catch... it will not need a PC !, at least for simple things. The propeller can easily drive a monitor and keyboard and talk to the CF. Of course downloading something will require a PC... but in principle it should be doable. The cf board is not yet ready but think I can make this work.
btw... this CF stuff looks outdated but the parts are still in production. I wonder if they were ever successful....
Any thoughts ?
****
Release Notes 1.005 - 16.04.2011
All commands except GO and RESET are implemented. Downloading to the target is also not yet implemented but individual bytes/words/longs are implemented.
Read the source for comments on hw interface.
For the 5206e a good start is:
WC MBAR 1
WL 68 F000003E
WC RAMBAR 10001
Relocates the module to the address 0
Relocates CS0 to F000000 and disables all accesses to it
Relocates the internal SRAM to 10000
Note: if CS0 is not disabled by writing the CSMR0 all accesses to memory will not complete !
More initialization may be needed, I'm testing that right now.
Enjoy !
MIT License applies
** Original Text **
I got this project I'm working on, a remake of some propeller powered board where I need a bit more memory and much more speed. Going back and forth I decided to use the Coldfire 5206e (got 3 of them some years back). Programming tools using BDM are quite expensive I mean plenty expensive. As the protocol is written down in the manual I decided to use it for a propeller powered dongle that can talk to the CF but with a small catch... it will not need a PC !, at least for simple things. The propeller can easily drive a monitor and keyboard and talk to the CF. Of course downloading something will require a PC... but in principle it should be doable. The cf board is not yet ready but think I can make this work.
btw... this CF stuff looks outdated but the parts are still in production. I wonder if they were ever successful....
Any thoughts ?
****
Release Notes 1.005 - 16.04.2011
All commands except GO and RESET are implemented. Downloading to the target is also not yet implemented but individual bytes/words/longs are implemented.
Read the source for comments on hw interface.
For the 5206e a good start is:
WC MBAR 1
WL 68 F000003E
WC RAMBAR 10001
Relocates the module to the address 0
Relocates CS0 to F000000 and disables all accesses to it
Relocates the internal SRAM to 10000
Note: if CS0 is not disabled by writing the CSMR0 all accesses to memory will not complete !
More initialization may be needed, I'm testing that right now.
Enjoy !
Comments
Something more to add is that an external eeprom could be used to hold the program to debug/load to help in the process, a sd card can be used too.
If so it would be useful to be able to program up slave processors from the prop, by wrapping their code into an Obex object.
It may also be a cost effective way to add peripherals of the CF that might be useful to the prop.
Edit: read below!
The HC12 uses also a 1-wire protocol like the HC 08.
As I sent the Coldfire board to manufacture the need for the BDM Dongle increased considerably , as in "I need it sort of now" . I designed this circuit using proper level translators. These voltage translators are in my initial design not needed because the Coldfire operates at 3.3 V too but for isolation, lower load and coolness factor... they are there. From a software stand-point they are simply not seen and thus the software needs no re-write .
Any comments are appreciated.
BTW, if anyone is interested there are 2 boards I do not need/do not have parts for (except SRAM and Flash)
Specifications:
MCF5206e Coldfire
4MB SRAM (2 cycle access)
512k Flash
Video, SDCard, 12 bit 1 to 3 Msps ADC controlled via a XC2S100 FPGA with 512kx8 Video and 128kx8 ADC buffer.
Expansion connector
BDM Port (:D)
Connector for Rayman's breakout board for the 4.3" TFT
Connector for PS/2 Keyboard and VGA Monitor
All regulators (5, 3.3, 2.5V are on-board).
Edit: Of course such a dongle can be done with every other processor but a standalone dongle is mostly a propeller's specialty, well I'm sure an ATMega with a 25 MHz clock can do it also but it will not be either so cool or have 80-columns video
Fotos show the propBDM and the coldfire board. Boards were manufactured in Malaysia, I got 5 pcs for 91 $ (70 € or so), shipped Fed€x to may place. (Thanks octal!)
Note: The board has a yellow LED. LEDs are important... no board that wants to work can miss a LED ;-)
Do you have some board/test equipment at your disposal ? we could develop something in parallel... PM me if you want
Do you have photos of the boards ? :-)
The commands are 17 bits and the answers too. the first bit is ignored but it is recommended to set it to zero.
The BKPT signal seems to have to be asserted all the time during the DEBUG incursion, otherwise the commands return the status "not ready".
I'm adding now a dump registers command (it will be the first command ) as I took me a while to see all what was going on.
Btw. I'm using the propeller to generate the processor CLK signal, for the time being it is 5 MHz.
When the processor starts D0 is loaded with 0x08100000 and D1 with 0xEFFFAC03... now where I read what those values mean... CFPRM... I think.
This is the response from a write to D2 DEADBEEF and to D3 BABEFACE and then read D2 (the NOP thing was before..):
Just a question... do you have in mind Real-Time tracing ? because unless done a low speed (few MHz) the propeller cannot cope with it (I did not implement any of that so far).
Which functionality do you need ?
I was planning the following:
- Control register read/write
- Register read/write
- Memory read/write (byte/word/long and dump and bulk transfer to CF's memory, to program the Flash on the target. I'm using a 29F040 on it)
After programming some debugger into Flash I shouldn't need the BDM anymore but just in case the following can be added:
- Debug support: breakpoint set/reset and so on
As soon as I have something sort of usable (more than dump registers) I'll post the code. For the time being the circuit is just a propeller with some series resistors, a crystal and a propplug.
That which you already plan is all I need and then some. Mostly for programming, maybe to dump something if there is an issue. For me there is no need for the breakpoints, and if i need to reset I can always pull the reset line.
Edit: I'm really sorry to read that the board has a short. I hope you can fix it, I'm really looking forward to another CF board around ! (maybe we are the only two that still work with CFs ;-) )
I stripped the board already and the board definitely has a short, so do the two that have not yet had anything put on them. Perhaps a design error.
And get some new boards made.
On the system as a whole; Currently working on getting the video where I want it, Sound is working better than could ever be expected, ATA is working well (though I could use an ATAPI driver for the prop [ATAPI is still somewhat of a mystery to me]), KB & Mouse working, Joysticks working, Amiga OS tries to boot (not quit there yet), AROS tries to boot.
On the CF side I will be getting back with you as soon as I have the chips, and the new board is tested.
Edit: There are some undocumented behaviours that I found out testing the code. What has to be done with the BKPT line is the most prominent. I just wonder what happens when the GO command is executed... I'll find out soon , hopefully.