I would like to read out the Program Flash 1 IFR to get the Swap Field data. I think I can do this using the ReadResource flash command, but the values I am getting back are not correct. I am using the following commands to read out 16 bytes starting at address 0. Any idea what I am doing wrong?
returnCode = FlashReadResource(&ftflCfg, (PFLASH_BLOCK_BASE + PFLASH_IFR_OFFSET + 0), dataReadback, FlashCommandSequence); | |
returnCode = FlashReadResource(&ftflCfg, (PFLASH_BLOCK_BASE + PFLASH_IFR_OFFSET + 8), dataReadback, FlashCommandSequence); | |
In this case I suggest you to review the information on the AN4533 Robust Over-the-Air Firmware Updates Using Program Flash Memory Swap on Kinetis Microcontroll..., you cal also find the application software for this App note.
Also could you please share your part number? this will be helpful in order to search for specific information.
Have a nice day,
Perla Moncada
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Yes, I have read AN4533, our code is based on the app note. However, the document does not show how to read the IFR or where exactly it is. I know that the flash command "Read Resource" must be used, but what address should be passed to it?
The specific processor is MK60FN1M0VLQ12 rev 3N96B.
Hi jmag99,
I have consulted our Expert Team, and they replied with the following table, please kindly refer to it for details.
so you may use the read resource command to access program flash 1 IFR.
Hope that helps,
Have a great day,
Kan
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Thanks, that address appears to be correct for the IFR1 location. However, there are several errors in the Reference Manual for my part (K60P144M150SF3RM):
Program Flash 1 IFR is located at 0x20000-0x203FF
In section 30.4.12.14.1 - the locations of the fields are incorrect. It should be
0-1 is enable word
2-3 is indicator address
On page 804, the address is not shifted by 1 bit, but rather by 4 bits. This results in the indicator address going from 0x7F000 to 0x7F00.
Hopefully this information makes it into the Reference Manual someday.
Hi All,
What I am referring to is K60P144M100SF2V2RM Rev. 2 Jun 2012, while K60P144M150SF3RM is Rev. 2, Dec 2011, and I was just told K60P144M150SF3RM and K70P256M150SF3RM will be updated next month, so I think the FTFE chapter will be updated with this release.
Have a great day!
B.R
Kan
Well now I am a bit confused, I am using the K60P144M150SF3RM reference manual and I would like to confirm with you if you are using the same reference manual and also the information depicted above, please see the next points:
Please confirm this information o let me know if I am using a different reference manual.
It appears you have the same manual as me.
The 30-44 table only shows the IFR 0, not the IFR 1 where the swap details are stored. Also, the flash driver needs to be modified to be able to Read Resource at address 0x20000.
The table on 30.4.12.14.1 shows the swap enable word at 0x006-0x007, but it's really at 0x000-0x001. It also shows the indicator address at 0x00D-0x00F, but it's really at 0x002-0x003.
On page 804, the address is not listed (this is generally set as the last page in a sector), however, the way the address is stored in the IFR is not stated properly. On that page, it states that the address is shifted right by 1 bit (exact text is (shifted with bit 0 removed), however, the actual data stored at that location is shifted by 4 bits.
I have been reviewing the AN4533 software because I tried to understand better the original question and data depicted on the reference manual in order to know what is exactly going on. In this case I would like to ask you some questions: