Call to arms | Teensy + SDRAM = true

@defragster
Just tried your sketch and getting alot of warning and errors: Also did you run: Run "addr2line -e mysketch.ino.elf 0xD22" for filename & line number
Code:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino: In function 'void setup()':
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:16:19: warning: invalid conversion from 'uint32_t*' {aka 'long unsigned int*'} to 'uint32_t' {aka 'long unsigned int'} [-fpermissive]
   16 |     ram2DMA[ii] = (uint32_t *)malloc( CHUNKS );
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   uint32_t* {aka long unsigned int*}
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:22:19: warning: invalid conversion from 'uint32_t*' {aka 'long unsigned int*'} to 'uint32_t' {aka 'long unsigned int'} [-fpermissive]
   22 |     ram2DMA[ii] = (uint32_t *)sdram_malloc( CHUNKS );
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   |
      |                   uint32_t* {aka long unsigned int*}
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:23:24: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   23 |   for ( int ii = 0; ii < CHUNKS / sizeof(uint32_t); ii++ )
      |                     ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:27:26: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   27 |     for ( int ii = 0; ii < CHUNKS / sizeof(uint32_t); ii++ )
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:28:18: error: invalid types 'uint32_t {aka long unsigned int}[int]' for array subscript
   28 |       ram2DMA[jj][ii] = ram1DTCM[ii];
      |                  ^
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:32:26: warning: comparison of integer expressions of different signedness: 'int' and 'unsigned int' [-Wsign-compare]
   32 |     for ( int ii = 0; ii < CHUNKS / sizeof(uint32_t); ii++ )
      |                       ~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:33:18: error: invalid types 'uint32_t {aka long unsigned int}[int]' for array subscript
   33 |       ram2DMA[jj][ii] = ram1DTCM[ii];
      |                  ^
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:38:33: warning: invalid conversion from 'uint32_t' {aka 'long unsigned int'} to 'const void*' [-fpermissive]
   38 |     if ( 0 == memcmp( ram2DMA[jj], ram1DTCM, CHUNKS ) ) kk++;
      |                       ~~~~~~~~~~^
      |                                 |
      |                                 uint32_t {aka long unsigned int}
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:35,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
c:\users\merli\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\string.h:30:18: note:   initializing argument 1 of 'int memcmp(const void*, const void*, size_t)'
   30 | int      memcmp (const void *, const void *, size_t);
      |                  ^~~~~~~~~~~~
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:40:31: error: no matching function for call to 'print(const char [24], uint&)'
   40 |   if ( kk == jj ) Serial.print( "%u RAM2/DMAMEM compares", kk );
      |                   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:89:16: note: candidate: 'size_t Print::print(unsigned char, int)' (near match)
   89 |         size_t print(unsigned char n, int base)         { return printNumber(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:89:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:40:33: warning: invalid conversion from 'const char*' to 'unsigned char' [-fpermissive]
   40 |   if ( kk == jj ) Serial.print( "%u RAM2/DMAMEM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:91:16: note: candidate: 'size_t Print::print(int, int)' (near match)
   91 |         size_t print(int n, int base)                   { return (base == 10) ? print(n) : printNumber(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:91:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:40:33: warning: invalid conversion from 'const char*' to 'int' [-fpermissive]
   40 |   if ( kk == jj ) Serial.print( "%u RAM2/DMAMEM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:93:16: note: candidate: 'size_t Print::print(unsigned int, int)' (near match)
   93 |         size_t print(unsigned int n, int base)          { return printNumber(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:93:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:40:33: warning: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
   40 |   if ( kk == jj ) Serial.print( "%u RAM2/DMAMEM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:95:16: note: candidate: 'size_t Print::print(long int, int)' (near match)
   95 |         size_t print(long n, int base)                  { return (base == 10) ? print(n) : printNumber(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:95:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:40:33: warning: invalid conversion from 'const char*' to 'long int' [-fpermissive]
   40 |   if ( kk == jj ) Serial.print( "%u RAM2/DMAMEM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:97:16: note: candidate: 'size_t Print::print(long unsigned int, int)' (near match)
   97 |         size_t print(unsigned long n, int base)         { return printNumber(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:97:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:40:33: warning: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive]
   40 |   if ( kk == jj ) Serial.print( "%u RAM2/DMAMEM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:99:16: note: candidate: 'size_t Print::print(int64_t, int)' (near match)
   99 |         size_t print(int64_t n, int base)               { return (base == 10) ? print(n) : printNumber64(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:99:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:40:33: warning: invalid conversion from 'const char*' to 'int64_t' {aka 'long long int'} [-fpermissive]
   40 |   if ( kk == jj ) Serial.print( "%u RAM2/DMAMEM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:101:16: note: candidate: 'size_t Print::print(uint64_t, int)' (near match)
  101 |         size_t print(uint64_t n, int base)              { return printNumber64(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:101:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:40:33: warning: invalid conversion from 'const char*' to 'uint64_t' {aka 'long long unsigned int'} [-fpermissive]
   40 |   if ( kk == jj ) Serial.print( "%u RAM2/DMAMEM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:44:34: warning: invalid conversion from 'uint32_t' {aka 'long unsigned int'} to 'const void*' [-fpermissive]
   44 |     if ( 0 == memcmp( sdramPtr[jj], ram1DTCM, CHUNKS ) ) kk++;
      |                       ~~~~~~~~~~~^
      |                                  |
      |                                  uint32_t {aka long unsigned int}
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:35,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
c:\users\merli\appdata\local\arduino15\packages\teensy\tools\teensy-compile\11.3.1\arm\arm-none-eabi\include\string.h:30:18: note:   initializing argument 1 of 'int memcmp(const void*, const void*, size_t)'
   30 | int      memcmp (const void *, const void *, size_t);
      |                  ^~~~~~~~~~~~
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:46:31: error: no matching function for call to 'print(const char [18], uint&)'
   46 |   if ( kk == jj ) Serial.print( "%u SDRAM compares", kk );
      |                   ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:89:16: note: candidate: 'size_t Print::print(unsigned char, int)' (near match)
   89 |         size_t print(unsigned char n, int base)         { return printNumber(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:89:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:46:33: warning: invalid conversion from 'const char*' to 'unsigned char' [-fpermissive]
   46 |   if ( kk == jj ) Serial.print( "%u SDRAM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:91:16: note: candidate: 'size_t Print::print(int, int)' (near match)
   91 |         size_t print(int n, int base)                   { return (base == 10) ? print(n) : printNumber(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:91:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:46:33: warning: invalid conversion from 'const char*' to 'int' [-fpermissive]
   46 |   if ( kk == jj ) Serial.print( "%u SDRAM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:93:16: note: candidate: 'size_t Print::print(unsigned int, int)' (near match)
   93 |         size_t print(unsigned int n, int base)          { return printNumber(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:93:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:46:33: warning: invalid conversion from 'const char*' to 'unsigned int' [-fpermissive]
   46 |   if ( kk == jj ) Serial.print( "%u SDRAM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:95:16: note: candidate: 'size_t Print::print(long int, int)' (near match)
   95 |         size_t print(long n, int base)                  { return (base == 10) ? print(n) : printNumber(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:95:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:46:33: warning: invalid conversion from 'const char*' to 'long int' [-fpermissive]
   46 |   if ( kk == jj ) Serial.print( "%u SDRAM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:97:16: note: candidate: 'size_t Print::print(long unsigned int, int)' (near match)
   97 |         size_t print(unsigned long n, int base)         { return printNumber(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:97:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:46:33: warning: invalid conversion from 'const char*' to 'long unsigned int' [-fpermissive]
   46 |   if ( kk == jj ) Serial.print( "%u SDRAM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:99:16: note: candidate: 'size_t Print::print(int64_t, int)' (near match)
   99 |         size_t print(int64_t n, int base)               { return (base == 10) ? print(n) : printNumber64(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:99:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:46:33: warning: invalid conversion from 'const char*' to 'int64_t' {aka 'long long int'} [-fpermissive]
   46 |   if ( kk == jj ) Serial.print( "%u SDRAM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
In file included from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Stream.h:24,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/HardwareSerial.h:115,
                 from C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/WProgram.h:47,
                 from C:\Users\Merli\AppData\Local\Temp\arduino\sketches\67BAE326F603BBF1AB54E415EF21BB6A\pch\Arduino.h:6:
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:101:16: note: candidate: 'size_t Print::print(uint64_t, int)' (near match)
  101 |         size_t print(uint64_t n, int base)              { return printNumber64(n, base, 0); }
      |                ^~~~~
C:\Users\Merli\AppData\Local\Arduino15\packages\teensy\hardware\avr\0.59.4\cores\teensy4/Print.h:101:16: note:   conversion of argument 1 would be ill-formed:
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:46:33: warning: invalid conversion from 'const char*' to 'uint64_t' {aka 'long long unsigned int'} [-fpermissive]
   46 |   if ( kk == jj ) Serial.print( "%u SDRAM compares", kk );
      |                                 ^~~~~~~~~~~~~~~~~~~
      |                                 |
      |                                 const char*
C:\Users\Merli\AppData\Local\Temp\.arduinoIDE-unsaved202408-27800-yr2o9o.hgao\sketch_jan8a\sketch_jan8a.ino:10:8: warning: unused variable 'ii' [-Wunused-variable]
   10 |   uint ii, jj, kk;
      |        ^~

exit status 1

Compilation error: invalid types 'uint32_t {aka long unsigned int}[int]' for array subscript
 
Last edited:
Think the issue might be how you are handling arrays:
 
I consider changing pin mapping to be a separate matter concerning all custom boards, only coincidentally related to SDRAM. Of the many things I might do, this one is a pretty low priority which for all practical purposes means I'm unlikely do to anything with it soon.
Yes, there are times, when I wish we could do this, not just for custom boards, but in a way to minimize and maybe remove all of the places in the cores\teensy4 that have things like #ifdef ARDUINO_TEENSY40 or ....

And maybe put all such things, like pin numbering, and the like in files under variant directory...

But I am guessing that this would be a pretty big ordeal to accomplish at this point.
 
not sure what else needs to be done now?

Just a few things I'd recommend at this point, all of them non-code stuff...

1: Some of the examples still lack a comment at the top which explains what that example really does. Imagine someone new to the library and maybe even still struggling to design or test their custom PCB opens one of those examples as their first experience with the library. I'm pretty familiar with this library and the purpose of those examples isn't clear to me, especially how the ones that seem to do memory tests differ and why I would use one versus another.

2: The readme and code comments ought to explain only 32MB has been tested, maybe even mention the specific part number (hopefully @Dogbone06 can give specific words to use). Anyone unfamiliar with the code might believe begin(size) implies other size chips ought to work. But other SDRAM chips almost certainly will not work. Even other 32MB chips might not work. At the very least support for different chips would require different settings in the SEMC_BR0 and SEMC_SDRAMCR0 registers at line 283. I'm not saying you should try to support other chips. My only feedback is to be careful about possibly giving future would-be PCB designers a false impression they could choose a different chip and expect the library to support it.

3: I see you have 2 copies of core library files. Please add comments or a readme in that folder to document which version of the core library they were copied from. Over time as the core library might change, just a quick mention of which version could let someone first install that version rather than wasting a lot of time and frustration with subtle problems if they copy those files into a future core library that needs different initialization.
 
The puppies has arrived! Two of them are immediately dispatched.
One for Rezo and one for jmarsh. Both of them will work on eLCD.

@PaulStoffregen There is one with your name on it, whenever you change your mind. :cool:

NOTE! Some people sends me messages regarding buying a board. These boards are not for sale, they are simply a tool to push the development further. To make the Teensy platform even more powerful. Selected people with knowledge get's them for free to help achieve this goal.

1704729980775.png
 
Last edited:
Funny - 3 hour time diff and I was signing off and you were getting busy - I indeed was pushing that when you did the branch swap and it really messed up on my end. It said I had changes to readme.md and I pulled out the HEAD - then it refused to see that as it has saved some work copy or something it was looking at, but not the copy I saw that I went to the WEB and got the current and replaced to make sure nothign got trashed.

Github has not been helpful in this ...
 
@defragster
Just tried your sketch and getting alot of warning and errors: Also did you run: Run "addr2line -e mysketch.ino.elf 0xD22" for filename & line number

I just rebuilt after closing - something corrupted in that copy? There were NO ERRORS or warnings before ?????
And on closing it said my copy was READ ONLY?

This is in the source:
uint32_t ram1DTCM[CHUNKS / sizeof(uint32_t)];
uint32_t ram2DMA[4];
uint32_t sdramPtr[256];
And it should be an array of pointers ???? And There was a great deal of editing after that and another #define added and it is all lost ????

It was a simple one page example that worked without errors/warnings and had comments ... when I last saw it ... and when posted before removing the other day. I hacked it to print addresses when it crashed the MicroMod - but that is very weird.
 
@PaulStoffregen There is one with your name on it, whenever you change your mind. :cool:

Let's talk of this in March or later. For now I'm trying to help in small but important ways, but I'm currently working on other projects so I just can't get more involved in SDRAM. Just to be realistic, that'll probably still be the case by March time frame too.

As far as I'm concerned, it's perfectly fine to sell any PCB made with the T4 bootloader chip. If you have people who really want one and you'd like to get more people involved without straining your budget, of course it's ok to sell your boards. Do be aware of the Teensy registered trademark. It's fine to say "works with the Teensy software". But it's not ok to call your hardware Teensy, such as "Teensy SDRAM board". You can call it something like "Dogbone's SDRAM Experiement" and the description say it uses the Teensy bootloader with genuine chip from PJRC.
 
Quick demo of malloc() versus sdram_malloc():
>> Pulled the code - it fails on true MicroMod ... needs NULL check somewhere ???
- all the RAM2 will be gone - should get 0/Null ptr?
Removed code found a solvable workaround for board with no SDRAM - but working code was LOST ...
Remade edits from the original non-functioning skeleton - perhaps not a worthy example given the other examples ... but it found that 'issue'.
And if 2 not three CHUNKS of RAM2 {put 3 not 4 in that loop} are allocated an extra CHUNK in the SDRAM loop comes from RAM2 as it should.
Now on DevBoard with SDRAM:
SUCCESS sdram.init()
3 RAM2/DMAMEM compares
255 SDRAM compares
Completed: Should see 3 RAM2 compares and 255 for 32MB of SDRAM if present.
On a true MicroMod (And T_4.1 and T_4.0) it looks like this on a Cold power on - it CrashReport exits on first start - then usually runs like this:
FAILED sdram.init()
CrashReport:
A problem occurred at (system time) 2:23:54
Code was executing from address 0x35A6
CFSR: 82
(DACCVIOL) Data Access Violation
(MMARVALID) Accessed Address: 0x92000000
Temperature inside the chip was 53.70 °C
Startup CPU clock speed is 600MHz
Reboot was caused by auto reboot after fault or bad interrupt detected

FAILED sdram.init()
3 RAM2/DMAMEM compares
Completed: Should see 3 RAM2 compares and 255 for 32MB of SDRAM if present.
And the code:
Code:
#include "SDRAM_t4.h"
SDRAM_t4 sdram;

#define CHUNKS 128*1024 // allocate in 128KB byte chunks
#define CHUNKS_4B (CHUNKS / sizeof(uint32_t)) // 4 byte uint32_T's per CHUNK
uint32_t ram1DTCM[CHUNKS_4B]; // Fixed RAM1 compile time allocation
uint32_t* ram2Ptr[5]; // create pointers for RAM2 allocations
uint32_t* sdramPtr[257]; // create pointers for SDRAM allocations

void setup() {
  uint ii, jj, kk;
  while (!Serial) ; // wait
  if ( CrashReport ) Serial.print( CrashReport );

  for ( ii = 0; ii < CHUNKS_4B; ii++ ) // Initialize RAM1 data area to some value
    ram1DTCM[ii] = ii;
  for ( ii = 0; ii < 4; ii++ )  // Alloc from RAM2/DMAMEM with malloc
    ram2Ptr[ii] = (uint32_t *)malloc( CHUNKS );
  jj = 0;
  while ( ram2Ptr[jj] ) { // Initialize each chunk of RAM2 with value from RAM1
    for ( ii = 0; ii < CHUNKS_4B; ii++ )
      ram2Ptr[jj][ii] = ram1DTCM[ii];
    jj++;
  }
  // Do begin on SDRAM then Allocate and Initialize the SDRAM chunks
  if (sdram.begin()) Serial.print( "\n\tSUCCESS sdram.init()\n");
  else Serial.print( "\n\tFAILED sdram.init()\n");
  for ( ii = 0; ii < 256; ii++ )
    sdramPtr[ii] = (uint32_t *)sdram_malloc( CHUNKS );
  jj = 0;
  while ( sdramPtr[jj] ) {
    for ( ii = 0; ii < CHUNKS_4B; ii++ )
      sdramPtr[jj][ii] = ram1DTCM[ii];
    jj++;
  }
  jj = kk = 0;
  while ( ram2Ptr[jj] ) {
    if ( 0 == memcmp( ram2Ptr[jj], ram1DTCM, CHUNKS ) ) kk++;
    jj++;
  }
  if ( kk == jj ) Serial.printf( "%u RAM2/DMAMEM compares\n", kk );
  jj = kk = 0;
  while ( sdramPtr[jj] ) {
    if ( 0 == memcmp( sdramPtr[jj], ram1DTCM, CHUNKS ) ) kk++;
    jj++;
  }
  if ( kk == jj ) Serial.printf( "%u SDRAM compares\n", kk );
Serial.println( "Completed: Should see 3 RAM2 compares and 255 for 32MB of SDRAM if present." );
}
void loop() {
}
It isn't well commented - except inline but could be if it has value.
 
It isn't well commented - except inline but could be if it has value.

Please add a comment at the top of each example program which explains what the whole program actually does. If a person opens both of the similar examples, your comment should make clear why there are 2 similar-looking examples.

Comments within the code explaining what particular parts do are nice, when/if people try to understand the code.

What is really needed here is an explanation of what the whole program does. The idea is for someone who has never seen the library and looks at the example programs to understand the purpose of each example. Their first task, not yet knowing anything about how the library works, is to choose which of the several examples they will try first. The comment at the very top explains the examples overall purpose. It is meant to help the user quickly understand whether the example meets their needs or interests. If they're more interested in one of the other examples, the purpose of a good top level comment is to help them immediately choose to *NOT* use the examples that don't speak to their particular needs. A large example without this sort of top-level comment adds quite a mental burden for new users, because they can't quickly & easily determine whether the large examples are something they should explore. Don't make them have to deep dive into your code. More comments inside the code helps if they do dive into the code, but before they do, those code-specific comments just make the example longer and more burdensome on the initial decision making! Please, give those people a simple and clear top-level explanation of what each example program really does without having to read the code.

As you write the top level comment, remember you are helping the user choose which example to invest their finite time & energy to explore. If a particular example is not a good fit to their needs, a well written comment that quickly saves them frustration of going down a fruitless (for them) path can make the difference between having a successful experience versus quitting (perhaps the entire library) because things just didn't work out.
 
Last edited:
Please add a comment at the top of each example program which explains what the whole program actually does. If a person opens both of the similar examples, your comment should make clear why there are 2 similar-looking examples.
...
It wasn't posted as an 'example' yet for those understood reasons. As noted, it is duplicative in some ways given the existing
It isn't well commented - except inline but could be if it has value.
perhaps not a worthy example given the other examples

was waiting for some positive feedback before investing added effort.
 
Let's talk of this in March or later. For now I'm trying to help in small but important ways, but I'm currently working on other projects so I just can't get more involved in SDRAM. Just to be realistic, that'll probably still be the case by March time frame too.

As far as I'm concerned, it's perfectly fine to sell any PCB made with the T4 bootloader chip. If you have people who really want one and you'd like to get more people involved without straining your budget, of course it's ok to sell your boards. Do be aware of the Teensy registered trademark. It's fine to say "works with the Teensy software". But it's not ok to call your hardware Teensy, such as "Teensy SDRAM board". You can call it something like "Dogbone's SDRAM Experiement" and the description say it uses the Teensy bootloader with genuine chip from PJRC.
I'll reach out in March, we should have a next gen devboard by then with some more features that's been requested by mjs513 and jmarsh.

Fully understandable about the trademark and such. I like to contribute in the ways I can. I cannot contribute with coding because this is far beyond my skills. But I can contribute with hardware. It's nice of you to clarify what's allowed tho, I appreciate that! :D
 
@defragster - might be useful since it demonstrates different ways to specify memory
Thx @mjs513 had not seen your examples and doing that seemed useful - and it turned up the found and noted issue of crash on non-SDRAm which is now more graceful - the Crash is actually GOOD showing the sketch isn't made for 'this board' but fails "gracefully". Seems it might be good to leave one CHUNK in RAM2 for show the graceful fall-over from SDRAM to RAM2 for that last CHUNK instead of consuming it all - I'll FREE one RAM2 so it goes into the SDRAM array of CHUNKS. Then going back to the original @PaulStoffregen 'Example Design Note' - make it look like the ones you did.

Then I'll make another simple example like LittleFS ListFiles (or other) using an SDRAM_MALLOC and see it work like it does with RAM using : if (!myfs.begin(buf, sizeof(buf)))
 
LittleFS_RAM myfs; works but ListFiles was a boring start with empty disk.
Initializing SDRAM
SUCCESS sdram.init()
Space Used = 4096
Filesystem Size = 10485760
Directory
---------
But that WORKED!
Made same SDRAM init/alloc changes to LittleFS_SDRAM_Simple_Datalogger
And it takes the DevBoard to MISSING ???? >>> Programs but, COLD RESTART GIVES 9 BLINKS
ARRRGH - stupid GITHUB BRANCHING WIPED my MultiRamCmp
source AGAIN - luckily it was posted above easily to cut/paste.
Obviously still WIP - as there is something horribly wrong with the DataLogger example, yet both of the others are working on SDRAM DevBoard!
 
Last edited:
Yes, there are times, when I wish we could do this, not just for custom boards, but in a way to minimize and maybe remove all of the places in the cores\teensy4 that have things like #ifdef ARDUINO_TEENSY40 or ....

And maybe put all such things, like pin numbering, and the like in files under variant directory...
I thought I would try some goofing off and see how hard some of this might be... Maybe should be own thread.

So far, I have put up a few changes in my fork and new branch: https://github.com/KurtE/cores/tree/variants_override

I created a boards.local.txt file, with mostly a copy of the micromod define:
Code:
# Solution for Arduino IDE 2.0 recognizing changes to this file:
# https://github.com/arduino/arduino-ide/issues/1030#issuecomment-1152005617


teensySDRAM.name=Teensy with SDRAM
#teensySDRAM.upload.maximum_size=16515072
teensySDRAM.build.board=TEENSY_SDRAM
teensySDRAM.build.flags.ld=-Wl,--gc-sections,--relax "-T{build.core.path}/imxrt1062_mm.ld"
#teensySDRAM.upload.maximum_data_size=524288
#teensySDRAM.upload.maximum_data_size=1048576
teensySDRAM.upload.tool=teensyloader
teensySDRAM.upload.tool.default=teensyloader
teensySDRAM.upload.tool.teensy=teensyloader
teensySDRAM.upload.protocol=teensy
teensySDRAM.upload_port.modelID=0x26
teensySDRAM.build.core=teensy4
teensySDRAM.build.mcu=imxrt1062
teensySDRAM.build.variant=SDRAM
teensySDRAM.build.includes=-I{build.variant.path}

teensySDRAM.build.warn_data_percentage=99
teensySDRAM.build.toolchain=arm/bin/
teensySDRAM.build.command.gcc=arm-none-eabi-gcc
teensySDRAM.build.command.g++=arm-none-eabi-g++
teensySDRAM.build.command.ar=arm-none-eabi-gcc-ar
teensySDRAM.build.command.objcopy=arm-none-eabi-objcopy
teensySDRAM.build.command.objdump=arm-none-eabi-objdump
teensySDRAM.build.command.linker=arm-none-eabi-gcc
teensySDRAM.build.command.size=arm-none-eabi-size
teensySDRAM.build.flags.common=-g -Wall -ffunction-sections -fdata-sections -nostdlib
teensySDRAM.build.flags.dep=-MMD
teensySDRAM.build.flags.optimize=-Os
teensySDRAM.build.flags.cpu=-mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-d16
teensySDRAM.build.flags.defs=-D__IMXRT1062__ -DTEENSYDUINO=159
teensySDRAM.build.flags.cpp=-std=gnu++17 -fno-exceptions -fpermissive -fno-rtti -fno-threadsafe-statics -felide-constructors -Wno-error=narrowing
teensySDRAM.build.flags.c=
teensySDRAM.build.flags.S=-x assembler-with-cpp
teensySDRAM.build.flags.libs=-larm_cortexM7lfsp_math -lm -lstdc++
teensySDRAM.serial.restart_cmd=false
teensySDRAM.menu.usb.serial=Serial
teensySDRAM.menu.usb.serial.build.usbtype=USB_SERIAL
teensySDRAM.menu.usb.serial.upload_port.usbtype=USB_SERIAL
teensySDRAM.menu.usb.serial2=Dual Serial
teensySDRAM.menu.usb.serial2.build.usbtype=USB_DUAL_SERIAL
teensySDRAM.menu.usb.serial2.upload_port.usbtype=USB_DUAL_SERIAL
teensySDRAM.menu.usb.serial3=Triple Serial
teensySDRAM.menu.usb.serial3.build.usbtype=USB_TRIPLE_SERIAL
teensySDRAM.menu.usb.serial3.upload_port.usbtype=USB_TRIPLE_SERIAL
teensySDRAM.menu.usb.keyboard=Keyboard
teensySDRAM.menu.usb.keyboard.build.usbtype=USB_KEYBOARDONLY
teensySDRAM.menu.usb.keyboard.upload_port.usbtype=USB_KEYBOARDONLY
teensySDRAM.menu.usb.keyboard.fake_serial=teensy_gateway
teensySDRAM.menu.usb.touch=Keyboard + Touch Screen
teensySDRAM.menu.usb.touch.build.usbtype=USB_TOUCHSCREEN
teensySDRAM.menu.usb.touch.upload_port.usbtype=USB_TOUCHSCREEN
teensySDRAM.menu.usb.touch.fake_serial=teensy_gateway
teensySDRAM.menu.usb.hidtouch=Keyboard + Mouse + Touch Screen
teensySDRAM.menu.usb.hidtouch.build.usbtype=USB_HID_TOUCHSCREEN
teensySDRAM.menu.usb.hidtouch.upload_port.usbtype=USB_HID_TOUCHSCREEN
teensySDRAM.menu.usb.hidtouch.fake_serial=teensy_gateway
teensySDRAM.menu.usb.hid=Keyboard + Mouse + Joystick
teensySDRAM.menu.usb.hid.build.usbtype=USB_HID
teensySDRAM.menu.usb.hid.upload_port.usbtype=USB_HID
teensySDRAM.menu.usb.hid.fake_serial=teensy_gateway
teensySDRAM.menu.usb.serialhid=Serial + Keyboard + Mouse + Joystick
teensySDRAM.menu.usb.serialhid.build.usbtype=USB_SERIAL_HID
teensySDRAM.menu.usb.serialhid.upload_port.usbtype=USB_SERIAL_HID
teensySDRAM.menu.usb.midi=MIDI
teensySDRAM.menu.usb.midi.build.usbtype=USB_MIDI
teensySDRAM.menu.usb.midi.upload_port.usbtype=USB_MIDI
teensySDRAM.menu.usb.midi.fake_serial=teensy_gateway
teensySDRAM.menu.usb.midi4=MIDIx4
teensySDRAM.menu.usb.midi4.build.usbtype=USB_MIDI4
teensySDRAM.menu.usb.midi4.upload_port.usbtype=USB_MIDI4
teensySDRAM.menu.usb.midi4.fake_serial=teensy_gateway
teensySDRAM.menu.usb.midi16=MIDIx16
teensySDRAM.menu.usb.midi16.build.usbtype=USB_MIDI16
teensySDRAM.menu.usb.midi16.upload_port.usbtype=USB_MIDI16
teensySDRAM.menu.usb.midi16.fake_serial=teensy_gateway
teensySDRAM.menu.usb.serialmidi=Serial + MIDI
teensySDRAM.menu.usb.serialmidi.build.usbtype=USB_MIDI_SERIAL
teensySDRAM.menu.usb.serialmidi.upload_port.usbtype=USB_MIDI_SERIAL
teensySDRAM.menu.usb.serialmidi4=Serial + MIDIx4
teensySDRAM.menu.usb.serialmidi4.build.usbtype=USB_MIDI4_SERIAL
teensySDRAM.menu.usb.serialmidi4.upload_port.usbtype=USB_MIDI4_SERIAL
teensySDRAM.menu.usb.serialmidi16=Serial + MIDIx16
teensySDRAM.menu.usb.serialmidi16.build.usbtype=USB_MIDI16_SERIAL
teensySDRAM.menu.usb.serialmidi16.upload_port.usbtype=USB_MIDI16_SERIAL
teensySDRAM.menu.usb.audio=Audio
teensySDRAM.menu.usb.audio.build.usbtype=USB_AUDIO
teensySDRAM.menu.usb.audio.upload_port.usbtype=USB_AUDIO
teensySDRAM.menu.usb.audio.fake_serial=teensy_gateway
teensySDRAM.menu.usb.serialmidiaudio=Serial + MIDI + Audio
teensySDRAM.menu.usb.serialmidiaudio.build.usbtype=USB_MIDI_AUDIO_SERIAL
teensySDRAM.menu.usb.serialmidiaudio.upload_port.usbtype=USB_MIDI_AUDIO_SERIAL
teensySDRAM.menu.usb.serialmidi16audio=Serial + MIDIx16 + Audio
teensySDRAM.menu.usb.serialmidi16audio.build.usbtype=USB_MIDI16_AUDIO_SERIAL
teensySDRAM.menu.usb.serialmidi16audio.upload_port.usbtype=USB_MIDI16_AUDIO_SERIAL
teensySDRAM.menu.usb.mtp=MTP Disk (Experimental)
teensySDRAM.menu.usb.mtp.build.usbtype=USB_MTPDISK
teensySDRAM.menu.usb.mtp.upload_port.usbtype=USB_MTPDISK
teensySDRAM.menu.usb.mtp.fake_serial=teensy_gateway
teensySDRAM.menu.usb.serialmtp=Serial + MTP Disk (Experimental)
teensySDRAM.menu.usb.serialmtp.build.usbtype=USB_MTPDISK_SERIAL
teensySDRAM.menu.usb.serialmtp.upload_port.usbtype=USB_MTPDISK_SERIAL
teensySDRAM.menu.usb.rawhid=Raw HID
teensySDRAM.menu.usb.rawhid.build.usbtype=USB_RAWHID
teensySDRAM.menu.usb.rawhid.upload_port.usbtype=USB_RAWHID
teensySDRAM.menu.usb.rawhid.fake_serial=teensy_gateway
teensySDRAM.menu.usb.flightsim=Flight Sim Controls
teensySDRAM.menu.usb.flightsim.build.usbtype=USB_FLIGHTSIM
teensySDRAM.menu.usb.flightsim.upload_port.usbtype=USB_FLIGHTSIM
teensySDRAM.menu.usb.flightsim.fake_serial=teensy_gateway
teensySDRAM.menu.usb.flightsimjoystick=Flight Sim Controls + Joystick
teensySDRAM.menu.usb.flightsimjoystick.build.usbtype=USB_FLIGHTSIM_JOYSTICK
teensySDRAM.menu.usb.flightsimjoystick.upload_port.usbtype=USB_FLIGHTSIM_JOYSTICK
teensySDRAM.menu.usb.flightsimjoystick.fake_serial=teensy_gateway
#teensySDRAM.menu.usb.disable=No USB
#teensySDRAM.menu.usb.disable.build.usbtype=USB_DISABLED

teensySDRAM.menu.speed.600=600 MHz
teensySDRAM.menu.speed.528=528 MHz
teensySDRAM.menu.speed.450=450 MHz
teensySDRAM.menu.speed.396=396 MHz
teensySDRAM.menu.speed.150=150 MHz
teensySDRAM.menu.speed.24=24 MHz
teensySDRAM.menu.speed.720=720 MHz (overclock)
teensySDRAM.menu.speed.816=816 MHz (overclock)
teensySDRAM.menu.speed.912=912 MHz (overclock, cooling req'd)
teensySDRAM.menu.speed.960=960 MHz (overclock, cooling req'd)
teensySDRAM.menu.speed.1008=1.008 GHz (overclock, cooling req'd)
teensySDRAM.menu.speed.1008.build.fcpu=1008000000
teensySDRAM.menu.speed.960.build.fcpu=960000000
teensySDRAM.menu.speed.912.build.fcpu=912000000
teensySDRAM.menu.speed.816.build.fcpu=816000000
teensySDRAM.menu.speed.720.build.fcpu=720000000
teensySDRAM.menu.speed.600.build.fcpu=600000000
teensySDRAM.menu.speed.528.build.fcpu=528000000
teensySDRAM.menu.speed.450.build.fcpu=450000000
teensySDRAM.menu.speed.396.build.fcpu=396000000
teensySDRAM.menu.speed.150.build.fcpu=150000000
teensySDRAM.menu.speed.24.build.fcpu=24000000

teensySDRAM.menu.opt.o2std=Faster
teensySDRAM.menu.opt.o2std.build.flags.optimize=-O2
teensySDRAM.menu.opt.o2std.build.flags.ldspecs=
teensySDRAM.menu.opt.o2lto=Faster with LTO
teensySDRAM.menu.opt.o2lto.build.flags.optimize=-O2 -flto -fno-fat-lto-objects
teensySDRAM.menu.opt.o2lto.build.flags.ldspecs=-fuse-linker-plugin
teensySDRAM.menu.opt.o1std=Fast
teensySDRAM.menu.opt.o1std.build.flags.optimize=-O1
teensySDRAM.menu.opt.o1std.build.flags.ldspecs=
teensySDRAM.menu.opt.o1lto=Fast with LTO
teensySDRAM.menu.opt.o1lto.build.flags.optimize=-O1 -flto -fno-fat-lto-objects
teensySDRAM.menu.opt.o1lto.build.flags.ldspecs=-fuse-linker-plugin
teensySDRAM.menu.opt.o3std=Fastest
teensySDRAM.menu.opt.o3std.build.flags.optimize=-O3
teensySDRAM.menu.opt.o3std.build.flags.ldspecs=
#teensySDRAM.menu.opt.o3purestd=Fastest + pure-code
#teensySDRAM.menu.opt.o3purestd.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__
#teensySDRAM.menu.opt.o3purestd.build.flags.ldspecs=
teensySDRAM.menu.opt.o3lto=Fastest with LTO
teensySDRAM.menu.opt.o3lto.build.flags.optimize=-O3 -flto -fno-fat-lto-objects
teensySDRAM.menu.opt.o3lto.build.flags.ldspecs=-fuse-linker-plugin
#teensySDRAM.menu.opt.o3purelto=Fastest + pure-code with LTO
#teensySDRAM.menu.opt.o3purelto.build.flags.optimize=-O3 -mpure-code -D__PURE_CODE__ -flto -fno-fat-lto-objects
#teensySDRAM.menu.opt.o3purelto.build.flags.ldspecs=-fuse-linker-plugin
teensySDRAM.menu.opt.ogstd=Debug
teensySDRAM.menu.opt.ogstd.build.flags.optimize=-Og
teensySDRAM.menu.opt.ogstd.build.flags.ldspecs=
#teensySDRAM.menu.opt.oglto=Debug with LTO
#teensySDRAM.menu.opt.oglto.build.flags.optimize=-Og -flto -fno-fat-lto-objects
#teensySDRAM.menu.opt.oglto.build.flags.ldspecs=-fuse-linker-plugin
teensySDRAM.menu.opt.osstd=Smallest Code
teensySDRAM.menu.opt.osstd.build.flags.optimize=-Os --specs=nano.specs
teensySDRAM.menu.opt.osstd.build.flags.ldspecs=
teensySDRAM.menu.opt.oslto=Smallest Code with LTO
teensySDRAM.menu.opt.oslto.build.flags.optimize=-Os -flto -fno-fat-lto-objects --specs=nano.specs
teensySDRAM.menu.opt.oslto.build.flags.ldspecs=-fuse-linker-plugin

teensySDRAM.menu.keys.en-us=US English
teensySDRAM.menu.keys.en-us.build.keylayout=US_ENGLISH
teensySDRAM.menu.keys.fr-ca=Canadian French
teensySDRAM.menu.keys.fr-ca.build.keylayout=CANADIAN_FRENCH
teensySDRAM.menu.keys.xx-ca=Canadian Multilingual
teensySDRAM.menu.keys.xx-ca.build.keylayout=CANADIAN_MULTILINGUAL
teensySDRAM.menu.keys.cz-cz=Czech
teensySDRAM.menu.keys.cz-cz.build.keylayout=CZECH
teensySDRAM.menu.keys.da-da=Danish
teensySDRAM.menu.keys.da-da.build.keylayout=DANISH
teensySDRAM.menu.keys.fi-fi=Finnish
teensySDRAM.menu.keys.fi-fi.build.keylayout=FINNISH
teensySDRAM.menu.keys.fr-fr=French
teensySDRAM.menu.keys.fr-fr.build.keylayout=FRENCH
teensySDRAM.menu.keys.fr-be=French Belgian
teensySDRAM.menu.keys.fr-be.build.keylayout=FRENCH_BELGIAN
teensySDRAM.menu.keys.fr-ch=French Swiss
teensySDRAM.menu.keys.fr-ch.build.keylayout=FRENCH_SWISS
teensySDRAM.menu.keys.de-de=German
teensySDRAM.menu.keys.de-de.build.keylayout=GERMAN
teensySDRAM.menu.keys.de-dm=German (Mac)
teensySDRAM.menu.keys.de-dm.build.keylayout=GERMAN_MAC
teensySDRAM.menu.keys.de-ch=German Swiss
teensySDRAM.menu.keys.de-ch.build.keylayout=GERMAN_SWISS
teensySDRAM.menu.keys.is-is=Icelandic
teensySDRAM.menu.keys.is-is.build.keylayout=ICELANDIC
teensySDRAM.menu.keys.en-ie=Irish
teensySDRAM.menu.keys.en-ie.build.keylayout=IRISH
teensySDRAM.menu.keys.it-it=Italian
teensySDRAM.menu.keys.it-it.build.keylayout=ITALIAN
teensySDRAM.menu.keys.no-no=Norwegian
teensySDRAM.menu.keys.no-no.build.keylayout=NORWEGIAN
teensySDRAM.menu.keys.pt-pt=Portuguese
teensySDRAM.menu.keys.pt-pt.build.keylayout=PORTUGUESE
teensySDRAM.menu.keys.pt-br=Portuguese Brazilian
teensySDRAM.menu.keys.pt-br.build.keylayout=PORTUGUESE_BRAZILIAN
teensySDRAM.menu.keys.rs-rs=Serbian (Latin Only)
teensySDRAM.menu.keys.rs-rs.build.keylayout=SERBIAN_LATIN_ONLY
teensySDRAM.menu.keys.es-es=Spanish
teensySDRAM.menu.keys.es-es.build.keylayout=SPANISH
teensySDRAM.menu.keys.es-mx=Spanish Latin America
teensySDRAM.menu.keys.es-mx.build.keylayout=SPANISH_LATIN_AMERICA
teensySDRAM.menu.keys.sv-se=Swedish
teensySDRAM.menu.keys.sv-se.build.keylayout=SWEDISH
teensySDRAM.menu.keys.tr-tr=Turkish (partial)
teensySDRAM.menu.keys.tr-tr.build.keylayout=TURKISH
teensySDRAM.menu.keys.en-gb=United Kingdom
teensySDRAM.menu.keys.en-gb.build.keylayout=UNITED_KINGDOM
teensySDRAM.menu.keys.usint=US International
teensySDRAM.menu.keys.usint.build.keylayout=US_INTERNATIONAL

I then created a directory: variants/sdram under the 0.59.4, and currently have it setup currently with a file: varant.h
Which currently is mostly a copy of the Micromod section of core_pins.h:
Code:
// Tell most of the system for now you are a MICROMOD
#define ARDUINO_TEENSY_MICROMOD


#define CORE_NUM_TOTAL_PINS    46
#define CORE_NUM_DIGITAL    46
#define CORE_NUM_INTERRUPT    46
#define CORE_NUM_ANALOG        14
#define CORE_NUM_PWM        30

#define CORE_PIN0_BIT        3
#define CORE_PIN1_BIT        2
#define CORE_PIN2_BIT        4
#define CORE_PIN3_BIT        5
#define CORE_PIN4_BIT        6
#define CORE_PIN5_BIT        8
#define CORE_PIN6_BIT        10
#define CORE_PIN7_BIT        17
#define CORE_PIN8_BIT        16
#define CORE_PIN9_BIT        11
#define CORE_PIN10_BIT        0
#define CORE_PIN11_BIT        2
#define CORE_PIN12_BIT        1
#define CORE_PIN13_BIT        3
#define CORE_PIN14_BIT        18
#define CORE_PIN15_BIT        19
#define CORE_PIN16_BIT        23
#define CORE_PIN17_BIT        22
#define CORE_PIN18_BIT        17
#define CORE_PIN19_BIT        16
#define CORE_PIN20_BIT        26
#define CORE_PIN21_BIT        27
#define CORE_PIN22_BIT        24
#define CORE_PIN23_BIT        25
#define CORE_PIN24_BIT        12
#define CORE_PIN25_BIT        13
#define CORE_PIN26_BIT        30
#define CORE_PIN27_BIT        31
#define CORE_PIN28_BIT        18
#define CORE_PIN29_BIT        31
#define CORE_PIN30_BIT        23
#define CORE_PIN31_BIT        22
#define CORE_PIN32_BIT        12
#define CORE_PIN33_BIT        7
#define CORE_PIN34_BIT        15
#define CORE_PIN35_BIT        14
#define CORE_PIN36_BIT        13
#define CORE_PIN37_BIT        12
#define CORE_PIN38_BIT        16
#define CORE_PIN39_BIT        17
#define CORE_PIN40_BIT        4
#define CORE_PIN41_BIT        5
#define CORE_PIN42_BIT        6
#define CORE_PIN43_BIT        7
#define CORE_PIN44_BIT        8
#define CORE_PIN45_BIT        9

#define CORE_PIN0_BITMASK    (1<<(CORE_PIN0_BIT))
#define CORE_PIN1_BITMASK    (1<<(CORE_PIN1_BIT))
#define CORE_PIN2_BITMASK    (1<<(CORE_PIN2_BIT))
#define CORE_PIN3_BITMASK    (1<<(CORE_PIN3_BIT))
#define CORE_PIN4_BITMASK    (1<<(CORE_PIN4_BIT))
#define CORE_PIN5_BITMASK    (1<<(CORE_PIN5_BIT))
#define CORE_PIN6_BITMASK    (1<<(CORE_PIN6_BIT))
#define CORE_PIN7_BITMASK    (1<<(CORE_PIN7_BIT))
#define CORE_PIN8_BITMASK    (1<<(CORE_PIN8_BIT))
#define CORE_PIN9_BITMASK    (1<<(CORE_PIN9_BIT))
#define CORE_PIN10_BITMASK    (1<<(CORE_PIN10_BIT))
#define CORE_PIN11_BITMASK    (1<<(CORE_PIN11_BIT))
#define CORE_PIN12_BITMASK    (1<<(CORE_PIN12_BIT))
#define CORE_PIN13_BITMASK    (1<<(CORE_PIN13_BIT))
#define CORE_PIN14_BITMASK    (1<<(CORE_PIN14_BIT))
#define CORE_PIN15_BITMASK    (1<<(CORE_PIN15_BIT))
#define CORE_PIN16_BITMASK    (1<<(CORE_PIN16_BIT))
#define CORE_PIN17_BITMASK    (1<<(CORE_PIN17_BIT))
#define CORE_PIN18_BITMASK    (1<<(CORE_PIN18_BIT))
#define CORE_PIN19_BITMASK    (1<<(CORE_PIN19_BIT))
#define CORE_PIN20_BITMASK    (1<<(CORE_PIN20_BIT))
#define CORE_PIN21_BITMASK    (1<<(CORE_PIN21_BIT))
#define CORE_PIN22_BITMASK    (1<<(CORE_PIN22_BIT))
#define CORE_PIN23_BITMASK    (1<<(CORE_PIN23_BIT))
#define CORE_PIN24_BITMASK    (1<<(CORE_PIN24_BIT))
#define CORE_PIN25_BITMASK    (1<<(CORE_PIN25_BIT))
#define CORE_PIN26_BITMASK    (1<<(CORE_PIN26_BIT))
#define CORE_PIN27_BITMASK    (1<<(CORE_PIN27_BIT))
#define CORE_PIN28_BITMASK    (1<<(CORE_PIN28_BIT))
#define CORE_PIN29_BITMASK    (1<<(CORE_PIN29_BIT))
#define CORE_PIN30_BITMASK    (1<<(CORE_PIN30_BIT))
#define CORE_PIN31_BITMASK    (1<<(CORE_PIN31_BIT))
#define CORE_PIN32_BITMASK    (1<<(CORE_PIN32_BIT))
#define CORE_PIN33_BITMASK    (1<<(CORE_PIN33_BIT))
#define CORE_PIN34_BITMASK    (1<<(CORE_PIN34_BIT))
#define CORE_PIN35_BITMASK    (1<<(CORE_PIN35_BIT))
#define CORE_PIN36_BITMASK    (1<<(CORE_PIN36_BIT))
#define CORE_PIN37_BITMASK    (1<<(CORE_PIN37_BIT))
#define CORE_PIN38_BITMASK    (1<<(CORE_PIN38_BIT))
#define CORE_PIN39_BITMASK    (1<<(CORE_PIN39_BIT))
#define CORE_PIN40_BITMASK    (1<<(CORE_PIN40_BIT))
#define CORE_PIN41_BITMASK    (1<<(CORE_PIN41_BIT))
#define CORE_PIN42_BITMASK    (1<<(CORE_PIN42_BIT))
#define CORE_PIN43_BITMASK    (1<<(CORE_PIN43_BIT))
#define CORE_PIN44_BITMASK    (1<<(CORE_PIN44_BIT))
#define CORE_PIN45_BITMASK    (1<<(CORE_PIN45_BIT))


// Fast GPIO
#define CORE_PIN0_PORTREG    GPIO6_DR
#define CORE_PIN1_PORTREG    GPIO6_DR
#define CORE_PIN2_PORTREG    GPIO9_DR
#define CORE_PIN3_PORTREG    GPIO9_DR
#define CORE_PIN4_PORTREG    GPIO9_DR
#define CORE_PIN5_PORTREG    GPIO9_DR
#define CORE_PIN6_PORTREG    GPIO7_DR
#define CORE_PIN7_PORTREG    GPIO7_DR
#define CORE_PIN8_PORTREG    GPIO7_DR
#define CORE_PIN9_PORTREG    GPIO7_DR
#define CORE_PIN10_PORTREG    GPIO7_DR
#define CORE_PIN11_PORTREG    GPIO7_DR
#define CORE_PIN12_PORTREG    GPIO7_DR
#define CORE_PIN13_PORTREG    GPIO7_DR
#define CORE_PIN14_PORTREG    GPIO6_DR
#define CORE_PIN15_PORTREG    GPIO6_DR
#define CORE_PIN16_PORTREG    GPIO6_DR
#define CORE_PIN17_PORTREG    GPIO6_DR
#define CORE_PIN18_PORTREG    GPIO6_DR
#define CORE_PIN19_PORTREG    GPIO6_DR
#define CORE_PIN20_PORTREG    GPIO6_DR
#define CORE_PIN21_PORTREG    GPIO6_DR
#define CORE_PIN22_PORTREG    GPIO6_DR
#define CORE_PIN23_PORTREG    GPIO6_DR
#define CORE_PIN24_PORTREG    GPIO6_DR
#define CORE_PIN25_PORTREG    GPIO6_DR
#define CORE_PIN26_PORTREG    GPIO6_DR
#define CORE_PIN27_PORTREG    GPIO6_DR
#define CORE_PIN28_PORTREG    GPIO8_DR
#define CORE_PIN29_PORTREG    GPIO9_DR
#define CORE_PIN30_PORTREG    GPIO8_DR
#define CORE_PIN31_PORTREG    GPIO8_DR
#define CORE_PIN32_PORTREG    GPIO7_DR
#define CORE_PIN33_PORTREG    GPIO9_DR
#define CORE_PIN34_PORTREG    GPIO8_DR
#define CORE_PIN35_PORTREG    GPIO8_DR
#define CORE_PIN36_PORTREG    GPIO8_DR
#define CORE_PIN37_PORTREG    GPIO8_DR
#define CORE_PIN38_PORTREG    GPIO8_DR
#define CORE_PIN39_PORTREG    GPIO8_DR
#define CORE_PIN40_PORTREG    GPIO7_DR
#define CORE_PIN41_PORTREG    GPIO7_DR
#define CORE_PIN42_PORTREG    GPIO7_DR
#define CORE_PIN43_PORTREG    GPIO7_DR
#define CORE_PIN44_PORTREG    GPIO7_DR
#define CORE_PIN45_PORTREG    GPIO7_DR

#define CORE_PIN0_PORTSET    GPIO6_DR_SET
#define CORE_PIN1_PORTSET    GPIO6_DR_SET
#define CORE_PIN2_PORTSET    GPIO9_DR_SET
#define CORE_PIN3_PORTSET    GPIO9_DR_SET
#define CORE_PIN4_PORTSET    GPIO9_DR_SET
#define CORE_PIN5_PORTSET    GPIO9_DR_SET
#define CORE_PIN6_PORTSET    GPIO7_DR_SET
#define CORE_PIN7_PORTSET    GPIO7_DR_SET
#define CORE_PIN8_PORTSET    GPIO7_DR_SET
#define CORE_PIN9_PORTSET    GPIO7_DR_SET
#define CORE_PIN10_PORTSET    GPIO7_DR_SET
#define CORE_PIN11_PORTSET    GPIO7_DR_SET
#define CORE_PIN12_PORTSET    GPIO7_DR_SET
#define CORE_PIN13_PORTSET    GPIO7_DR_SET
#define CORE_PIN14_PORTSET    GPIO6_DR_SET
#define CORE_PIN15_PORTSET    GPIO6_DR_SET
#define CORE_PIN16_PORTSET    GPIO6_DR_SET
#define CORE_PIN17_PORTSET    GPIO6_DR_SET
#define CORE_PIN18_PORTSET    GPIO6_DR_SET
#define CORE_PIN19_PORTSET    GPIO6_DR_SET
#define CORE_PIN20_PORTSET    GPIO6_DR_SET
#define CORE_PIN21_PORTSET    GPIO6_DR_SET
#define CORE_PIN22_PORTSET    GPIO6_DR_SET
#define CORE_PIN23_PORTSET    GPIO6_DR_SET
#define CORE_PIN24_PORTSET    GPIO6_DR_SET
#define CORE_PIN25_PORTSET    GPIO6_DR_SET
#define CORE_PIN26_PORTSET    GPIO6_DR_SET
#define CORE_PIN27_PORTSET    GPIO6_DR_SET
#define CORE_PIN28_PORTSET    GPIO8_DR_SET
#define CORE_PIN29_PORTSET    GPIO9_DR_SET
#define CORE_PIN30_PORTSET    GPIO8_DR_SET
#define CORE_PIN31_PORTSET    GPIO8_DR_SET
#define CORE_PIN32_PORTSET    GPIO7_DR_SET
#define CORE_PIN33_PORTSET    GPIO9_DR_SET
#define CORE_PIN34_PORTSET    GPIO8_DR_SET
#define CORE_PIN35_PORTSET    GPIO8_DR_SET
#define CORE_PIN36_PORTSET    GPIO8_DR_SET
#define CORE_PIN37_PORTSET    GPIO8_DR_SET
#define CORE_PIN38_PORTSET    GPIO8_DR_SET
#define CORE_PIN39_PORTSET    GPIO8_DR_SET
#define CORE_PIN40_PORTSET    GPIO7_DR_SET
#define CORE_PIN41_PORTSET    GPIO7_DR_SET
#define CORE_PIN42_PORTSET    GPIO7_DR_SET
#define CORE_PIN43_PORTSET    GPIO7_DR_SET
#define CORE_PIN44_PORTSET    GPIO7_DR_SET
#define CORE_PIN45_PORTSET    GPIO7_DR_SET

#define CORE_PIN0_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN1_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN2_PORTCLEAR    GPIO9_DR_CLEAR
#define CORE_PIN3_PORTCLEAR    GPIO9_DR_CLEAR
#define CORE_PIN4_PORTCLEAR    GPIO9_DR_CLEAR
#define CORE_PIN5_PORTCLEAR    GPIO9_DR_CLEAR
#define CORE_PIN6_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN7_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN8_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN9_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN10_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN11_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN12_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN13_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN14_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN15_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN16_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN17_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN18_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN19_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN20_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN21_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN22_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN23_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN24_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN25_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN26_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN27_PORTCLEAR    GPIO6_DR_CLEAR
#define CORE_PIN28_PORTCLEAR    GPIO8_DR_CLEAR
#define CORE_PIN29_PORTCLEAR    GPIO9_DR_CLEAR
#define CORE_PIN30_PORTCLEAR    GPIO8_DR_CLEAR
#define CORE_PIN31_PORTCLEAR    GPIO8_DR_CLEAR
#define CORE_PIN32_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN33_PORTCLEAR    GPIO9_DR_CLEAR
#define CORE_PIN34_PORTCLEAR    GPIO8_DR_CLEAR
#define CORE_PIN35_PORTCLEAR    GPIO8_DR_CLEAR
#define CORE_PIN36_PORTCLEAR    GPIO8_DR_CLEAR
#define CORE_PIN37_PORTCLEAR    GPIO8_DR_CLEAR
#define CORE_PIN38_PORTCLEAR    GPIO8_DR_CLEAR
#define CORE_PIN39_PORTCLEAR    GPIO8_DR_CLEAR
#define CORE_PIN40_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN41_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN42_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN43_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN44_PORTCLEAR    GPIO7_DR_CLEAR
#define CORE_PIN45_PORTCLEAR    GPIO7_DR_CLEAR

#define CORE_PIN0_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN1_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN2_PORTTOGGLE    GPIO9_DR_TOGGLE
#define CORE_PIN3_PORTTOGGLE    GPIO9_DR_TOGGLE
#define CORE_PIN4_PORTTOGGLE    GPIO9_DR_TOGGLE
#define CORE_PIN5_PORTTOGGLE    GPIO9_DR_TOGGLE
#define CORE_PIN6_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN7_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN8_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN9_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN10_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN11_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN12_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN13_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN14_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN15_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN16_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN17_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN18_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN19_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN20_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN21_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN22_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN23_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN24_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN25_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN26_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN27_PORTTOGGLE    GPIO6_DR_TOGGLE
#define CORE_PIN28_PORTTOGGLE    GPIO8_DR_TOGGLE
#define CORE_PIN29_PORTTOGGLE    GPIO9_DR_TOGGLE
#define CORE_PIN30_PORTTOGGLE    GPIO8_DR_TOGGLE
#define CORE_PIN31_PORTTOGGLE    GPIO8_DR_TOGGLE
#define CORE_PIN32_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN33_PORTTOGGLE    GPIO9_DR_TOGGLE
#define CORE_PIN34_PORTTOGGLE    GPIO8_DR_TOGGLE
#define CORE_PIN35_PORTTOGGLE    GPIO8_DR_TOGGLE
#define CORE_PIN36_PORTTOGGLE    GPIO8_DR_TOGGLE
#define CORE_PIN37_PORTTOGGLE    GPIO8_DR_TOGGLE
#define CORE_PIN38_PORTTOGGLE    GPIO8_DR_TOGGLE
#define CORE_PIN39_PORTTOGGLE    GPIO8_DR_TOGGLE
#define CORE_PIN40_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN41_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN42_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN43_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN44_PORTTOGGLE    GPIO7_DR_TOGGLE
#define CORE_PIN45_PORTTOGGLE    GPIO7_DR_TOGGLE


#define CORE_PIN0_DDRREG    GPIO6_GDIR
#define CORE_PIN1_DDRREG    GPIO6_GDIR
#define CORE_PIN2_DDRREG    GPIO9_GDIR
#define CORE_PIN3_DDRREG    GPIO9_GDIR
#define CORE_PIN4_DDRREG    GPIO9_GDIR
#define CORE_PIN5_DDRREG    GPIO9_GDIR
#define CORE_PIN6_DDRREG    GPIO7_GDIR
#define CORE_PIN7_DDRREG    GPIO7_GDIR
#define CORE_PIN8_DDRREG    GPIO7_GDIR
#define CORE_PIN9_DDRREG    GPIO7_GDIR
#define CORE_PIN10_DDRREG    GPIO7_GDIR
#define CORE_PIN11_DDRREG    GPIO7_GDIR
#define CORE_PIN12_DDRREG    GPIO7_GDIR
#define CORE_PIN13_DDRREG    GPIO7_GDIR
#define CORE_PIN14_DDRREG    GPIO6_GDIR
#define CORE_PIN15_DDRREG    GPIO6_GDIR
#define CORE_PIN16_DDRREG    GPIO6_GDIR
#define CORE_PIN17_DDRREG    GPIO6_GDIR
#define CORE_PIN18_DDRREG    GPIO6_GDIR
#define CORE_PIN19_DDRREG    GPIO6_GDIR
#define CORE_PIN20_DDRREG    GPIO6_GDIR
#define CORE_PIN21_DDRREG    GPIO6_GDIR
#define CORE_PIN22_DDRREG    GPIO6_GDIR
#define CORE_PIN23_DDRREG    GPIO6_GDIR
#define CORE_PIN24_DDRREG    GPIO6_GDIR
#define CORE_PIN25_DDRREG    GPIO6_GDIR
#define CORE_PIN26_DDRREG    GPIO6_GDIR
#define CORE_PIN27_DDRREG    GPIO6_GDIR
#define CORE_PIN28_DDRREG    GPIO8_GDIR
#define CORE_PIN29_DDRREG    GPIO9_GDIR
#define CORE_PIN30_DDRREG    GPIO8_GDIR
#define CORE_PIN31_DDRREG    GPIO8_GDIR
#define CORE_PIN32_DDRREG    GPIO7_GDIR
#define CORE_PIN33_DDRREG    GPIO9_GDIR
#define CORE_PIN34_DDRREG    GPIO8_GDIR
#define CORE_PIN35_DDRREG    GPIO8_GDIR
#define CORE_PIN36_DDRREG    GPIO8_GDIR
#define CORE_PIN37_DDRREG    GPIO8_GDIR
#define CORE_PIN38_DDRREG    GPIO8_GDIR
#define CORE_PIN39_DDRREG    GPIO8_GDIR
#define CORE_PIN40_DDRREG    GPIO7_GDIR
#define CORE_PIN41_DDRREG    GPIO7_GDIR
#define CORE_PIN42_DDRREG    GPIO7_GDIR
#define CORE_PIN43_DDRREG    GPIO7_GDIR
#define CORE_PIN44_DDRREG    GPIO7_GDIR
#define CORE_PIN45_DDRREG    GPIO7_GDIR

#define CORE_PIN0_PINREG    GPIO6_PSR
#define CORE_PIN1_PINREG    GPIO6_PSR
#define CORE_PIN2_PINREG    GPIO9_PSR
#define CORE_PIN3_PINREG    GPIO9_PSR
#define CORE_PIN4_PINREG    GPIO9_PSR
#define CORE_PIN5_PINREG    GPIO9_PSR
#define CORE_PIN6_PINREG    GPIO7_PSR
#define CORE_PIN7_PINREG    GPIO7_PSR
#define CORE_PIN8_PINREG    GPIO7_PSR
#define CORE_PIN9_PINREG    GPIO7_PSR
#define CORE_PIN10_PINREG    GPIO7_PSR
#define CORE_PIN11_PINREG    GPIO7_PSR
#define CORE_PIN12_PINREG    GPIO7_PSR
#define CORE_PIN13_PINREG    GPIO7_PSR
#define CORE_PIN14_PINREG    GPIO6_PSR
#define CORE_PIN15_PINREG    GPIO6_PSR
#define CORE_PIN16_PINREG    GPIO6_PSR
#define CORE_PIN17_PINREG    GPIO6_PSR
#define CORE_PIN18_PINREG    GPIO6_PSR
#define CORE_PIN19_PINREG    GPIO6_PSR
#define CORE_PIN20_PINREG    GPIO6_PSR
#define CORE_PIN21_PINREG    GPIO6_PSR
#define CORE_PIN22_PINREG    GPIO6_PSR
#define CORE_PIN23_PINREG    GPIO6_PSR
#define CORE_PIN24_PINREG    GPIO6_PSR
#define CORE_PIN25_PINREG    GPIO6_PSR
#define CORE_PIN26_PINREG    GPIO6_PSR
#define CORE_PIN27_PINREG    GPIO6_PSR
#define CORE_PIN28_PINREG    GPIO8_PSR
#define CORE_PIN29_PINREG    GPIO9_PSR
#define CORE_PIN30_PINREG    GPIO8_PSR
#define CORE_PIN31_PINREG    GPIO8_PSR
#define CORE_PIN32_PINREG    GPIO7_PSR
#define CORE_PIN33_PINREG    GPIO9_PSR
#define CORE_PIN34_PINREG    GPIO8_PSR
#define CORE_PIN35_PINREG    GPIO8_PSR
#define CORE_PIN36_PINREG    GPIO8_PSR
#define CORE_PIN37_PINREG    GPIO8_PSR
#define CORE_PIN38_PINREG    GPIO8_PSR
#define CORE_PIN39_PINREG    GPIO8_PSR
#define CORE_PIN40_PINREG    GPIO7_PSR
#define CORE_PIN41_PINREG    GPIO7_PSR
#define CORE_PIN42_PINREG    GPIO7_PSR
#define CORE_PIN43_PINREG    GPIO7_PSR
#define CORE_PIN44_PINREG    GPIO7_PSR
#define CORE_PIN45_PINREG    GPIO7_PSR



// mux config registers control which peripheral uses the pin
#define CORE_PIN0_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B0_03
#define CORE_PIN1_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B0_02
#define CORE_PIN2_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_04
#define CORE_PIN3_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_05
#define CORE_PIN4_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_06
#define CORE_PIN5_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_08
#define CORE_PIN6_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_10
#define CORE_PIN7_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_01
#define CORE_PIN8_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B1_00
#define CORE_PIN9_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_11
#define CORE_PIN10_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_00
#define CORE_PIN11_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_02
#define CORE_PIN12_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_01
#define CORE_PIN13_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_03
#define CORE_PIN14_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_02
#define CORE_PIN15_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_03
#define CORE_PIN16_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_07
#define CORE_PIN17_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_06
#define CORE_PIN18_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_01
#define CORE_PIN19_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_00
#define CORE_PIN20_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_10
#define CORE_PIN21_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_11
#define CORE_PIN22_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_08
#define CORE_PIN23_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_09
#define CORE_PIN24_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B0_12
#define CORE_PIN25_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B0_13
#define CORE_PIN26_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_14
#define CORE_PIN27_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_AD_B1_15
#define CORE_PIN28_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_32
#define CORE_PIN29_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_31
#define CORE_PIN30_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_37
#define CORE_PIN31_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_36
#define CORE_PIN32_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_12
#define CORE_PIN33_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_EMC_07
#define CORE_PIN34_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_03
#define CORE_PIN35_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_02
#define CORE_PIN36_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_01
#define CORE_PIN37_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_00
#define CORE_PIN38_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_04
#define CORE_PIN39_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_SD_B0_05
#define CORE_PIN40_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_04
#define CORE_PIN41_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_05
#define CORE_PIN42_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_06
#define CORE_PIN43_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_07
#define CORE_PIN44_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_08
#define CORE_PIN45_CONFIG    IOMUXC_SW_MUX_CTL_PAD_GPIO_B0_09

// pad config registers control pullup/pulldown/keeper, drive strength, etc
#define CORE_PIN0_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B0_03
#define CORE_PIN1_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B0_02
#define CORE_PIN2_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_04
#define CORE_PIN3_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_05
#define CORE_PIN4_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_06
#define CORE_PIN5_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_08
#define CORE_PIN6_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_10
#define CORE_PIN7_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_01
#define CORE_PIN8_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B1_00
#define CORE_PIN9_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_11
#define CORE_PIN10_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_00
#define CORE_PIN11_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_02
#define CORE_PIN12_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_01
#define CORE_PIN13_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_03
#define CORE_PIN14_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_02
#define CORE_PIN15_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_03
#define CORE_PIN16_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_07
#define CORE_PIN17_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_06
#define CORE_PIN18_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_01
#define CORE_PIN19_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_00
#define CORE_PIN20_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_10
#define CORE_PIN21_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_11
#define CORE_PIN22_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_08
#define CORE_PIN23_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_09
#define CORE_PIN24_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B0_12
#define CORE_PIN25_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B0_13
#define CORE_PIN26_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_14
#define CORE_PIN27_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_AD_B1_15
#define CORE_PIN28_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_32
#define CORE_PIN29_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_31
#define CORE_PIN30_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_37
#define CORE_PIN31_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_36
#define CORE_PIN32_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_12
#define CORE_PIN33_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_EMC_07
#define CORE_PIN34_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_03
#define CORE_PIN35_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_02
#define CORE_PIN36_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_01
#define CORE_PIN37_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_00
#define CORE_PIN38_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_04
#define CORE_PIN39_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_SD_B0_05
#define CORE_PIN40_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_04
#define CORE_PIN41_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_05
#define CORE_PIN42_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_06
#define CORE_PIN43_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_07
#define CORE_PIN44_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_08
#define CORE_PIN45_PADCONFIG    IOMUXC_SW_PAD_CTL_PAD_GPIO_B0_09

#define CORE_LED0_PIN        13

#define CORE_ADC0_PIN        14
#define CORE_ADC1_PIN        15
#define CORE_ADC2_PIN        16
#define CORE_ADC3_PIN        17
#define CORE_ADC4_PIN        18
#define CORE_ADC5_PIN        19
#define CORE_ADC6_PIN        20
#define CORE_ADC7_PIN        21
#define CORE_ADC8_PIN        22
#define CORE_ADC9_PIN        23

#define CORE_RXD0_PIN        0
#define CORE_TXD0_PIN        1
#define CORE_RXD1_PIN        7
#define CORE_TXD1_PIN        8
#define CORE_RXD2_PIN        15
#define CORE_TXD2_PIN        14
#define CORE_RXD3_PIN        16
#define CORE_TXD3_PIN        17
#define CORE_RXD4_PIN        21
#define CORE_TXD4_PIN        20
#define CORE_RXD5_PIN        25
#define CORE_TXD5_PIN        24
#define CORE_RXD6_PIN        28
#define CORE_TXD6_PIN        29

#define CORE_INT0_PIN        0
#define CORE_INT1_PIN        1
#define CORE_INT2_PIN        2
#define CORE_INT3_PIN        3
#define CORE_INT4_PIN        4
#define CORE_INT5_PIN        5
#define CORE_INT6_PIN        6
#define CORE_INT7_PIN        7
#define CORE_INT8_PIN        8
#define CORE_INT9_PIN        9
#define CORE_INT10_PIN        10
#define CORE_INT11_PIN        11
#define CORE_INT12_PIN        12
#define CORE_INT13_PIN        13
#define CORE_INT14_PIN        14
#define CORE_INT15_PIN        15
#define CORE_INT16_PIN        16
#define CORE_INT17_PIN        17
#define CORE_INT18_PIN        18
#define CORE_INT19_PIN        19
#define CORE_INT20_PIN        20
#define CORE_INT21_PIN        21
#define CORE_INT22_PIN        22
#define CORE_INT23_PIN        23
#define CORE_INT24_PIN        24
#define CORE_INT25_PIN        25
#define CORE_INT26_PIN        26
#define CORE_INT27_PIN        27
#define CORE_INT28_PIN        28
#define CORE_INT29_PIN        29
#define CORE_INT30_PIN        30
#define CORE_INT31_PIN        31
#define CORE_INT32_PIN        32
#define CORE_INT33_PIN        33
#define CORE_INT34_PIN        34
#define CORE_INT35_PIN        35
#define CORE_INT36_PIN        36
#define CORE_INT37_PIN        37
#define CORE_INT38_PIN        38
#define CORE_INT39_PIN        39
#define CORE_INT40_PIN        40
#define CORE_INT41_PIN        41
#define CORE_INT42_PIN        42
#define CORE_INT43_PIN        43
#define CORE_INT44_PIN        44
#define CORE_INT45_PIN        45
#define CORE_INT_EVERY_PIN    1

I added the ability for the core_pins.h file to optionally include this file, like:
Code:
...
#if __has_include("variant.h")
#  include "variant.h"
//#pragma message "core_pins.h" - included variant.h
// Default no override file
#elif defined(__IMXRT1062__) && defined(ARDUINO_TEENSY40)
...

The first pre-compiles failed as not finding this file: I had to update platform.txt
I needed to change:
Code:
## Precompile Arduino.h header
recipe.hooks.sketch.prebuild.1.pattern="{teensytools.path}precompile_helper" "{runtime.platform.path}/cores/{build.core}" "{build.path}" "{compiler.path}{build.toolchain}{build.command.g++}" -x c++-header {build.flags.optimize} {build.flags.common} {build.flags.dep} {build.flags.cpp} {build.flags.cpu} {build.flags.defs} -DARDUINO={runtime.ide.version} -DARDUINO_{build.board} -DF_CPU={build.fcpu} -D{build.usbtype} -DLAYOUT_{build.keylayout} "-I{runtime.platform.path}/cores/{build.core}" "-I{build.variant.path}" "{build.path}/pch/Arduino.h" -o "{build.path}/pch/Arduino.h.gch"
To try to look for header files in the variant path: "-I{build.variant.path}"
A lot of this then compiled:

Note: the variant.h file I added a define in to make a lot of the code compile as if it was defined for MICROMOD.
#define ARDUINO_TEENSY_MICROMOD

But bootdata.c did not compile as it does not include ... So I added the include into this file:
Code:
//#include "imxrt.h"
#if __has_include("variant.h")
#  include "variant.h"
#endif
#include <stdint.h>
Which fixed this section:
Code:
#if defined(ARDUINO_TEENSY40)
    0x00200000,        // sflashA1Size            0x50
#elif defined(ARDUINO_TEENSY41)
    0x00800000,        // sflashA1Size            0x50
#elif defined(ARDUINO_TEENSY_MICROMOD)
    0x01000000,        // sflashA1Size            0x50
#else
#error "Unknow flash chip size";
#endif

But thinking it should potentially allow variant.h to define sflashA1Size and use it if defined...)

Ditto for eeprom.c:
Code:
// Generally you should avoid editing this code, unless you really
// know what you're doing.


#if __has_include("variant.h")
#  include "variant.h"
#endif
To fix:
Code:
#if defined(ARDUINO_TEENSY40)
#define FLASH_BASEADDR 0x601F0000
#define FLASH_SECTORS  15
#elif defined(ARDUINO_TEENSY41)
#define FLASH_BASEADDR 0x607C0000
#define FLASH_SECTORS  63
#elif defined(ARDUINO_TEENSY_MICROMOD)
#define FLASH_BASEADDR 0x60FC0000
#define FLASH_SECTORS  63
#endif

And now it builds... Have not tried running it on MMOD yet. Should work as I have not locally anything yet. Same pins...

But; assuming this is something of interest and maybe something like it brought into the fold, then there are several more areas to look at:
Like: what pins are used for different subsystems like SerialX objects, Wire objects, SPI objects, etc.

There are a couple of different approaches that could be taken.
For example Serial objects. Like Serial1 in HardwareSerial1.cpp:
Code:
// Serial1
static BUFTYPE tx_buffer1[SERIAL1_TX_BUFFER_SIZE];
static BUFTYPE rx_buffer1[SERIAL1_RX_BUFFER_SIZE];

const HardwareSerialIMXRT::hardware_t UART6_Hardware = {
    0, IRQ_LPUART6, &IRQHandler_Serial1,
    &serialEvent1,
    CCM_CCGR3, CCM_CCGR3_LPUART6(CCM_CCGR_ON),
    #if defined(ARDUINO_TEENSY41)
    {{0,2, &IOMUXC_LPUART6_RX_SELECT_INPUT, 1}, {52, 2, &IOMUXC_LPUART6_RX_SELECT_INPUT, 0}},
    {{1,2, &IOMUXC_LPUART6_TX_SELECT_INPUT, 1}, {53, 2, &IOMUXC_LPUART6_TX_SELECT_INPUT, 0}},
    #else
    {{0,2, &IOMUXC_LPUART6_RX_SELECT_INPUT, 1}, {0xff, 0xff, nullptr, 0}},
    {{1,2, &IOMUXC_LPUART6_TX_SELECT_INPUT, 1}, {0xff, 0xff, nullptr, 0}},
    #endif
    0xff, // No CTS pin
    0, // No CTS
    IRQ_PRIORITY, 38, 24, // IRQ, rts_low_watermark, rts_high_watermark
    XBARA1_OUT_LPUART6_TRG_INPUT    // XBar Tigger
};
HardwareSerialIMXRT Serial1(IMXRT_LPUART6_ADDRESS, &UART6_Hardware, tx_buffer1,
    SERIAL1_TX_BUFFER_SIZE, rx_buffer1, SERIAL1_RX_BUFFER_SIZE);

//void serialEvent1() __attribute__((weak));
//void serialEvent1() {Serial1.disableSerialEvents(); }        // No use calling this so disable if called...
Could Define a lot of this as data that this file HardwareSerial1.cpp and could maybe be as simplistic as:

in variants.h have:
Code:
#define SERIAL1_RX_PIN_INFO   {{0,2, &IOMUXC_LPUART6_RX_SELECT_INPUT, 1}, {0xff, 0xff, nullptr, 0}}
#define SERIAL1_TX_PIN_INFO   {{1,2, &IOMUXC_LPUART6_TX_SELECT_INPUT, 1}, {0xff, 0xff, nullptr, 0}},

And then back in HardwareSerial1.cpp check for one of these defines and use it else use current...

Or maybe could simply have a copy of the HardwareSerial1.cpp in the variant directory, with the right data, and if files in the variant directory be include first before the core library is included in the link...

But the fundamental question is, is something like this worth doing?
 
@KurtE - for a quick start that 'VARIANT looks like one usable direction.
If it fleshed out and the other T_MM, T_4.0, T_4.1 were mapped with their custom core_pins etc moved as VARIANTS then any DIY board could start with the best pin match copy and edit there rather than mucking with 21 cores files having: #elif defined(ARDUINO_TEENSY_MICROMOD)

<edit> ESP32 has 206 folders in variants

In using the NXP MCUExpresso they have on the fly 'edits' based on setting and even the evkb.LD file was a core file with #include for the custom stuff - like SDRAM reservation.
 
Last edited:
...
Made same SDRAM init/alloc changes to LittleFS_SDRAM_Simple_Datalogger
And it takes the DevBoard to MISSING ???? >>> Programs but, COLD RESTART GIVES 9 BLINKS
...
Still stuck on this - the setup is the same for both - manually checked then literally copied it over and still:
9 Blinks = ARM JTAG DAP Init ErrorThe ARM JTAG DAP was detected (4 blinks) but could not be initialized. This error is rather unlikely by hardware! However, a software crash resulting in hard fault or CPU lockup (typically very early in startup) can result in this error.
Both as LittleFS_RAM myfs; - but Logger exits setup to a menu() and with '9 Blinks' there is no printing or progress from setup() starting?
So, nothing in loop() or menu options has been selected.
Jumping back to prior mentioned SDRAM example sketches and they run with no issue - so not a cold .vs. warm restart issue.
Just did a DEBUG build and still 9 blinks so not an obvious build optimize error.
Interesting - working ListFiles built as DEBUG and it now gives 9 Blink start - return to FASTER and it runs.
Rebuild DataLogger in Faster and it is 9Blink'ing.
Only doing 10MB Alloc for RAM drive - so it is not getting more memory than on a 16MB PSRAM. And this is SDRAM DevBoard.
Are there any edits that are missed for these libraries in use? Any reason LittleFS would have hardcoded 0x8-- for PSRAM?
"T:\\T_Drive\\arduino_1.8.19_23\\hardware\\teensy/../tools/teensy_size" "T:\\TEMP\\arduino_build_807859/LittleFS_SDRAM_Simple_Datalogger.ino.elf"
Memory Usage on Teensy MicroMod:
FLASH: code:70968, data:8704, headers:8388 free for files:16427012
RAM1: variables:8608, code:65976, padding:32328 free for local variables:417376
RAM2: variables:12416 free for malloc/new:511872
"T:\\T_Drive\\arduino_1.8.19_23\\hardware\\teensy/../tools/stdout_redirect" "T:\\TEMP\\arduino_build_807859/LittleFS_SDRAM_Simple_Datalogger.ino.lst" "T:\\T_Drive\\arduino_1.8.19_23\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objdump" -d -S -C "T:\\TEMP\\arduino_build_807859/LittleFS_SDRAM_Simple_Datalogger.ino.elf"
Using library SDRAM_t4 in folder: T:\T_Drive\tCode\libraries\SDRAM_t4 (legacy)
Using library LittleFS at version 1.0.0 in folder: T:\T_Drive\arduino_1.8.19_23\hardware\teensy\avr\libraries\LittleFS
Using library SPI at version 1.0 in folder: T:\T_Drive\arduino_1.8.19_23\hardware\teensy\avr\libraries\SPI

<edit> Indeed there is LittleFS_RAM code that pays some attention to address location - looking to see what that leads to:
<edit2>: that is just for getMediaName() - nothing else odd in CLASS - and none of that code is called before it goes 'missing'/9Blink.
#if defined(__IMXRT1062__)
PROGMEM static const char ext_pn_name[] = "EXTMEM";
PROGMEM static const char dma_pn_name[] = "DMAMEM";

if ((uint32_t)config.context >= 0x70000000) return ext_pn_name;
 
Last edited:
After edits and notes to p#373 trying: T:\T_Drive\arduino_1.8.19_23\hardware\teensy\avr\libraries\LittleFS\examples\Test_Integrity\RAM\RAM.ino
> this is a PLAIN IDE 1.8.19 w TD/1.59.4 install with min CORES edit for SDRAM_t4 (including the MPU at 0x9--- in startup)
LittleFS_RAM myfs; // CAN use either RAM1 or RAM2 as available
#ifdef __IMXRT1062__ // Teensy 4.0, 4.1 and T_MicroMod
char buf[ 390 * 1024 ]; // BUFFER in RAM1
That RAN from 'global' compile alloc RAM1 buffer as FASTER: But 9 Blinks when built DEBUG!
So there is some other conflict at hand 'Under the covers' in cores effect.
Memory Usage on Teensy MicroMod:
FLASH: code:79384, data:12824, headers:9164 free for files:16413700
RAM1: variables:414176, code:74504, padding:23800 free for local variables:11808
RAM2: variables:12416 free for malloc/new:511872
"T:\\T_Drive\\arduino_1.8.19_23\\hardware\\teensy/../tools/stdout_redirect" "T:\\TEMP\\arduino_build_481583/RAM.ino.lst" "T:\\T_Drive\\arduino_1.8.19_23\\hardware\\teensy/../tools/arm/bin/arm-none-eabi-objdump" -d -S -C "T:\\TEMP\\arduino_build_481583/RAM.ino.elf"
Using library LittleFS at version 1.0.0 in folder: T:\T_Drive\arduino_1.8.19_23\hardware\teensy\avr\libraries\LittleFS
Using library SPI at version 1.0 in folder: T:\T_Drive\arduino_1.8.19_23\hardware\teensy\avr\libraries\SPI
Using library SdFat at version 2.1.2 in folder: T:\T_Drive\arduino_1.8.19_23\hardware\teensy\avr\libraries\SdFat

ODD - failed confirmation: Building for T_4.1 FASTER:: GOOD, but on T_4.1 DEBUG:: goes 'Missing' but not 9Blinks?
>> Other IDE 1.8.19 install with TD/1.59.4 has the CORES edit for FULL NATIVE SDRAM support: Same results


Ideas/confirmation welcome: Need a break - will do third IDE 1.8.19 w/TD1.59.4 install later
 
Not TD 1.59 specific! Clean 1.8.19 unzipped to two folders then 1.57 in one and 1.58 in the other have the similar behavior
> except counting 8 Blinks on TD1.57 - and 9 Blinks on 1.59.4.
> Had to go back to 1.58 : it fails to show on USB, but is not showing any Blink codes.
8 Blinks = Unknown IMXRT ChipThe IMXRT chip responded, but with an unsupported JTAG ID. This error can happen if IMXRT AD_BO_08 is not connected to MKL02 PTB5, or it is shorted to GND. Software which mis-configures pins can also cause this error.
9 Blinks = ARM JTAG DAP Init ErrorThe ARM JTAG DAP was detected (4 blinks) but could not be initialized. This error is rather unlikely by hardware! However, a software crash resulting in hard fault or CPU lockup (typically very early in startup) can result in this error.

BETA 4 of 1.59 Issue ? @PaulStoffregen
Clean unzip of Arduino IDE 1.8.19 to new folder and install TD 1.59.4.

Using example: "...\hardware\teensy\avr\libraries\LittleFS\examples\Test_Integrity\RAM\RAM.ino"

Build default FASTER and it works as expected with 1st T_4.1 below.

Build DEBUG and it goes OFFLINE/Missing after Upload.

> 1st T_4.1 LOCKED and NO BLINKS on power on
> 2nd T_4.1 pre-lockable and 9Blinks on power on.
 
Last edited:
Back
Top