Part Number: TMS570LS1227
I've been reconfiguring our MPU settings to test our stack overflow mechanism and have found that reconfiguring a number of MPU regions (even if they are "reconfigured" with exactly the same settings as per their current configuration) extends the erase time of the first sector we try to erase by up to 100%.
While this isn't a show stopper (at the moment at least), we need to understand what is causing this increase in sector erase times in case we inadvertently change something in future that has a similar effect.
Our MPU is initially configured in the bootloader and this all works okay, with no effect on flash sector erase times.
To test the stack overflow protection I was reconfiguring a number of the stack related MPU regions (4 to be precise - regions 4, 5, 6 and 7). I was doing this in our application code to force a permission fault, but was finding that any subsequent attempts to reprogram the Application over our CAN connection were failing - this turned out to be due to a (possibly unnecessarily restrictive) timeout on our flash wait function which waits on the FMSTAT register BUSY flag. It should be noted that the processor gets reset (using the ESM nError pin) between reconfiguring the MPU and erasing the Application flash, either via our Abort handler or through our normal programming mechanism.
If I only reconfigured (any) 3 of the 4 aforementioned regions our flash wait timeout didn't trip and the flash sector erase time was only slightly increased - about 10% or so.
If I simply reprogram these regions (or, as it turns out regions 8 and 9, which are our abort and undef stack traps) with the values they already contain, I see exactly the same behaviour.
Our base MPU settings are as follows:
| Region | Base Address | Size and enable | Access control | Description |
| 0 | 0x00000000 | 0x0000002B | 0x00000308 | Program Flash |
| 1 | 0xF0000000 | 0x0000002D | 0x00001308 | Bank 7 EEPROM |
| 2 | 0x80000000 | 0x0000002D | 0x00000308 | RAM |
| 3 | 0xFC000000 | 0x00000033 | 0x00001301 | Peripheral registers |
| 4 | 0x08000020 | 0x00000009 | 0x00001008 | User stack guard |
| 5 | 0x08000820 | 0x00000009 | 0x00001008 | SVC stack guard |
| 6 | 0x08001020 | 0x00000009 | 0x00001008 | FIQ stack guard |
| 7 | 0x08001820 | 0x00000009 | 0x00001008 | IRQ stack guard |
| 8 | 0x08002820 | 0x00000009 | 0x00001008 | Abort stack guard |
| 9 | 0x08002C20 | 0x00000009 | 0x00001008 | Undef stack guard |
| 10 | Not used | N/A | N/A | N/A |
| 11 | 0xFFF80000 | 0x00000025 | 0x00001100 | System Modules |
Any help would be much appreciated.
Best regards,
Steve