Picture showing PSRAM, maybe should instead of 8192-16384K should maybe be: 0 or 8192 or 16384 to maybe stress that by default, unless the user (or resales) has added a chip or two on bottom, than this area will not exist...
Done.
Picture shows extmem_malloc, what happens if I call this and I don't have any PSRAM? What happens to my EXTMEM variables if I don't have any EXTMEM?
In the text, under Dynamic Allocation -> External Heap it says "When no PSRAM is present, extmem_malloc() automatically allocated memory from the normal heap in RAM2."
Can EXTMEM variables be initialized?
Nope. I'd added words "These variables can not be initialized, your program must write their initial values, if needed."
RAM1 (DTCM/ITCM) - Not sure again how to mention, but ITCM grows in 32KB chunks, so if code is 32KB+1b it takes 64KB...
Other that the "FASTRUN Unused" in the picture, this is one of many details I'm considering to be too small to list on this top-level page.
RAM2 is optimized for access by DMA? - Sorry I never really understood this. Maybe might need to expand on this.
I've added "Normally large arrays & data buffers are placed in RAM2, to save the ultra-fast RAM1 for normal variables."
For example if you use this area of memory for DMA, you then need to know about the memory caching and probably to explain the need for calls like:
....
Again maybe there is a need for a page on DMA?
Yes, a page specifically about DMA is needed for those sorts of details.
This top-level page has main goals. In order of importance:
1: Show Teensy 4.1's many capabilities. Moreso than any other page, this is the sales pitch.
2: Provide links to the detailed interior pages (at least the ones which exist so far). We've all seen this come up over and over on this forum, where someone has a question about something like serial port capability which is answered on the serial page, but they didn't ever find that page. The 2nd highest priority is not to document everything here, but to mention it in a way people can find and discover the links to pages with the detailed info.
3: Answer some of the most common questions (before they're even questions) by highlighting certain features.
4: Reference material. While this is the least of 4 goals, quite a bit of reference material is going on the page. I've been trying to keep most of it in the last "Technical Information" section and mostly include things which are images rather than lots of text to read.
Detailed info about DMA and cache management is so far beyond the scope of this top level page. It really needs a dedicated page inside the site.
As for malloc, versus ext_malloc and maybe dtcm_malloc()... Again it is nice to have this ability. At times it would be nice to have a unified allocate/free setup, but...
Right now I'm focusing on documentation. So yeah, I probably should have asked on the other thread about website updates.
Indeed a unified malloc() which automatically manages all 3 memories would be pretty awesome. So would DMA tutorials, serial NAND bad block management, seemless transition between audio play objects, massive multi-channel audio in/out, USB video & webcam support, releasing the bootloader chips, supporting encrypted & authenticated code, WebUSB, better API for USB host detection of USB device connect & disconnect, a high-performance alternative to LittleFS, the installer detecting & warning for library override conflicts, a non-blank back side of the Teensy 4.1 card, and a ton of other stuff.
My general plan is to leave malloc() and extmem_malloc() as they are, so I can focus on other stuff. There are only so many hours in every day (and sadly, a lot less for me until we can rehire after the pandemic social distancing requirement ease up). Messing with malloc again just isn't on my dev time priority list.
But if you or Luni or anyone else writes a good library for dynamic allocation of DTCM / ITCM, I'll be happy to give it a brief mention and link from the Teensy 4.0 & 4.1 pages.