Hello,
I am working with the flashloader for MKV58F1M0xxx24 and I ran into an error.
What I am trying to do is an update using the KinetisFlashTool with the factory perprogrammed flashloader as well as the flashloader I build from the SDK (v2.8.0) in order to test the update mechanism.
I observed the behaviour of the flashing process with a debugger and found out, that the flashing process always fails, when my update binary is in the following range:
(FlashSize - 0x400byte) < BinarySize < FlashSize
In case the question arises, why I try to update such big binaries that fill the entire flash space:
This is because I fill the whole flash memory that is not needed by my application with a chosen pattern for furher usage.
The update process fails in memory.c while the function find_map_entry is executed. The error takes place, when the address+length of my update does not fit the address range of the flash (line 344). This is only because of some mysterious 0x400 byte offset in the size of my binary. So when I am trying to flash my binary of exactly 1MB, the FlashTool seems to append some (to me unknown) 0x400 byte, causing the range check to fail.
When I don't consider this 0x400 byte increment in the size of my binary, I am not able to perform the flashing process without getting the error:
kStatusMemoryRangeInvalid (10200): Memory range conflicts with a protected region.
So my workaround for the error is as simple as this: I force my application to not exceed a binary size of 1023kB by reducing the accessable flash memory section in my linker file by 0x400 byte. I don't like this workaround, as I lose 1kB of flash space for my application.
I would be pleased if I could get some information about this issue, as I don't see any kind of update-size restriction in any manual about the flashloader.
My assumption is, that it is not possible to use the KinetisFlashTool and the flashloader to updates a binary in the stated range, but I would be happy to be proven wrong
Kind regards,
Julian