I ran into the same problem with the LSM303DLHC in continuous mode using the auto-incrementing mag data registers. I didn't manage to resolve the issue with the data lock never clearing but did get around the problem with the following algorithm:
1. Power on chip and wait ~400us
2. Open/Enable/Start I2C
Loop
3. Write to the MR_REG_M register with value 0x01 to place into single shot mode
4. Read SR_REG_M register until DATA_RDY flag is set
5. Read 6 mag data registers
6. Write to the MR_REG_M register with value 0x3 to place into sleep mode
EndLoop
7. Close I2C
8. Power down chip
Stopping and starting I2C during the loop caused me problems but the single shot-sleep-single shot method seems to be fairly robust.
Hope that helps.
Question 1:
I can't definitely answer your first question. But in the programming manual where the VTOR register is described (page 212) it states that bit 29 is used to determine where the vector table is located, either in the code region (0) or in the SRAM region (1).
Now I don't understand why this has to be done for the same reason you state, the SRAM gets aliased to 0x0, so why is there a need to set this offset?
The only guess I have is stated on your cited page 69. They say:
the code area starts from address 0x0000 0000 (accessed
through the ICode/DCode buses)
the data area (SRAM) starts from address
0x2000 0000 (accessed through the system bus)
The Cortex ® -M4 with FPU CPU always
fetches the reset vector on the ICode bus
Maybe on an interrupt the ICode bus is used, which cannot access the SRAM even when remapped (I don't know if this is true). This would explain why this bit has to be set accordingly, telling the core to use the system bus and access the SRAM.
Question 2:
While it might be true, that the SRAM is empty on the first boot of the device, it isn't necessarily for later boots. So you could create something like a battery powered device which gets its SRAM programmed during production and then runs until the battery is dead, which would clear its SRAM. I guess this would make reverse engineering the device a bit harder.
In a battery powered device you would probably use the standby mode to conserve power, and if you leave that mode, the Boot-pins are sampled again, so they must have the correct setting to get to the SRAM again.
You can also reboot the device safely as the content of the SRAM doesn't get destroyed if there is no power outtake.
Not a very convincing application to rectify all the trouble to remap the SRAM.
Best Answer
Here are a few thoughts on what you can try or improve: