Skip to content

Commit 9f4ea21

Browse files
committed
teensy fixes
1 parent 7d8dac9 commit 9f4ea21

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

ports/mimxrt10xx/boards/teensy40/flash_config.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ const flexspi_nor_config_t qspiflash_config = {
6868
.deviceType = kFlexSpiDeviceType_SerialNOR,
6969
.sflashPadType = kSerialFlash_4Pads,
7070
.serialClkFreq = kFlexSpiSerialClk_60MHz, // 03
71-
.sflashA1Size = 0x00200000,
71+
.sflashA1Size = FLASH_SIZE,
7272
.lookupTable =
7373
{
7474
// FLEXSPI_LUT_SEQ(cmd0, pad0, op0, cmd1, pad1, op1)

ports/mimxrt10xx/supervisor/port.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,10 @@ void SystemInitHook(void) {
162162
// we can ignore 1/8th size chunks. So, we ignore the last 1MB using the subregion.
163163
uint32_t remainder = (1u << (region_size + 1)) - filesystem_size;
164164
uint32_t subregion_size = (1u << (region_size + 1)) / 8;
165-
uint16_t subregion_mask = 0xff00 >> (remainder / subregion_size);
165+
uint8_t subregion_mask = (0xff00 >> (remainder / subregion_size)) & 0xff;
166166

167167
MPU->RBAR = ARM_MPU_RBAR(11, 0x60100000U);
168-
MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, (uint8_t) subregion_mask, region_size);
168+
MPU->RASR = ARM_MPU_RASR(EXECUTION, ARM_MPU_AP_FULL, NORMAL, NOT_SHAREABLE, CACHEABLE, BUFFERABLE, subregion_mask, region_size);
169169

170170
// This the ITCM. Set it to read-only because we've loaded everything already and it's easy to
171171
// accidentally write the wrong value to 0x00000000 (aka NULL).

0 commit comments

Comments
 (0)