After FLASH_Init which return status 0 and some FLASH_GetProperty which also returns correct values I try execute below which return status 103 :
regPrimask = DisableGlobalIRQ();
statusF = FLASH_Erase(&configF, 0x42000, 4096, key);
EnableGlobalIRQ(regPrimask);
a FLASH registers is as follow : registers.png
after callFtfxRunCommand((FTFx_REG8_ACCESS_TYPE)(&FTFx->FSTAT)); the FTFE-FSTAT became 0xa0 (10100000) which correspond to status 103
Command execution looks like from right place (RAM) :
ame : config->runCmdFuncAddr.commadAddr
Details:536872649
Default:536872649
Decimal:536872649
Hex:0x200006c9
Binary:100000000000000000011011001001
Octal:04000003311
Change in erase address to 40000 or 41000 gives same result
What is wrong?
I found this post :
all looks exactly as on Mike screenshots except ram address value (because I have different device) and that all it doesn't work
Hello Molbuy
This error indicates that the instruction code is invalid or the address is out of bound.
Which value are you writing in the variable "key"?
Do you have this same problem with the parameters of the SDK example?
I will be waiting for your reply, if you have more questions do not hesitate to ask me.
Best regards,
Omar
Hello Omar.
The key is :
uint32_t key = FOUR_CHAR_CODE('k', 'f', 'e', 'k');
and it taken from fsl_ftfx_controller.h, moreover, if execution of code reached the "callFtfxRunCommand" then key passed before successfully.
Also, as you can see the address of "callFtfxRunCommand" is 0x200006c9 which in range of upper sram region for that device.
Where can I see appropriate sdk example?
Hello
Thank you for your reply, the key is correct and the command is in SRAM.
I suggest you test your device with the SDK example to check if this problem still persists. You can import the example in the MCUXpresso in the option "Import SDK examples(s)"
Please let me know the results, if you have more questions do not hesitate to ask me.
Best regards,
Omar