
Originally Posted by
defragster
I did a quick scan of the 'Memory Layout' - looks very good. @KurtE - would be good to add to OP if not already done.
Sorry @defragster - My mind is still on vacation
OP?

Originally Posted by
defragster
@KurtE - as I understand and from the startup memcopy it seems Any code not PROGMEM gets brought into the RAM1 area on startup.
Yes - the startup.c ResetHandler function does this:
Code:
void ResetHandler(void)
{
unsigned int i;
#if defined(__IMXRT1062__)
IOMUXC_GPR_GPR17 = (uint32_t)&_flexram_bank_config;
IOMUXC_GPR_GPR16 = 0x00000007;
IOMUXC_GPR_GPR14 = 0x00AA0000;
__asm__ volatile("mov sp, %0" : : "r" ((uint32_t)&_estack) : );
#endif
// pin 13 - if startup crashes, use this to turn on the LED early for troubleshooting
//IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_03 = 5;
//IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03 = IOMUXC_PAD_DSE(7);
//IOMUXC_GPR_GPR27 = 0xFFFFFFFF;
//GPIO7_GDIR |= (1<<3);
//GPIO7_DR_SET = (1<<3); // digitalWrite(13, HIGH);
// Initialize memory
memory_copy(&_stext, &_stextload, &_etext);
memory_copy(&_sdata, &_sdataload, &_edata);
memory_clear(&_sbss, &_ebss);
First it copies the Program code (ITCM), then it copies in the DTCM stuff that is initialized, and then it zeros the other variables.
EDIT: So the interesting question is, for things that are only run once (or a few times) what is timing difference between running it from Flash versus copy it from Flash to ITCM to then run it?
@DD4WH - You can mark functions to be FASTRUN. Example:
Code:
FASTRUN
void irq_gpio1(void)
{
irq_anyport(&GPIO1_DR, isr_table_gpio1);
}
However at least the last time I looked on T4 all of the code is currently FASTRUN, except for the hack I mentioned in a previous post where you could mark a function as PROGMEM which would leave it in FLASH. But as I mentioned there is/was an issue you could not have DMAMEM for both code and data...