Failed to erase flash on the second time in KE02Z32

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

Failed to erase flash on the second time in KE02Z32

580 Views
jimmyli
Contributor IV

Hi,

     We designed a bootloader for KE02 to update application, but that has a problem we can't fix it, hope you can help us.

     1>MCU: MKE02Z32VLC4

     2>SDK: SDK_2_13_0_MKE02Z32xxx4\boards\frdmke02z40m\driver_examples\flash\pflash

              need to modify: a. CPU clock is 32MHz provided by internal crystal.

                                       b. modify the scf file to match the real requirement.

                                       c. modify the beggining of erase address to 0x800.

              notes: a.attachment is the test source and .scf file.    

                         b.flash will not to be protected (default setting).             

     3>Test: a> download and debug the code, it will stop at :

             result = FLASH_Erase(&s_flashDriver, destAdrss, pflashSectorSize, kFLASH_ApiEraseKey);

         b>Trace the code, we find it will return a wrong at :

             returnCode = flash_command_sequence(config);    --in the FLASH_Erase api.

         c>then, we can't erase seccefully and program the internal flash.

         d>modify FPROT register to 0x24 and return, seccessful.

             modify FPROT register to 0xbf or other value, it will return 0x00, we don't know why.

      Hope that you can help us to analyse it.

      Thanks very much.

Labels (1)
Tags (1)
0 Kudos
2 Replies