diff options
| author | Scott Shawcroft <scott@tannewt.org> | 2020-01-17 18:35:09 -0800 |
|---|---|---|
| committer | Scott Shawcroft <scott@tannewt.org> | 2020-01-17 18:35:09 -0800 |
| commit | 9f4ea2122a346040d3a82b90e8eaaf63f44b23ce (patch) | |
| tree | 88afc0cf0aa99a0863b690c0798a4f8bf3f97bc1 | |
| parent | 7d8dac9211dab92d750a0351335b4ad3fffc05e2 (diff) | |
teensy fixes
| -rw-r--r-- | ports/mimxrt10xx/boards/teensy40/flash_config.c | 2 | ||||
| -rw-r--r-- | ports/mimxrt10xx/supervisor/port.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/ports/mimxrt10xx/boards/teensy40/flash_config.c b/ports/mimxrt10xx/boards/teensy40/flash_config.c index a0661280b..c281d4541 100644 --- a/ports/mimxrt10xx/boards/teensy40/flash_config.c +++ b/ports/mimxrt10xx/boards/teensy40/flash_config.c @@ -68,7 +68,7 @@ const flexspi_nor_config_t qspiflash_config = { .deviceType = kFlexSpiDeviceType_SerialNOR, .sflashPadType = kSerialFlash_4Pads, .serialClkFreq = kFlexSpiSerialClk_60MHz, // 03 - .sflashA1Size = 0x00200000, + .sflashA1Size = FLASH_SIZE, .lookupTable = { // FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1) diff --git a/ports/mimxrt10xx/supervisor/port.c b/ports/mimxrt10xx/supervisor/port.c index 555b78359..e141bc6b8 100644 --- a/ports/mimxrt10xx/supervisor/port.c +++ b/ports/mimxrt10xx/supervisor/port.c @@ -162,10 +162,10 @@ void SystemInitHook(void) { // we can ignore 1/8th size chunks. So, we ignore the last 1MB using the subregion. uint32_t remainder = (1u << (region_size + 1)) - filesystem_size; uint32_t subregion_size = (1u << (region_size + 1)) / 8; - uint16_t subregion_mask = 0xff00 >> (remainder / subregion_size); + uint8_t subregion_mask = (0xff00 >> (remainder / subregion_size)) & 0xff; MPU->RBAR = ARM_MPU_RBAR(11, 0x60100000U); - MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, (uint8_t) subregion_mask, region_size); + MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, subregion_mask, region_size); // This the ITCM. Set it to read-only because we've loaded everything already and it's easy to // accidentally write the wrong value to 0x00000000 (aka NULL). |
