In this step we will move the framebuffer from internal to external RAM, and make sure that the framebuffer can still be transferred to the display.
This step will stress test the external RAM since the display controller has certain expectations on the transfer speed. This might result in errors. Common errors are LTDC underrun, because the bandwidth of the external RAM is not high enough, or pixel errors because the RAM is configured incorrectly and is running "out of spec".
The goal in this step is to remove the framebuffer array from internal RAM and use a framebuffer in external RAM.
Here are the verification points for this section. These are similar to the verification points when the framebuffer is in internal RAM, but should be checked again, as the speed on the external memory may influence the transmission of the framebuffer to the display.
|Framebuffer is shown||Display controller or SPI is configured and running|
|Updated framebuffer is shown||We know how to repeatedly transmit the framebuffer|
|Framerate is correct||The pixel clock and porches are configured to get the required framerate|
The following are the prerequisites for this step:
- Address of the framebuffer in the external RAM
We have these two tasks:
- Place the framebuffer in external RAM
- Setup the display controller to read from the external RAM
When the frambuffer is in external RAM, it is common practice to not allocate an array for it. You just declare a pointer to the correct address. The address in external RAM is then manually selected. It can be anywhere in the external RAM, but the start of the RAM is commonly used:
You can reuse the small test programs you created in the steps in Display Internal.
Remember to change the configuration of the LTDC Layer. Since we now have a specific address for the framebuffer, we can insert that address in CubeMX (Color Frame Buffer Start Address):
Remember to remove this line from your program and the framebuffer array:
If the LTDC Layer size was setup to only update a part of the display in step 03 (due to the amount of internal RAM), now is the time to redo that. Reconfigure the LTDC Layer such that the entire display is covered.