1,2,3)
flashx:code, flashx:swap0, flashx:swap1 are defined in init_flashx.c.
_bsp_flashx_file_blocks constant describes files from software point of view and there isn’t direct connection to physical flash banks.
So, bank0 is here defined as memory range from 0x0000_0000 to 0x0003_ffff and bank1 as memory range from 0x0004_0000 to 0x0007_ffff. It doesn’t reflect current situation in swapping - it is not connected to physical flash bank.
Swap0 is here defined as memory range from 0x0000_0000 to (0x0003_ffff minus one sector size).
Swap1 is here defined as memory range from 0x0004_0000 to (0x0007_ffff minus one sector size).
Last sector from every swap area is used for storing swap configuration. It is price which we pay when we want use swapping feature.
flashx:code is defined as memory range from 0x0000_0000 to end of your code (in default configuration it is calculated automatically by linker).
4)
No, clone_application() function in example code always copy from flashx:code to flashx:swap1.
It doesn’t not big sense copy different way because flashx:code typically represents area from which currently code runs.
5)
Last sector from every swap area is used for storing swap configuration. It is price which we pay when we want use swapping feature.
6)
fseek to IO_SEEK_END is standard IO function. File size is defined in init_flashx.c (you can modified it).
7)
It should be possible, however current flashX driver do not provide such feature.
If you really need it (bank parameters are the same), you can simply use messages in swapmark (part of example code) or implement your own solution.
8)
Unfortunately no, currently we do not provide any example code for calculation/store/verify CRC of binary file.
9)
No, this text is stored into last sector of flash swap are by flashX swap code (do_write_message(&swapmark);).
Note: MQX 4.1.2 will be released in near future but it will be designed just for Vybrid MCUs. Current version is MQX 4.1.1 and next version for K60 will be probably MQX4.2 (Q1/Q2 2015).
I hope it helps you.
Have a great day,
RadekS
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------