teensy fixes

This commit is contained in:
Scott Shawcroft 2020-01-17 18:35:09 -08:00
parent 7d8dac9211
commit 9f4ea2122a
No known key found for this signature in database
GPG Key ID: 9349BC7E64B1921E
2 changed files with 3 additions and 3 deletions

View File

@ -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)

View File

@ -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).