any ideas what I have done wrong?
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
;[env:stable]
;platform = https://github.com/platformio/platform-teensy.git
;
;board = teensy41
;
;framework = arduino
;
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
;
platform_packages =
toolchain-gccarmnoneeabi@file:///Users/freddie/pio/teensy_1.59-beta2/toolchain-gccarmnoneeabi
framework-arduinoteensy@file:///Users/freddie/pio/teensy_1.59-beta2/framework-arduinoteensy
tool-teensy@file:///Users/freddie/pio/teensy_1.59-beta2/tool-teensy
;platform_packages =
;toolchain-gccarmnoneeabi@file:///Users/freddie/pio/teensy_1.58-beta3/toolchain-gccarmnoneeabi
;framework-arduinoteensy@file:///Users/freddie/pio/teensy_1.58-beta3/framework-arduinoteensy
;tool-teensy@file:///Users/freddie/pio/teensy_1.58-beta3/tool-teensy
;
;
build_flags =
-Wl,--print-memory-usage
-g
-D USB_MTPDISK_SERIAL
;build_type = release
;
#lib_extra_dirs = ~/Documents/Arduino/libraries
;
check_tool = cppcheck
check_flags = --enable=all
extra_scripts =
pre:version_increment_pre.py
post:version_increment_post.py
;
; PlatformIO Project Configuration File
;
; Build options: build flags, source filter
; Upload options: custom upload port, speed and extra flags
; Library options: dependencies, extra library storages
; Advanced options: extra scripting
;
; Please visit documentation for the other options and examples
; https://docs.platformio.org/page/projectconf.html
;[env:stable]
;platform = https://github.com/platformio/platform-teensy.git
;
;board = teensy41
;
;framework = arduino
;
[env:teensy41]
platform = teensy
board = teensy41
framework = arduino
;
platform_packages =
toolchain-gccarmnoneeabi@file:///Users/freddie/pio/teensy_1.59-beta2/toolchain-gccarmnoneeabi
framework-arduinoteensy@file:///Users/freddie/pio/teensy_1.59-beta2/framework-arduinoteensy
tool-teensy@file:///Users/freddie/pio/teensy_1.59-beta2/tool-teensy
;platform_packages =
;toolchain-gccarmnoneeabi@file:///Users/freddie/pio/teensy_1.58-beta3/toolchain-gccarmnoneeabi
;framework-arduinoteensy@file:///Users/freddie/pio/teensy_1.58-beta3/framework-arduinoteensy
;tool-teensy@file:///Users/freddie/pio/teensy_1.58-beta3/tool-teensy
;
;
build_flags =
-Wl,--print-memory-usage
-g
-D USB_MTPDISK_SERIAL
-std=gnu++17
-std=gnu++14
;build_type = release
;
#lib_extra_dirs = ~/Documents/Arduino/libraries
;
check_tool = cppcheck
check_flags = --enable=all
extra_scripts =
pre:version_increment_pre.py
post:version_increment_post.py
;
build_unflags = -std=gnu++14
Thanks shawn, that is good info. Do you see a chance that the PIO guys add that to the 1.59 beta platform/package or however they call it? Is there a github repo where one could open an issue?
There's errata for speculative prefetches from the CPU but that's unrelated (and I think avoided anyway, since MPU region #0 covers all unused memory).
With AHB prefetching enabled for FLEXSPI2 and the clock speed turned up to 120MHz, I'm getting 56MB/s for sequential reads which seems pretty close to the maximum possible. Need to test with DMA to see if it makes EXTMEM feasible for framebuffer memory...
...
testing with fixed pattern 00000000
test ran for 29.94 seconds
All memory tests passed :-)
...
test ran for 30.44 seconds
All memory tests passed :-)
EXTMEM Memory Test, 16 Mbyte
CCM_CBCMR=B5AE8304 (88.0 MHz)
...
test ran for 60.87 seconds
All memory tests passed :-)
void loop_ISR() {
...
do {
if (Serial.available()) {
b[ii++] = c = Serial.read();
}
[B] else
break;
[/B] } while (c != '\n');
"C:\Users\TimLabs\Documents\GitH.ub\teensy41_psram_memtest\teensy41_psram_memtest.ino"
Is there a reason prefetching is disabled for PSRAM? FLEXSPI_AHBCR_PREFETCHEN is cleared in FLEXSPI2_AHBCR in startup.c which means prefetching has no effect when enabled in the individual FLEXSPI_AHBRXBUF control registers.
If enabled I get ~50% faster sequential reads from PSRAM.
// Adjust these for amount of disk space used in iterations
#define MAXNUM 15 // Number of files : ALPHA A-Z is MAX of 26, less for fewer files
#define NUMDIRS 12 // Number of Directories to use 0 is Rootonly
#define BIGADD 2*2024 // bytes added each pass - bigger will quickly consume more space
#define SUBADD 4*512 // bytes added each pass (*times file number)
#define MAXFILL 66000 // ZERO to disable :: Prevent iterations from over filling - require this much free
[B]GAVE[/B] this after 1000 loops with 'k':
Bytes Used: 5707776, Bytes Total:8388608
Loop Count: 1001 (#fileCycle=64235), Bytes read 2118896944, written 810482800, #Files=157
Has this been tested with NOR or NAND flash on the other QSPI pads?
printDirectory QSPI_NAND
--------------
0 dirs with 0 files of Size 0 Bytes
Total 0 files of Size 0 Bytes
Bytes Used: 262144, Bytes Total:265289728
// started and quickly stopped:
[B] == == == DELETE PASS START == == == =
:: /1_dir/B_file.txt <Bad Byte! b! = a [0x61] @1
0[ 1.58 M](0.49145 M elap) Awaiting input 0123456789RdDwcghkFqvplmusSBbyYxfan+-? loops left 0 >[/B]
printDirectory QSPI_DISK
--------------
5 dirs with 0 files of Size 0 Bytes
Total 0 files of Size 0 Bytes
Bytes Used: 786432, Bytes Total:16777216
Formatting Low Level:
...............................................................................................................................
Done Formatting Low Level in 11330598 us.
Updated filecount 0
F
[ 6.48 M](0.18885 M elap) Awaiting input 0123456789RdDwcghkFqvplmusSBbyYxfan+-? loops left 0 >m
Making Root Dirs
d
printDirectory QSPI_NAND
--------------
DIR 1_dir /
0 dirs with 0 files of Size 0 Bytes
DIR 2_dir /
0 dirs with 0 files of Size 0 Bytes
DIR 3_dir /
0 dirs with 0 files of Size 0 Bytes
DIR 4_dir /
0 dirs with 0 files of Size 0 Bytes
DIR 5_dir /
0 dirs with 0 files of Size 0 Bytes
5 dirs with 0 files of Size 0 Bytes
Total 0 files of Size 0 Bytes
Bytes Used: 265289728, Bytes Total:265289728
WARNING: DISK FULL >>>>> Bytes Used: 265289728, Bytes Total:265289728
seems the issue might be doing quick reads all over and having some cycles wasted fetching data that will be flushed from the cache before it is used and reread later.
That makes sense they'd do that.In theory wasted prefetching can't negatively affect performance; any in-progress prefetching is suspended when a new AHB transaction arrives for FlexSPI.
Made this PR: github.com/PaulStoffregen/cores/pull/707
> anyone else ever notice when they get their first crash and print CrashReport it spits out a List of BreadCrumbs that were never passed to be saved?
There were TODO provisions for checksum storage to verify when BC's were saved - a simple update making short use of that checksum field helps.
What about making the checksum the inverse value of the bitmask rather than a direct copy? I think that would be a little bit safer since it's common for memory to be filled with repeated values, causing bitmask and checksum to unintentionally match.
Has this been tested with NOR or NAND flash on the other QSPI pads?
I believe LittleFS should be using only IP bus. Earlier experimental code did access flash chips by AHB. This change will probably break that old code, but maybe that's ok as we really only support Flash by LittleFS now.
[U]QSPI_NAND 4:54 PM 7/13/2023 NON-PR ## 9600[/U]
[ 18.81 M]([B]18.47611 M elap[/B]) Awaiting input 0123456789RdDwcghkFqvplmusSBbyYxfan+-? loops left 0 >
Walk all Files verify Read Size:
D1 CDEGHIJKLMNO
D2 ABCDEFGHIJKLMNO
D3 ABCDEFGHIJKLMNO
D4 ABCDEFGHIJKMNO
D5 ABCDEFGHIJKLMO
D6 CDEFGHIJKMNO
ABCDEFGHIJKLMN 0 Errors found
Bytes Used: 14680064, Bytes Total:131596288
Loop Count: 102 (#fileCycle=4025), Bytes read 174110000, written 56138384, #Files=96
[B]QSPI_NAND 3:03 PM 7/13/2023 PR 708 ## 9600[/B]
[ 20.25 M]([B]18.47911 M elap[/B]) Awaiting input 0123456789RdDwcghkFqvplmusSBbyYxfan+-? loops left 0 >
Walk all Files verify Read Size:
D1 CDEGHIJKLMNO
D2 ABCDEFGHIJKLMNO
D3 ABCDEFGHIJKLMNO
D4 ABCDEFGHIJKMNO
D5 ABCDEFGHIJKLMO
D6 CDEFGHIJKMNO
ABCDEFGHIJKLMN 0 Errors found
Bytes Used: 14680064, Bytes Total:131596288
Loop Count: 102 (#fileCycle=4025), Bytes read 174110000, written 56138384, #Files=96
[U]QSPI_DISK 4:53 PM 7/13/2023 NON-PR ## 8860[/U]
[ 16.18 M]([B]15.71656 M elap[/B]) Awaiting input 0123456789RdDwcghkFqvplmusSBbyYxfan+-? loops left 0 >
Walk all Files verify Read Size:
D1 CDEGHIJKLMNO
D2 ABCDEFGHIJKLMNO
D3 ABCDEFGHIJKLMNO
D4 ABCDEFGHIJKMNO
D5 ABCDEFGHIJKLMO
D6 CDEFGHIJKMNO
ABCDEFGHIJKLMN 0 Errors found
Bytes Used: 8912896, Bytes Total:16777216
Loop Count: 102 (#fileCycle=4025), Bytes read 174110000, written 56138384, #Files=96
[B]QSPI_DISK 3:05 PM 7/13/2023 PR 708 ## 8860[/B]
[ 16.62 M]([B]15.71530 M elap[/B]) Awaiting input 0123456789RdDwcghkFqvplmusSBbyYxfan+-? loops left 0 >
Walk all Files verify Read Size:
D1 CDEGHIJKLMNO
D2 ABCDEFGHIJKLMNO
D3 ABCDEFGHIJKLMNO
D4 ABCDEFGHIJKMNO
D5 ABCDEFGHIJKLMO
D6 CDEFGHIJKMNO
ABCDEFGHIJKLMN 0 Errors found
Bytes Used: 8912896, Bytes Total:16777216
Loop Count: 102 (#fileCycle=4025), Bytes read 174110000, written 56138384, #Files=96
LittleFS Test : File Integrity
printDirectory QSPI_DISK
// Adjust these for amount of disk space used in iterations
#define MAXNUM 15 // Number of files : ALPHA A-Z is MAX of 26, less for fewer files
#define NUMDIRS 6 // Number of Directories to use 0 is Rootonly
#define BIGADD 2*2024 // bytes added each pass - bigger will quickly consume more space
#define SUBADD 4*512 // bytes added each pass (*times file number)
#define MAXFILL 66000 // ZERO to disable :: Prevent iterations from over filling - require this much free
--------------
>> "F", NEW CODE, h
Not seen anyone else complain about errant breadcrumbs - but they have been showing and it just isn't right so that was done.
I've been aware of them, but you only see them if your program has already crashed so you know if they're relevant or not...
Something I would like to see is the breadcrumb/crashreport address dynamically calculated based on the size of the DMAMEM region, since it's possible to make it bigger than 256KB / end beyond address 0x20280000.
struct arm_fault_info_struct *info = (struct arm_fault_info_struct *)0x2027FF80;
struct crashreport_breadcrumbs_struct *bc = (struct crashreport_breadcrumbs_struct *)0x2027FFC0;