Handheld OSBDM flashing

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

Handheld OSBDM flashing

434 Views
Toe
Contributor IV

I'm trying to put together a device that can erase and program from a file on a SD card.  It seems like this should be feasible with the OSBDM hardware, but I haven't found the right document or source code that shows the commands sent through the BDM.

I have a piece of hardware that a PC can recognize as an OSBDM with the source from PE micro so I can debug and capture data, but it would take a while to do it backwards like that.  I'm using this to erase and flash a V1 coldfire (JM128).

0 Kudos
2 Replies

237 Views
pgo
Senior Contributor V

Hi Ryan,

Thinking about programming at the level of "commands sent to the BDM" is way too low level.

The BDM provides a low-level interface that allows interaction with the CPU.  This is described in the Coldfire manual.

This interface is then used to download a program to the target.

This program is used to program the chip i.e. the chip programs itself one block of data at a time under control of an external program..

This is quite an involved process.

It would be possible to do what you suggest but you should be looking at the firmware in the BDM for approaches to the BDM communication and then at the actually programming utility for information on how to do the programming.  This higher level information is not available for OSBDM (it is P&E proprietary).

You can look at the USBDM firmware and programs if you wish but they are quite convoluted since they program a range of chip types.  There is a good quality one available that is mentioned in these forums.

Flash routines that are downloaded to the target to do the programming:

podonoghue/usbdm-flash-routines · GitHub

BDM firmware - The code that is in the BDM that communicates with the target using the BDM protocol.

podonoghue/usbdm-firmware · GitHub

Programming utilities

podonoghue/usbdm-eclipse-makefiles-build · GitHub

If you intend to re-program chips rather than programming blank chips you would be better off considering a bootloader that can be once-off programmed into the chip and then used to re-program the remainder of the chip at a later time.  This would usually be done over a serial interface.

bye

0 Kudos

237 Views
Toe
Contributor IV

I agree a bootloader would be a better approach, but for devices that already exist that do not have a bootloader the BDM is the only interface.  I was thinking that since I'm only trying to interface to one chip that a simplified programming interface could be cobbled together to just erase and write.

I'll take another look at the USBDM and the programming utilities links you sent, maybe I can find something useful there.  I have been looking through the manual as well and have not given up yet!

0 Kudos