Teensyduino 1.55 Beta #1

Status
Not open for further replies.
Yes, ESP can do anything - with the PC in charge of programming - can write to Flash independent of programming for sure.

Before setup() - means USB isn't online yet - unless waited for ...
Does not hurt to wait 2 secs more _only_ if that lib is #included..

Some custom TeensyTransfer type interface could be evolved as well perhaps that used std USB_Serial without adding the other overhead. Maybe a binary transfer using DUAL serial port - where PC code could own that port for transfers?
Hm, that would mean to be restricted to dual serial usb. No audio..? Mtp? Midi..?

Maybe, we can just use HID.

I can help with that. As long It's not at my github, and nobody asks me for support, for several years.
"TeensyTransfer" was meant to live for some weeks or months... not more ... the code was hacked together in a few hours.. :) (and the code quality isn't that good..)
I had countless mails....I don't feel like to do that again and create a new "xyztransfer".
 
Last edited:
Could somebody refresh my memory - are files suppose to persist across restarts with PSRAM?????
 
I could be completely wrong, but PSRAM my gut says that the memory does not persist between power cycles... Now as per between reboots while still powered up... Maybe... But again could be totally out to lunch...

As for other options:
Here is a quick and dirty version of your program above that I converted to use the PROGRAM version for 512KB... But then I added MTP:
Code:
/*
  LittleFS  datalogger
 
 This example shows how to log data from three analog sensors
 to an storage device such as a FLASH.
 
 This example code is in the public domain.
 */
#include <LittleFS.h>
#include <MTP.h>

// LittleFS supports creating file systems (FS) in multiple memory types.  Depending on the 
// memory type you want to use you would uncomment one of the following constructors

LittleFS_Program myfs;  // Used to create FS on QSPI NAND flash chips located on the bottom of the T4.1 such as the W25N01G. for the full list of supported NAND flash see  https://github.com/PaulStoffregen/LittleFS#nand-flash

File dataFile;  // Specifes that dataFile is of File type

int record_count = 0;
bool write_data = false;
static const uint32_t file_system_size = 1024 * 512;

// Add in MTPD objects
MTPStorage_SD storage;
MTPD       mtpd(&storage);


void setup()
{

  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    // wait for serial port to connect.
  }

  Serial.print("Initializing LittleFS ...");

  // see if the Flash is present and can be initialized:
  if (!myfs.begin(file_system_size)) {
    Serial.printf("Error starting %s\n", "QSPI FLASH");
    while (1) {
      // Error, so don't do anything more - stay stuck here
    }
  }
  storage.addFilesystem(myfs, "Program");
  
  
  Serial.println("LittleFS initialized.");
  
  menu();
  
}

void loop()
{ 
  if ( Serial.available() ) {
    char rr;
    rr = Serial.read();
    if (rr == 'l') listFiles();
    if (rr == 'e') eraseFiles();
    if (rr == 's') {
      Serial.println("\nLogging Data!!!");
      write_data = true;   // sets flag to continue to write data until new command is received
      // opens a file or creates a file if not present,  FILE_WRITE will append data to 
      // to the file created.
      dataFile = myfs.open("datalog.txt", FILE_WRITE);
      logData();
    }
    if (rr == 'x') stopLogging();
    if (rr == 'd') dumpLog();
    if (rr == 'h') menu();
  } 
  else mtpd.loop();

  if(write_data) logData();
}

void logData()
{
    // make a string for assembling the data to log:
    String dataString = "";
  
    // read three sensors and append to the string:
    for (int analogPin = 0; analogPin < 3; analogPin++) {
      int sensor = analogRead(analogPin);
      dataString += String(sensor);
      if (analogPin < 2) {
        dataString += ",";
      }
    }
  
    // if the file is available, write to it:
    if (dataFile) {
      dataFile.println(dataString);
      // print to the serial port too:
      Serial.println(dataString);
      record_count += 1;
    } else {
      // if the file isn't open, pop up an error:
      Serial.println("error opening datalog.txt");
    }
    delay(100); // run at a reasonable not-too-fast speed for testing
}

void stopLogging()
{
  Serial.println("\nStopped Logging Data!!!");
  write_data = false;
  // Closes the data file.
  dataFile.close();
  Serial.printf("Records written = %d\n", record_count);
}


void dumpLog()
{
  Serial.println("\nDumping Log!!!");
  // open the file.
  dataFile = myfs.open("datalog.txt");

  // if the file is available, write to it:
  if (dataFile) {
    while (dataFile.available()) {
      Serial.write(dataFile.read());
    }
    dataFile.close();
  }  
  // if the file isn't open, pop up an error:
  else {
    Serial.println("error opening datalog.txt");
  } 
}

void menu()
{
  Serial.println();
  Serial.println("Menu Options:");
  Serial.println("\tl - List files on disk");
  Serial.println("\te - Erase files on disk");
  Serial.println("\ts - Start Logging data (Restarting logger will append records to existing log)");
  Serial.println("\tx - Stop Logging data");
  Serial.println("\td - Dump Log");
  Serial.println("\th - Menu");
  Serial.println();
}

void listFiles()
{
  Serial.print("\n Space Used = ");
  Serial.println(myfs.usedSize());
  Serial.print("Filesystem Size = ");
  Serial.println(myfs.totalSize());

  printDirectory(myfs);
}

void eraseFiles()
{
  myfs.quickFormat();  // performs a quick format of the created di
  Serial.println("\nFiles erased !");
}

void printDirectory(FS &fs) {
  Serial.println("Directory\n---------");
  printDirectory(fs.open("/"), 0);
  Serial.println();
}

void printDirectory(File dir, int numSpaces) {
   while(true) {
     File entry = dir.openNextFile();
     if (! entry) {
       //Serial.println("** no more files **");
       break;
     }
     printSpaces(numSpaces);
     Serial.print(entry.name());
     if (entry.isDirectory()) {
       Serial.println("/");
       printDirectory(entry, numSpaces+2);
     } else {
       // files have sizes, directories do not
       printSpaces(36 - numSpaces - strlen(entry.name()));
       Serial.print("  ");
       Serial.println(entry.size(), DEC);
     }
     entry.close();
   }
}

void printSpaces(int num) {
  for (int i=0; i < num; i++) {
    Serial.print(" ");
  }
}

I may need to look at some places that I see MTP debug output.

Problems with this is:
a) Currently MTP does not install with Teensyduino. Could put in comments on where to get.
b) Currently MTP in USB types shows experimental and only with Serial emulation. Should add the Real serial as option.
c) Wish list. I do wish we had a simple select N USB options ala-cart. As I can see at times maybe my Teensy connected up to SBC acting as maybe joystick and/or keyboard plus I may want to be able to plug into PC and download some logs or the like... (Sorry beyond scope of this)

Kurt
 
From the pure theory, I see no reason why it shouldn't persist. May be wrong..
But as far as I remember, there is no initialization which influences the PSRAM contents. And I see no reason why it should delete something.
 
Code:
uint32_t pulseIn_high(uint8_t pin, uint32_t timeout)
{
    const struct digital_pin_bitband_and_config_table_struct *p;
    p = digital_pin_to_info_PGM + pin;

    uint32_t usec_start, usec_stop;

    // wait for any previous pulse to end
    usec_start = micros();
    while ((*(p->reg + 2) & p->mask)) {
        if (micros()-usec_start > timeout) return 0;
    }
    // wait for the pulse to start
    usec_start = micros();
    while (!(*(p->reg + 2) & p->mask)) {
        if (micros()-usec_start > timeout) return 0;
    }
    usec_start = micros();
    // wait for the pulse to stop
    while ((*(p->reg + 2) & p->mask)) {
        if (micros()-usec_start > timeout) return 0;
    }
    usec_stop = micros();
    return usec_stop - usec_start;
}

Hm this can end in having three times the timeout.. is that desired?
A fix would be to remove the usec_start = micros(); lines, keeping only the first...
 
Hm it has not much to do with the description on their website:
Parameters

pin: the number of the Arduino pin on which you want to read the pulse. Allowed data types: int.
value: type of pulse to read: either HIGH or LOW. Allowed data types: int.
timeout (optional): the number of microseconds to wait for the pulse to start; default is one second. Allowed data types: unsigned long.


BUT: I saw, the Arduino has the same code - Any Ideas what we can do?
No I'm not opening an issue somewhere @Arduino, as it will be ignored anyway ;) (There is a higher chance to get the docs fixed if you tell it the pope..)

But today we had a user with a misunderstanding of the timeout - and indeed it is very counterintuitive.
Ending with (worst case) 3x the timout is very bad.. and normally, it is a hefty bug. But again, fixing it makes Teensy incompatible.

For the record only:
This: "Returns: The length of the pulse (in microseconds) or 0 if no pulse started before the timeout" is not 100% correct, too. Ok, a bit nit-picking...
 
Last edited:
I could be completely wrong, but PSRAM my gut says that the memory does not persist between power cycles... Now as per between reboots while still powered up... Maybe... But again could be totally out to lunch...
...

RAM as RAM2/DMAMEM and PSRAM persist across Uploads and Warm - power maintained - Restarts/Resets. On loss of power PSRAM and RAM2 are 'lost'.

They are checked for existing FORMAT in place and not zeroed/reformatted if the header info suggests it is valid LFS media.
 
I thought about it. I tend to fix the code to do what the user expects and is most intuitive: A timeout for everything. If the whole routine is not finished after the timeout time, abort. With a comment in the sourcecode.
@Paul would you accept that?
(it also makes the code shorter ;)
 
RAM as RAM2/DMAMEM and PSRAM persist across Uploads and Warm - power maintained - Restarts/Resets. On loss of power PSRAM and RAM2 are 'lost'.

They are checked for existing FORMAT in place and not zeroed/reformatted if the header info suggests it is valid LFS media.

Tim - Kurt - Frank
I agree - there shouldn't be a reason why PSRAM and/or DMAMEM should not persist per past testing. But while testing the logger sketches the files were not persisting. As a check I used the Integrity sketches for those areas and files did not persist????

Could someone double check on there system?
 
I could be completely wrong, but PSRAM my gut says that the memory does not persist between power cycles... Now as per between reboots while still powered up... Maybe... But again could be totally out to lunch...

As for other options:
Here is a quick and dirty version of your program above that I converted to use the PROGRAM version for 512KB... But then I added MTP:
.....

I may need to look at some places that I see MTP debug output.

Problems with this is:
a) Currently MTP does not install with Teensyduino. Could put in comments on where to get.
b) Currently MTP in USB types shows experimental and only with Serial emulation. Should add the Real serial as option.
c) Wish list. I do wish we had a simple select N USB options ala-cart. As I can see at times maybe my Teensy connected up to SBC acting as maybe joystick and/or keyboard plus I may want to be able to plug into PC and download some logs or the like... (Sorry beyond scope of this)

Kurt

Yeah MTP definitely works with T4 so you can access LittleFS from the PC. But as if I remember right MTP/MSC still needed some updates that you made that I don't know were ever incorporated.

PS. Since you brought using PROGRAM for the datalogger I added this to my simple test case more so you could remember:
Code:
  // see if the Flash is present and can be initialized:
  // lets check to see if the T4 is setup for security first
  #if ARDUINO_TEENSY40
    if ((IOMUXC_GPR_GPR11 & 0x100) == 0x100) {
      //if security is active max disk size is 960x1024
      if(PROG_FLASH_SIZE > 960*1024){
        diskSize = 960*1024;
        Serial.printf("Security Enables defaulted to %u bytes\n", diskSize);  
      } else {
        diskSize = PROG_FLASH_SIZE;
        Serial.printf("Security Not Enabled using %u bytes\n", diskSize);
      }
    }
  #else
    diskSize = PROG_FLASH_SIZE;
  #endif

  if (!myfs.begin(diskSize)) {
    Serial.printf("Error starting %s\n", "PROGRAM FLASH DISK");
    while (1) {
      // Error, so don't do anything more - stay stuck here
    }
  }
 
Tim - Kurt - Frank
I agree - there shouldn't be a reason why PSRAM and/or DMAMEM should not persist per past testing. But while testing the logger sketches the files were not persisting. As a check I used the Integrity sketches for those areas and files did not persist????

Could someone double check on there system?

I've seen CrashReport work - that uses DMAMEM/RAM2 persistence ... I can test more in a bit with LFS and PSRAM ... but that is a T_4.1 ... and power up the RAM for DMAMEM ...
 
I've seen CrashReport work - that uses DMAMEM/RAM2 persistence ... I can test more in a bit with LFS and PSRAM ... but that is a T_4.1 ... and power up the RAM for DMAMEM ...

Yeah I know its a T4.1 but need to figure out if its me or an issue with beta1?
 
Yeah I know its a T4.1 but need to figure out if its me or an issue with beta1?

Okay ... back home ... The note about T_4.1 was mind shifting gears 'reminder to self' to change the board when I came back ...

Using IDE 1.8.15 w/TD 1.55-beta1

With T_4.1 and LittleFS/Integrity/PSRAM.ino :: WORKS - as expected PSRAM 8 MB holds value - for all 8MB. [ has 2nd QSPI 16 Flash in place ]
> Stable across Button Reprogram
> Stable across IDE Upload with TLoader
> Stable across 'R' restart from USB CMD

And T_4.0 change to RAM.ino :: w/RAM2 ... DMAMEM char buf[ 490 * 1024 ];
> Erased across Button Reprogram
> Erased across IDE Upload with TLoader
> Erased across 'R' restart from USB CMD


Not sure if this is a cores changes - loss of a late change to TD 1.54 ... or a side effect of New Bootloader?
 
Looks like this change NOT lost: github.com/PaulStoffregen/LittleFS/commit/...
Code:
		// memset(ptr, 0xFF, size); // always start with blank slate
...
		if (lfs_mount(&lfs, &config) < 0) {
			memset(ptr, 0xFF, size); // always start with blank slate
			if (lfs_format(&lfs, &config) < 0) return false;
			//Serial.println("formatted");
			if (lfs_mount(&lfs, &config) < 0) return false;
		}
...

Not seeing any added OVERT wipe of DMAMEM :: memory_clear();

@Paul did something for HAB change to cause a flush of RAM2? I have seen CrashReport() work - but something is taking out usable RAM2 Flash drive? ... see p#189
 
Looks like this change NOT lost: github.com/PaulStoffregen/LittleFS/commit/...
...

Not seeing any added OVERT wipe of DMAMEM :: memory_clear();

@Paul did something for HAB change to cause a flush of RAM2? I have seen CrashReport() work - but something is taking out usable RAM2 Flash drive? ... see p#189

Returned to TD 1.54 install - it is not preserving DMAMEM LFS_RAM_DISK either now? <both t_4.0 and 4.1

?? Linked code in LittleFS.h looks as expected and tested ??? Not sure I went back to test later?

RAM2 size is right and the libs from TD 1.54 ? :: DMAMEM char buf[ 390 * 1024 ];
Code:
teensy_size: Memory Usage on Teensy 4.0:
teensy_size:   FLASH: code:77296, data:9928, headers:9028   free for files:1935364
teensy_size:    RAM1: variables:21184, code:72536, padding:25768   free for local variables:404800
teensy_size:    [B]RAM2: variables:411744  free for malloc/new:112544[/B]
Using library LittleFS at version 1.0.0 in folder: [B]T:\arduino-1.8.15\hardware\teensy\avr\libraries\LittleFS[/B] 
Using library SPI at version 1.0 in folder: T:\arduino-1.8.15\hardware\teensy\avr\libraries\SPI 
Using library SdFat at version 2.0.5-beta.1 in folder: T:\arduino-1.8.15\hardware\teensy\avr\libraries\SdFat
 
Okay ... back home ... The note about T_4.1 was mind shifting gears 'reminder to self' to change the board when I came back ...

Using IDE 1.8.15 w/TD 1.55-beta1

With T_4.1 and LittleFS/Integrity/PSRAM.ino :: WORKS - as expected PSRAM 8 MB holds value - for all 8MB. [ has 2nd QSPI 16 Flash in place ]
> Stable across Button Reprogram
> Stable across IDE Upload with TLoader
> Stable across 'R' restart from USB CMD

And T_4.0 change to RAM.ino :: w/RAM2 ... DMAMEM char buf[ 490 * 1024 ];
> Erased across Button Reprogram
> Erased across IDE Upload with TLoader
> Erased across 'R' restart from USB CMD


Not sure if this is a cores changes - loss of a late change to TD 1.54 ... or a side effect of New Bootloader?

Tim thanks for checking.

I repeated your steps for PSRAM with IDE 1.8.15-beta1 and this is what I am seeing with only 8MB of RAM installed on a T4.1.
Code:
> [U]Stable [/U]across Button Reprogram
> [U]Stable [/U]across IDE Upload with IDE
> [U]Stable [/U]across 'R' restart from USB CMD
Confirmed PSRAM retains files

Cycling the power FAILS to retain FS. Note this is what is suppose to happen. So would say that works. Must have been dreaming during initial tests yesterday. Have

Also retested RAM2 .... DMAMEM char buf[ 390 * 1024 ]

For a T4.1:
> Stable across Button Reprogram
> Stable across IDE Upload with IDE
> Stable across 'R' restart from USB CMD

For the locked T4.0 confirmed files are not persistent across Restarts
> Erased across Button Reprogram
> Erased across IDE Upload with IDE
> Erased across 'R' restart from USB CMD

For a Production T4. Something Strange
> Created BigFile
Code:
Start Big write of 177920 Bytes..
Big write /0_bigfile.txt took  0.03 Sec for 176128 Bytes : file3.size()=176128
	Big write KBytes per second 6535.36 

Bytes Used: 185088, Bytes Total:399360

> Did a 'D' for directory and got this.
Code:
Walk all Files verify Read Size:	
0	D1 
	D2 
	D3 
	D4 
	0 Errors found

Bytes Used: 185088, Bytes Total:399360

	 Loop Count: 2 (#fileCycle=0), Bytes read 0, written 0, #Files=1
	dirV...241_us	[  0.43 M](0.00110 M elap)
Repeated with power cycle as well.

Repeated Tested on a brand new T4 with the same results.
 
@PaulStoffregen and alcon

Just ran into a another very strange issue using the Locked T4. Last sketch I ran was Tim's Integrity RAM sketch testing the DMAMEM issue. Went to test another sketch and the Locked T4 caused me to loose USB so I had to restart the computer to get it back. This is the sketch that caused me the initial problem:
Code:
/*
  LittleFS usuage from the LittleFS library
  
  Starting with Teensyduino 1.54, support for LittleFS has been added.

  LittleFS is a wrapper for the LittleFS File System for the Teensy family of microprocessors and provides support for RAM Disks, NOR and NAND Flash chips, and FRAM chips. For the NOR, NAND Flash support is provided for SPI and QSPI in the case of the Teensy 4.1. For FRAM only SPI is supported. It is also linked to SDFat so many of the same commands can be used as for an SD Card.
  
  This example shows the use of some of the commands provided in LittleFS using a SPI Flash chip such as the W25Q128. 
  
  See the readme for the LittleFS library for more information: https://github.com/PaulStoffregen/LittleFS
  
*/

#include <LittleFS.h>


// Some variables for later use
uint64_t fTot, totSize1;

// To use SPI flash we need to create a instance of the library telling it to use SPI flash.
/* Other options include:
  LittleFS_QSPIFlash myfs;
  LittleFS_Program myfs;
  LittleFS_SPIFlash myfs;
  LittleFS_SPIFram myfs;
  LittleFS_SPINAND myfs;
  LittleFS_QPINAND myfs;
  LittleFS_RAM myfs;
*/
LittleFS_SPIFlash myfs;

// Since we are using SPI we need to tell the library what the chip select pin
//  #define chipSelect 6  // use for access flash on audio or prop shield
#define chipSelect 7

// Specifies that the file, file1 and file3 are File types, same as you would do for creating files
// on a SD Card
File file, file1, file3;


void setup()
{
  // Open serial communications and wait for port to open:
  Serial.begin(115200);
  while (!Serial) {
    // wait for serial port to connect.
  }
  Serial.println("\n" __FILE__ " " __DATE__ " " __TIME__);

  Serial.print("Initializing LittleFS ...");

  // see if the Flash is present and can be initialized:
  // Note:  SPI is default so if you are using SPI and not SPI for instance
  //        you can just specify myfs.begin(chipSelect). 
  if (!myfs.begin(chipSelect, SPI)) {
    Serial.printf("Error starting %s\n", "SPI FLASH");
    while (1) {
      // Error, so don't do anything more - stay stuck here
    }
  }
  Serial.println("LittleFS initialized.");

  myfs.quickFormat();
  
  // To get the current space used and Filesystem size
  Serial.print("\n Space Used = ");
  Serial.println(myfs.usedSize());
  Serial.print("Filesystem Size = ");
  Serial.println(myfs.totalSize());
  
  // Now lets create a file and write some data.  Note: basically the same usage for 
  // creating and writing to a file using SD library.
  char someData[2048];
  memset( someData, 'z', 2048 );
  file = myfs.open("bigfile.txt  ", FILE_WRITE);
  file.write(someData, sizeof(someData));

  for (uint16_t j = 0; j < 100; j++)
    file.write(someData, sizeof(someData));
  file.close();
  
  // We can also get the size of the file just created.  Note we have to open and 
  // thes close the file unless we do file size before we close it in the previous step
  file = myfs.open("bigfile.txt  ", FILE_WRITE);
  Serial.printf("File Size of bigfile.txt (bytes): %u\n", file.size());
  file.close();

  // Now that we initialized the FS and created a file lets print the directory.
  // Note:  Since we are going to be doing print directory and getting disk usuage
  // lets make it a function which can be copied and used in your own sketches.
  listFiles();
  delay(2000);
  
  // Now lets rename the file
  myfs.rename("bigfile.txt", "file10.txt");
  delay(5);
  listFiles();
  delay(2000);
  
  // To delete the file
  myfs.remove("file10.txt");
  delay(5);
  listFiles();
  delay(2000);
  
}

void loop() {}

void listFiles()
{
  printDirectory(myfs);
  Serial.print("\n Space Used = ");
  Serial.println(myfs.usedSize());
  Serial.print("Filesystem Size = ");
  Serial.println(myfs.totalSize());
}

void printDirectory(FS &fs) {
  Serial.println("Directory\n---------");
  printDirectory(fs.open("/"), 0);
  Serial.println();
}

void printDirectory(File dir, int numSpaces) {
   while(true) {
     File entry = dir.openNextFile();
     if (! entry) {
       //Serial.println("** no more files **");
       break;
     }
     printSpaces(numSpaces);
     Serial.print(entry.name());
     if (entry.isDirectory()) {
       Serial.println("/");
       printDirectory(entry, numSpaces+2);
     } else {
       // files have sizes, directories do not
       printSpaces(36 - numSpaces - strlen(entry.name()));
       Serial.print("  ");
       Serial.println(entry.size(), DEC);
     }
     entry.close();
   }
}

void printSpaces(int num) {
  for (int i=0; i < num; i++) {
    Serial.print(" ");
  }
}
.

I restarted the PC and tried loading BLINK and it failed to load and causesthe Ports menu to be grayed out. Didn;t loose USB this time since I didn't try to load the sketch until after I powered up the Locked T4. Heard the beep but did not load and hangs the loader. Held the PGM button down to do a 15s restore (yes I know it will fail) but it does allow the prior program to run. Last program running is the DMA
MEM integrity sketch. Here is the log file if you want to take a look:
View attachment log.txt

EDIT: PROBLEM SOLVED Issue with Powered USB hub and serial communications.
 
Last edited:
@mjs513 - Not sure who user alcon is ;)

But I downloaded your sketch and reprogrammed my locked chip twice with it... Don't have it setup with anything hooked up to pin 7...
Code:
C:\Users\kurte\Documents\Arduino\bar\bar.ino Aug 21 2021 07:43:55
Initializing LittleFS ...Error starting SPI FLASH
 
@mjs513 - Not sure who user alcon is ;)

But I downloaded your sketch and reprogrammed my locked chip twice with it... Don't have it setup with anything hooked up to pin 7...
Code:
C:\Users\kurte\Documents\Arduino\bar\bar.ino Aug 21 2021 07:43:55
Initializing LittleFS ...Error starting SPI FLASH

Thanks for checking - not sure what happened - do have the key in the Arduino directory that I have been using. And that sketch runs fine on the T4.1.
 
Opps:: - too much cryptic spew ...

The 'D' only prints the FIRST letter of any FILE - so :
Walk all Files verify Read Size:
0 D1

does indicate the presence of :: FILE 0_bigfile.txt 176128
That is 'outside' a directory 'D' of '1_dir' showing again only first char '1'
 
@alcon ;) - I ran the RAM version of simple logger and confirm that there are some issues when you reset the program...
When I ran it and reset (easier in TyCommander). then did the L command which showed the log file, then did a D
and got garbage... Sometimes this garbage was bad enough it kill TyCommander.... Dito for Serial Monitor.

Going to try a few random tests, with KISS and see if we notice anything...
 
Something Very Odd! Enabled the .begin() prints for 'format' and 'mount' in LittleFS.h _RAM - and added one on start. Also the static_sync where the cache flush is done.

It is NOT doing a Format - so 'mount' sees valid header data. And after "B" create the disk looks right - but doing "R" then:
Code:
LittleFS Test : File Integrity

[U]... begin() [/U]

[U]... mounted [/U]
printDirectory RAM_DISK
--------------
[B]FILE	0_bigfile.txt		227328[/B]
DIR	1_dir / 
...
 4 dirs with 1 files of Size 227328 Bytes
 Total 1 files of Size 227328 Bytes
[B]Bytes Used: 501760, Bytes Total:501760[/B]


	WARNING: DISK FULL >>>>>  Bytes Used: 501760, Bytes Total:501760
 
@alcon ;) - I ran the RAM version of simple logger and confirm that there are some issues when you reset the program...
When I ran it and reset (easier in TyCommander). then did the L command which showed the log file, then did a D
and got garbage... Sometimes this garbage was bad enough it kill TyCommander.... Dito for Serial Monitor.

Going to try a few random tests, with KISS and see if we notice anything...

Yes, something not seen before is happening? May have been missed - but this is obvious?

When "B" bigfile was created the cache flushed, Wondering if that flushed the file and DIR updates - but some other 'FS' housekeeping element is not making it to 'media' with a static_sync() flush?
Code:
Start Big write of 229120 Bytes    arm_dcache_flush_delete: ptr=0x20200000, size=501760
..    arm_dcache_flush_delete: ptr=0x20200000, size=501760
    arm_dcache_flush_delete: ptr=0x20200000, size=501760

Big write /0_bigfile.txt took  0.03 Sec for 227328 Bytes : file3.size()=227328
	Big write KBytes per second 6561.45
 
Status
Not open for further replies.
Back
Top