AnsweredAssumed Answered

USB API - how use HCS08_FCMD_BURST_PROG for flash programming?

Question asked by Dmitriy Kirpika on Sep 21, 2015
Latest reply on Sep 22, 2015 by pgo

Hello!

 

If write to flash 1 byte, no problems (first PAGE_ERASE):

 

  • FF=HCS08_FSTAT_FPVIOL | HCS08_FSTAT_FACCERR;
  • Err_=USBDM_WriteMemory (1, 1, #HCS08_FSTAT, pointer FF);
  • If (Err_!=0) ... ;//code skipped
  • Err_=USBDM_WriteMemory (1, 1, 0x1A00, pointer buffer); // 1 byte data for write to flash
  • If (Err_!=0) ... ;//code skipped
  • cmd=HCS08_FCMD_BURST_PROG;
  • Err_=USBDM_WriteMemory (1, 1, #HCS08_FCMD, pointer cmd);// Execute burst prog

The code above works. But slowly - 512 bytes 24 sec.

 

If write more bytes, FACCERR return error.

 

  • FF=HCS08_FSTAT_FPVIOL | HCS08_FSTAT_FACCERR;
  • Err_=USBDM_WriteMemory (1, 1, #HCS08_FSTAT, pointer FF);
  • If (Err_!=0) ... ;//code skipped
  • Err_=USBDM_WriteMemory (1, 64, 0x1A00, pointer buffer); //  64 bytes data for write to flash
  • If (Err_!=0) ... ;//code skipped
  • FF=HCS08_FCMD_BURST_PROG;
  • Err_=USBDM_WriteMemory (1, 1, #HCS08_FCMD, pointer FF);// Execute burst prog

 

What's wrong? How use burst_prog?

Version DLL 4.10.6

Outcomes