But that is using up memory space and bandwidth for a framebuffer. If the display was connected to the SEMC the CPU could write directly to the display's memory. All you would have to do is put values in RAM and the corresponding pixels would appear on the screen, no SDRAM even required.I have a library that supports 8080 for the ili948x
Uses FlexIO and DMA. So it has no cpu hold up.
You can use that with the camera
Decided to hold off on that for now... Did lay out quick and dirty semi-shield for the Sparkfun ATP boardQuick update on the MicroMod board update, that I am not sure yet if I will order yet or not...
startup.c
4MB of no cache memory in SDRAM, at the end of the stackSCB_MPU_RBAR = 0x81C00000 | REGION(i++); // SMEC: SDRAM, NO CACHE, Starts from 0x81C00000 aka at 28MB
SCB_MPU_RASR = MEM_NOCACHE | READWRITE | NOEXEC | SIZE_4M;
Is this something you would be willing to add to cores in the next release of TD?
Or perhaps make configure_cache WEAK so that it can be overridden by the user to add the no cache region?
My guess is it might be a while before he might pull in a simple change such as you propose...I'm currently working on improvements to Teensy Loader to properly handle more than 1 Teensy. So please understand I probably won't make time for quite a while to review pull requests for new features or anything that isn't an immediate problem.
Forget to ask/mention in previous post. When you said before each buffer write: not sure what you meant here.While for the most of it, it "worked", I could see that there was a caching issue and I was getting artifacts on the screen, even though was was flushing the cache before each buffer write.
LCDIF_NEXT_BUF
register to point to the next frame the eLCDIF needs to push out.arm_decache_flush_delete
after the frame is rendered and just before I set the eLCDIF LCDIF_NEXT_BUF
registerIs this something you would be willing to add to cores in the next release of TD?
Let's first make an effort to add it in the SDRAM_t4 library. Maybe disable interrupts, turn off the cache, add that extra region, then turn the caches back on.
uint32_t setNoCacheRegion(uint8_t size)
If Paul suggests that, it would be worth a try to emulate the needed parts of that config function to add that new non-cache region.@mjs513 @defragster think we could do this?
Perhaps we can add a function to the class such asuint32_t setNoCacheRegion(uint8_t size)
Based on the size (we can use a struct to set values) we can return the calculated base address for the non cached region start
Size options would be 1M, 2M, 4M, 8M, 16M, 32M
I went back to the eLCDIF application notes and also had a look at the L1 cache application notes and both mentioned the the eLCDIF (and PXP) need a no cache region of SDRAM, and this is the reason why the EVK board has 2MB of no cache SDRAM - for the LCD and PXP.
As I mentioned, I tried to flush the cache but it had no affect at all.Does the hardware truly need this? Or is it really just the driver code NXP publishes lacks cache flushing?
Always recommended to use non-cacheable regions for DMA buffers. The software can use the MPU to configure a non-cacheable memory region to use as a shared buffer between the CPU and DMA. For example:
• The frame buffer for eLCDIF display
• The input and output buffer for PXP channel
I don't think that's always accurate, especially for non-sequential writes - tile / character based rendering for example, would greatly benefit from writes to separate lines being collected in the cache before being flushed to RAM.Working without cache attention seems called for and beneficial. And only reads suffer with cache not covering that region that is only used for writes? Posted twice the note from NXP reads go to ~1/4 speed without cache - writes drop 1 MB/sec from 323 to 322 by their measure.
Interesting - that case in use here would be easy to test.I don't think that's always accurate, especially for non-sequential writes - tile / character based rendering for example, would greatly benefit from writes to separate lines being collected in the cache before being flushed to RAM.
I did not actually.@Rezo - did you try the Speed scan on the no cap devboard? Ran again here with twin 6.8's and 240 MHz working without any of 5 ReReads showing problems. Without a CAP it seems 206 was generally testing well - not that OC is desired - but if testing it to work allows other parts to work as some prior post suggested 166 didn't keep up with something?
Posted this just now: https://github.com/mjs513/SDRAM_t4/tree/main/examples/OneScanCapI did not actually.
Which sketch should I run?
Test results 57 tests with 5 ReReads:
At 133 MHz in 157 seconds with 0 read errors
At 166 MHz in 142 seconds with 0 read errors
At 196 MHz in 132 seconds with 0 read errors
At 206 MHz in 130 seconds with 0 read errors
At 216 MHz in 128 seconds with 0 read errors
At 227 MHz in 125 seconds with 0 read errors
At 240 MHz in 123 seconds with 0 read errors
At 254 MHz in 121 seconds with 378902 read errors (0.0158%)
At 270 MHz in 119 seconds with 1249975738 read errors (52.2838%)
SDRAM One Scan CAP test Complete {v1.1}
Test results 57 tests with 5 ReReads:
At 166 MHz in 142 seconds with 0 read errors
At 196 MHz in 132 seconds with 0 read errors
At 206 MHz in 130 seconds with 0 read errors
At 216 MHz in 128 seconds with 2284 read errors (0.0001%)
At 227 MHz in 125 seconds with 18768902 read errors (0.7851%)
At 240 MHz in 123 seconds with 442376913 read errors (18.5037%)
At 254 MHz in 121 seconds with 1964872408 read errors (82.1863%)
At 270 MHz in 119 seconds with 1971314664 read errors (82.4558%)
SDRAM One Scan CAP test Complete {v1.1}
Nice, as expected no cap seems to work up to 206 MHz - based on prior runs by one or more others, and here.Test with no cap
Test summary: 57 tests with 5 ReReads at F_CPU_ACTUAL 600 Mhz:
At 133 MHz in 160 seconds with 0 read errors
At 166 MHz in 145 seconds with 0 read errors
At 196 MHz in 136 seconds with 0 read errors
At 206 MHz in 133 seconds with 0 read errors
At 216 MHz in 132 seconds with 0 read errors
At 227 MHz in 128 seconds with 0 read errors
At 240 MHz in 127 seconds with 0 read errors
At 254 MHz in 124 seconds with 1010230 read errors (0.0423%)
At 270 MHz in 122 seconds with 1269880817 read errors (53.1163%)
SDRAM One Scan CAP test Complete {v1.2} :Note tested CAP here pF= 13.6 w/2*6.8
SUCCESS sdram.init() Default config runs in about 15 minutes.
Progress:: '#'=fixed, '.'=PsuedoRand patterns: when no Errors other wise first pass with error a-z or A-Z
If built with DUAL Serial second SerMon will show details.
Compile Time:: C:\Users\TimLabs\Documents\GitHub\EVKB_1060\examples\OneScanCap\OneScanCap.ino Feb 21 2024 14:40:57
SDRAM Memory Test, 32 Mbyte F_CPU_ACTUAL 600 Mhz begin@ 80000000 end@ 82000000
Start 57 tests with 5 reads 132.92 MHz ... wait::#############............................................
Test result: 0 read errors (0.0000%)
Extra info: ran for 160.12 seconds at 133 MHz
Start 57 tests with 5 reads 166.15 MHz ... wait::#############............................................
Test result: 0 read errors (0.0000%)
Extra info: ran for 145.09 seconds at 166 MHz
Start 57 tests with 5 reads 196.36 MHz ... wait::#############............................................
Test result: 0 read errors (0.0000%)
Extra info: ran for 136.64 seconds at 196 MHz
Start 57 tests with 5 reads 205.71 MHz ... wait::#############............................................
Test result: 0 read errors (0.0000%)
Extra info: ran for 133.74 seconds at 206 MHz
Start 57 tests with 5 reads 216.00 MHz ... wait::#############............................................
Test result: 0 read errors (0.0000%)
Extra info: ran for 132.02 seconds at 216 MHz
Start 57 tests with 5 reads 227.37 MHz ... wait::#############............................................
Test result: 0 read errors (0.0000%)
Extra info: ran for 128.45 seconds at 227 MHz
Start 57 tests with 5 reads 240.00 MHz ... wait::#############............................................
Test result: 0 read errors (0.0000%)
Extra info: ran for 127.59 seconds at 240 MHz
Start 57 tests with 5 reads 254.12 MHz ... wait::#a###a####a##AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Test result: 1010230 read errors (0.0423%)
Extra info: ran for 124.31 seconds at 254 MHz
Start 57 tests with 5 reads 270.00 MHz ... wait::aaa##a#a#aaa#AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
Test result: 1269880817 read errors (53.1163%)
Extra info: ran for 122.39 seconds at 270 MHz
Test summary: 57 tests with 5 ReReads at F_CPU_ACTUAL 600 Mhz:
At 133 MHz in 160 seconds with 0 read errors
At 166 MHz in 145 seconds with 0 read errors
At 196 MHz in 136 seconds with 0 read errors
At 206 MHz in 133 seconds with 0 read errors
At 216 MHz in 132 seconds with 0 read errors
At 227 MHz in 128 seconds with 0 read errors
At 240 MHz in 127 seconds with 0 read errors
At 254 MHz in 124 seconds with 1010230 read errors (0.0423%)
At 270 MHz in 122 seconds with 1269880817 read errors (53.1163%)
SDRAM One Scan CAP test Complete {v1.2} :Note tested CAP here pF=
Start 57 tests with 5 reads 132.92 MHz ... wait::##########CrashReport:
A problem occurred at (system time) 18:41:47
Code was executing from address 0x2A2
CFSR: 400
(IMPRECISERR) Data bus error but address not related to instruction
Temperature inside the chip was 50.55 °C
Startup CPU clock speed is 720MHz
Reboot was caused by auto reboot after fault or bad interrupt detected
if (CrashReport) {
Serial.print(CrashReport);
delay(10);
while (1) asm ("wfi");
}
Test summary: 57 tests with 5 ReReads at F_CPU_ACTUAL 528 Mhz:
At 133 MHz in 171 seconds with 0 read errors
At 166 MHz in 157 seconds with 0 read errors
At 196 MHz in 147 seconds with 0 read errors
At 206 MHz in 145 seconds with 0 read errors
At 216 MHz in 143 seconds with 0 read errors
At 227 MHz in 141 seconds with 0 read errors
At 240 MHz in 138 seconds with 0 read errors
At 254 MHz in 136 seconds with 1177852 read errors (0.0493%)
At 270 MHz in 134 seconds with 1201202286 read errors (50.2437%)
SDRAM One Scan CAP test Complete {v1.2} :Note tested CAP here pF=13.6
SDRAM Memory Test, 32 Mbyte F_CPU_ACTUAL 816 Mhz begin@ 80000000 end@ 82000000
Start 57 tests with 5 reads 132.92 MHz ... wait::#####CrashReport:
A problem occurred at (system time) 19:19:56
Code was executing from address 0x25FC
CFSR: 82
(DACCVIOL) Data Access Violation
(MMARVALID) Accessed Address: 0x2000288C (Stack problem)
Check for stack overflows, array bounds, etc.
Temperature inside the chip was 51.22 °C
Startup CPU clock speed is 816MHz
Reboot was caused by auto reboot after fault or bad interrupt detected
if (CrashReport) {
Serial.print(CrashReport);
Serial.print("Any Key to continue ...");
delay(50);
while (1) {
if ( Serial.available() ) break;
asm ("wfi");
}
while ( Serial.available() ) {
Serial.print((char)Serial.read());
}
}
Extra info: ran for 146.39 seconds at 133 MHz // {.vs. 160 sec}
...
Extra info: ran for 131.55 seconds at 166 MHz // {.vs. 145 sec}
...
Extra info: ran for 121.96 seconds at 196 MHz // {.vs. 136 sec}
...
Extra info: ran for 119.91 seconds at 206 MHz // {.vs. 133 sec}
Test summary: 57 tests with 5 ReReads at F_CPU_ACTUAL 396 Mhz:
At 133 MHz in 200 seconds with 0 read errors
At 166 MHz in 185 seconds with 0 read errors
At 196 MHz in 177 seconds with 0 read errors
At 206 MHz in 174 seconds with 0 read errors
At 216 MHz in 172 seconds with 0 read errors
At 227 MHz in 170 seconds with 0 read errors
At 240 MHz in 167 seconds with 0 read errors
At 254 MHz in 165 seconds with 458026 read errors (0.0192%)
At 270 MHz in 163 seconds with 1080675058 read errors (45.2023%)
SDRAM One Scan CAP test Complete {v1.3} :Note tested CAP here pF=13.6