Thanks Paul. I'm using CLion with PlatformIO, so updated my platformio.ini config as follows:
Code:
board = teensy40
lib_deps =
https://github.com/PaulStoffregen/FastLED
https://github.com/PaulStoffregen/OctoWS2811
My project didn't quite build successfully with that change. For some reason the analog pin #defines (PIN_A0, PIN_A1, ...) and constants (A0, A1, ...) from pins_arduino.h were no longer being recognised in my code. I changed my code to just use the equivalent digital pin integer values directly (e.g. 26 instead of A15) and the project then built fine. Note that keeping the new FastLED and OctoWS2811 libraries, but reverting the board to teensy31, did still compile OK with the analog pins.
Thanks for the pointer regarding FLASHMEM/ITCM RAM. Building my project with teensy32 logs the following:
Code:
RAM: [== ] 21.5% (used 14108 bytes from 65536 bytes)
Flash: [==========] 98.3% (used 257796 bytes from 262144 bytes)
Building with teensy40 instead logs:
Code:
teensy_size: Memory Usage on Teensy 4.0:
teensy_size: FLASH: code:116712, data:88860, headers:8440 free for files:1817604
teensy_size: RAM1: variables:107200, code:114672, padding:16400 free for local variables:286016
teensy_size: RAM2: variables:25792 free for malloc/new:498496
Am I right in thinking that ITCM RAM is the same thing as RAM1, and is 512KB? If so I should be fine, but appreciate I might have to tag startup code etc with FLASHMEM, and maybe move some static data into RAM2 with DMAMEM if things do get tight again. [EDIT: looks like that isn't correct, I've just found https://forum.pjrc.com/threads/58863...-on-Teensy-4-0 and https://forum.pjrc.com/threads/57326...ferent-regions which explain the memory+flash layout clearly. ITCM is allocated in 32KB blocks, and some of the 512KB will need to be kept aside for DTCM]
All in all it looks like I should be able to upgrade to the 4.0 pretty easily, so I'll likely order one in the near future and give it a go.