You should download dBug for M5223EVB here : http://www.freescale.com/webapp/sps/download/license.jsp?colCode=M5223EVB_DBUG&;prodCode=M52235EVB&nodeId=0162468rH3YTLC00M98090&location=psp and have look to this file which provide cfm_flash_program function : \dbug\src\dev\flash\cfm_flash.c It works fine for my house made M5213evb's bootloader.