"Flash erase sector" command fails on MC56F81748

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

"Flash erase sector" command fails on MC56F81748

Jump to solution
1,742 Views
JPE
Contributor III

Hi Supporters,

we have developed a bootloader for being able to perform a field update of our electronics.
The bootloader has originally been implemented for the NXP DSC MC56F83763 and is now migrated to the NXP DSC MC56F81748, which has the same core, but a slightly different memory structure.

We're using ProgDSC both for debugging and to program the bootloader in the DSC, but the bootloader behaves differently after a debug session and after programming the DSC with the flash programming application ProgDSC.
In the last case, the DSC seems to crash when trying to erase the first flash sector.
But when running the same code out of the debugger (NXP CodeWarrior 11.1), the bootloader successfully erases the flash, programs the application code and the application starts after programming.
This also works, when we only use the debugger to program the bootloader, end the debugging session, restart the DSC and start programming the application via the bootloader.

The flash is not secured and there are no protected regions defined for the flash in the code.
There are no differences in the memory contents of the DSC when reading them back after programming with ProgDSC or from the debugger, so I have absolutely no clue, where the difference in the behaviour comes from.
Since the code works out of the debugger, I'm not able to read out the errorflags after the flash operation, but are there any specific error messages / values I could try to look for?
Do you have any other suggestions for finding the root cause of this issue?

@xiangjun_rong @ZhangJennie @FelipeGarcia

0 Kudos
1 Solution
1,717 Views
JPE
Contributor III

Hello again,

the issue was caused by a missing section in the S-Record file I downloaded with ProgDSC.
When using the debugger, that section was programmed properly and therefore the code was working.
The effect of the missing section only became visible when trying to erase the flash.

View solution in original post

0 Kudos
3 Replies
1,718 Views
JPE
Contributor III

Hello again,

the issue was caused by a missing section in the S-Record file I downloaded with ProgDSC.
When using the debugger, that section was programmed properly and therefore the code was working.
The effect of the missing section only became visible when trying to erase the flash.

0 Kudos
1,728 Views
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

Pls refer to attached doc for the application code updating based bootloader code with blhost tools.

Regarding the Progdsc tools, I have an old version which does not support the newly released MC56F81xxx. I will have a try after I download the new version tools.

BR

XiangJun Rong

0 Kudos
1,721 Views
JPE
Contributor III

Hello Xiangjun Rong,

we are not using the built-in ROM bootloader of the MC56F81xxx, but have written our own BL using the "Flash Memory Module (FTFA)" of the DSC.

Our bootloader actually works fine and is able to program our application code, but only once after having programmed the BL from the CodeWarrior Debugger.
After having used the ProgDSC programmer to program the BL, the "Erase Flash Sector" command (FCMD 0x09) fails, returns an error message and the DSC seems to stop executing further code untill it is reset by the watchdog (we assume).
Erasing the flash sector also fails, if the bootloader is trying to program the application a second time.

It is as if the ProgDSC program (and the bootloader itself as well) are leaving the flash of the DSC in a protected state, which doesn't allow the "Erase Flash Sector" command to erase the flash.
After having programmed the bootloader with the CW debugger, the flash is not protected in the same way.

0 Kudos