@Paul - I just did a sync of the cores project and my simple test program no longer compiles for T4...
Code:
"C:\\arduino-1.8.13\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-gcc" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=154 -DARDUINO=10813 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4" "C:\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4\\bootdata.c" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_697394\\core\\bootdata.c.o"
"C:\\arduino-1.8.13\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-gcc" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=154 -DARDUINO=10813 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4" "C:\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4\\digital.c" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_697394\\core\\digital.c.o"
In file included from C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\analog.c:1:0:
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\analog.c: In function 'analog_init':
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1338:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CCGR1 (IMXRT_CCM.offset06C)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\analog.c:171:2: note: in expansion of macro 'CCM_CCGR1'
CCM_CCGR1 |= CCM_CCGR1_ADC1(CCM_CCGR_ON);
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1338:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CCGR1 (IMXRT_CCM.offset06C)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\analog.c:172:2: note: in expansion of macro 'CCM_CCGR1'
CCM_CCGR1 |= CCM_CCGR1_ADC2(CCM_CCGR_ON);
^
"C:\\arduino-1.8.13\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-gcc" -c -O2 -g -Wall -ffunction-sections -fdata-sections -nostdlib -MMD -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16 -D__IMXRT1062__ -DTEENSYDUINO=154 -DARDUINO=10813 -DARDUINO_TEENSY40 -DF_CPU=600000000 -DUSB_SERIAL -DLAYOUT_US_ENGLISH "-IC:\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4" "C:\\arduino-1.8.13\\hardware\\teensy\\avr\\cores\\teensy4\\interrupt.c" -o "C:\\Users\\kurte\\AppData\\Local\\Temp\\arduino_build_697394\\core\\interrupt.c.o"
In file included from C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:2:0:
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c: In function 'set_arm_clock':
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1321:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CBCDR (IMXRT_CCM.offset014)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:32:19: note: in expansion of macro 'CCM_CBCDR'
uint32_t cbcdr = CCM_CBCDR; // pg 1021
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1322:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CBCMR (IMXRT_CCM.offset018)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:33:19: note: in expansion of macro 'CCM_CBCMR'
uint32_t cbcmr = CCM_CBCMR; // pg 1023
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1343:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CCGR6 (IMXRT_CCM.offset080)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:51:2: note: in expansion of macro 'CCM_CCGR6'
CCM_CCGR6 |= CCM_CCGR6_DCDC(CCM_CCGR_ON);
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1321:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CBCDR (IMXRT_CCM.offset014)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:78:4: note: in expansion of macro 'CCM_CBCDR'
CCM_CBCDR = cbcdr;
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1322:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CBCMR (IMXRT_CCM.offset018)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:84:4: note: in expansion of macro 'CCM_CBCMR'
CCM_CBCMR = cbcmr;
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1331:23: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CDHIPR (IMXRT_CCM.offset048)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:85:11: note: in expansion of macro 'CCM_CDHIPR'
while (CCM_CDHIPR & CCM_CDHIPR_PERIPH2_CLK_SEL_BUSY) ; // wait
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1321:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CBCDR (IMXRT_CCM.offset014)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:89:3: note: in expansion of macro 'CCM_CBCDR'
CCM_CBCDR = cbcdr;
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1331:23: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CDHIPR (IMXRT_CCM.offset048)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:90:10: note: in expansion of macro 'CCM_CDHIPR'
while (CCM_CDHIPR & CCM_CDHIPR_PERIPH_CLK_SEL_BUSY) ; // wait
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1320:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CACRR (IMXRT_CCM.offset010)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:135:7: note: in expansion of macro 'CCM_CACRR'
if ((CCM_CACRR & CCM_CACRR_ARM_PODF_MASK) != (div_arm - 1)) {
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1320:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CACRR (IMXRT_CCM.offset010)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:136:3: note: in expansion of macro 'CCM_CACRR'
CCM_CACRR = CCM_CACRR_ARM_PODF(div_arm - 1);
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1331:23: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CDHIPR (IMXRT_CCM.offset048)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:137:10: note: in expansion of macro 'CCM_CDHIPR'
while (CCM_CDHIPR & CCM_CDHIPR_ARM_PODF_BUSY) ; // wait
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1321:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CBCDR (IMXRT_CCM.offset014)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:143:3: note: in expansion of macro 'CCM_CBCDR'
CCM_CBCDR = cbcdr;
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1331:23: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CDHIPR (IMXRT_CCM.offset048)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:144:10: note: in expansion of macro 'CCM_CDHIPR'
while (CCM_CDHIPR & CCM_CDHIPR_AHB_PODF_BUSY); // wait
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1321:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CBCDR (IMXRT_CCM.offset014)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:153:3: note: in expansion of macro 'CCM_CBCDR'
CCM_CBCDR = cbcdr;
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1321:22: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CBCDR (IMXRT_CCM.offset014)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:158:2: note: in expansion of macro 'CCM_CBCDR'
CCM_CBCDR &= ~CCM_CBCDR_PERIPH_CLK_SEL;
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1316:44: error: expected expression before ')' token
#define IMXRT_CCM (*(IMXRT_REGISTER32_t *))IMXRT_CCM_ADDRESS
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\imxrt.h:1331:23: note: in expansion of macro 'IMXRT_CCM'
#define CCM_CDHIPR (IMXRT_CCM.offset048)
^
C:\arduino-1.8.13\hardware\teensy\avr\cores\teensy4\clockspeed.c:159:9: note: in expansion of macro 'CCM_CDHIPR'
while (CCM_CDHIPR & CCM_CDHIPR_PERIPH_CLK_SEL_BUSY) ; // wait
^
Error compiling for board Teensy 4.0.
My guess is it has to do with your reorganizing the order of these defines?
Again nothing special in sketch other than to check the stuff you merged in for the LPGPR registers.
Code:
#ifndef SNVS_LPGPR0
#define SNVS_LPGPR0 (IMXRT_SNVS.offset100)
#define SNVS_LPGPR1 (IMXRT_SNVS.offset104)
#define SNVS_LPGPR2 (IMXRT_SNVS.offset108)
#define SNVS_LPGPR3 (IMXRT_SNVS.offset10C)
#endif
void setup() {
while (!Serial);
Serial.begin(115200);
Serial.println("At startup");
// SNVS_HPCOMR |= SNVS_LPCR_GPR_Z_DIS; //0x80000000l;
Serial.printf("%x %x %x %x\n", SNVS_LPGPR0, SNVS_LPGPR1, SNVS_LPGPR2,
SNVS_LPGPR3);
delay(100);
SNVS_LPCR |= (1 << 24);
SNVS_LPGPR0 += 1;
SNVS_LPGPR1 += 2;
SNVS_LPGPR2 += 3;
SNVS_LPGPR3 += 4;
Serial.println("After settting");
Serial.printf("%x %x %x %x\n", SNVS_LPGPR0, SNVS_LPGPR1, SNVS_LPGPR2,
SNVS_LPGPR3);
// SNVS_LPGPR = 100;
// Serial.printf("%x\n", SNVS_LPGPR);
}
void loop() {
}