Code: Select all
cat bootloader.min p1.min p2.min p3.min > result.min
Code: Select all
copy bootloader.min/b + p1.min/b + p2.min/b + p3.min/b result.min
For those interested in mechanisms used to make it work here is the source code: Basically switching the pages is done by writing the page value to the address 0x1FFFFF.
All possible values for bank switching are:
Value 0 is 2MB addressing the full memory space.
Values 1 - 31 are for 64K segments where the value chooses the respective segment.
Values 0x80 - 0x83 are 512K segments, masking the low two bits chooses which of the segments will be used. So 0x80 is the one from offset 0, 0x81 is the one from offset 512K, etc.
The bank switching should be done typically in RAM since the effect of the switch will be immediately applied, and the next address fetched is from the new bank!
Another important detail is that in 64K mode the program can only access those 64K and nothing outside of it, same for the 512K mode only one quarter of the flash is accessible for reading!