AnsweredAssumed Answered

Programming with the USBDM API

Question asked by Roman Gassmann on Mar 13, 2012
Latest reply on Jul 18, 2017 by Chris Ward



After I found the USBDM_API, I tried to flash my MCF51JM128 with it.

With the working example of the memory dump from USBDM_Programming, I got along.


So first of all I read the SDID of my chip. The received a value of 0x2C16 (under considering big endian!). Also the CFV1_FlashProgrammer got this SDID.

Unfortunately in the XML-Device-Database this SDID is 0x0C16. Why is this different to the one in the Device?


After that I tried to erase my controller. Here I got some problems as in the API I only got an ICP_erase, I tried an erase with the following code:

    USBDM_RebootToICP();    ICP_ErrorCode_t ICP_ans= USBDM_ICP_Erase(0,0x01FFFF); //Memoryspace of the 51JM128 is 0x01FFFF;    switch(ICP_ans){        case ICP_RC_OK:                qDebug()<< "Erased";        break;        case ICP_RC_ILLEGAL:             qDebug()<< "erase failed! Illegal";        break;        case ICP_RC_FLASH_ERR:             qDebug()<< "erase failed! Flash";        break;        case ICP_RC_VERIFY_ERR:             qDebug()<< "erase failed! Verify";        break;    default:        qDebug()<< "A strange output "<< QString::number(ICP_ans);    }    USBDM_ICP_Reboot();

 if I execute this code, i got "A strange output 29". And further my USBDM_Flasher can not be connected again (Error: Failed, Reason=USB Transfer error).

So does anybody know how to erase, program and verify a controller via the API? Does anybody have some working Code?

Thanks in advance.