Lesept
Reaction score
2

Latest activity Postings About

    • Lesept
      I narrowed the search and changed the loop : int chunks = 32760; for (int i = 0; i < 30; ++i) { chunks += 1; Serial.printf("chunks = %d\n", chunks); readthefile(chunks, last); } This shows that the problem happens with blocks of...
    • Lesept
      Sorry, there was a mistake in the function. Here is the correct one : void readthefile(int chunks, float last) { chrono = 0; File file2 = myfs.open("onnx__Conv_110.h", FILE_READ); if (file2) { // file2.readBytes((char*)data, N * 4)...
    • Lesept
      And here is a code with the loop over the number of bytes read in the file. It should crash inside the loop... /* Test LittleFS write, read */ #include <LittleFS.h> LittleFS_QPINAND myfs; // QSPI NAND Flash attached to SPI #include...
    • Lesept
      Hi, sorry for my late reply. Here is a code that read the file parts by parts. /* Test LittleFS write, read */ #include <LittleFS.h> LittleFS_QPINAND myfs; // QSPI NAND Flash attached to SPI #include "onnx__Conv_110.h" const int total =...
    • Lesept
      Thanks for your answers, but we don't know if it's a bug or just a problem related to PSRAM or Flash chips. I understand that it's not easy to reproduce, because it requires a Teensy with additional PSRAM and Flash. So could anyone try to...
    • Lesept
      That's what I did in message number 45, but it seems to freeze for large values of N (or arrayLen). Please read message 45 as it seems you answer to message 42...
    • Lesept
      Yes I have tested the PSRAM using this program So this means that the speed could be increased as well?
    • Lesept
      Yes, sorry for the confusion, this is just a test code, I'm learning to use the external Flash. Thanks a lot, this is exactly what I was looking for! I wouldn't have thought about this alone... However, it seems not robust. It works for low...
    • Lesept
      Here is what I did to read the file: if (file2) { Serial.println(1); // to trace execution char *databytes = (char*) extmem_malloc(4 * N); Serial.println(2); file2.readBytes(databytes, 4 * N); // freeze if N = total (921600)...
    • Lesept
      Thanks, I did this in post 26. Oh, you mean that the PSRAM and the additional Flash use the same SPI bus? If the free PSRAM memory is larger than twice the size of the float array, then I can dynamically assign a temporary buffer and use it to...
    • Lesept
      file2.readBytes( data, total*4 ); That's what I tried in the first place, but readBytes requires a byte array and data is a float array. So I'd need a very large bytes buffer array (size 4*total bytes) to store the content of the file, and then...
    • Lesept
      Thanks a lot, that's what I was looking for. I changed the code and it's much simpler and faster. /* Test LittleFS write, read */ #include <LittleFS.h> LittleFS_QPINAND myfs; // QSPI NAND Flash attached to SPI #include "onnx__Conv_110.h"...
    • Lesept
      Sorry, I don't understand what you mean. If I understand well, the dataFile.println writes the values as ASCII code using (in my case) 8 digits after the dot. When I read the data again from the file, it seems also to read it as ASCII...
    • Lesept
      First: I changed to EXTMEM and it works perfectly, reading 300 000 float data in 1760 ms, and more than 5 seconds for the whole 900 000 data array. What I want to do: port a neural network (NN) onto the Teensy. The network can be quite large and...
    • Lesept
      Oups, I mixed EXTMEM and DMAMEM !!!! My fault. Yes, I'm just testing, but obviously in the end I'll load the entire array. This array is generated by another program and is in the form of an .h file that I can #include. But I can also transform...
    • Lesept
      Thanks to all your explanation, I finally understood how all this works! Now I have a code that compiles and can create a file to store a large array, and read it afterwards. /* Test LittleFS write, read */ #include <LittleFS.h>...
    • Lesept
      Thanks, I'l have a look tomorrow.
    • Lesept
      It seems that the problem comes from dataFile.close(); when writing the file. This instruction alone takes almost 7 seconds. I don't think I ever wrote 256 MB in the Flash memory, to saturate it somehow. But it's as if the multiple tests I did...
    • Lesept
      Now I have a new problem, I really don't understand what is going on... Here is the code: /* Test LittleFS write, read */ #include <LittleFS.h> LittleFS_QPINAND myfs; //Specifies to use an QSPI NAND Flash attached to SPI #include...
    • Lesept
      I tried the code, and it works. I have changed it a bit: /* Test LittleFS write, read */ #include <LittleFS.h> LittleFS_QPINAND myfs; //Specifies to use an QSPI NAND Flash attached to SPI // const int chipSelect = 4; #include...
    • Lesept
      Thanks to both of you for your answers. @mjs513 : I'll try this when I'm back at work. However, it seems to me that reading a float number as an list of ascii values then transforming it to float (if I understand well atof) is a waste of time...
    • Lesept
      Hi I am now trying to use the LittleFS library, to copy very large arrays to the NAND Flash memory. My understanding is that I create a "file" in the NAND Flash and write the array in it. I wrote a small test code but I can't read the float...
    • Lesept
      Sorry, I don't understand. Does it mean I have 8 or 16MB PSRAM? This piece of code: // Check for PSRAM chip(s) installed uint8_t size = external_psram_size; Serial.printf("PSRAM Memory Size = %d Mbyte\n", size); prints 8 MB.
    • Lesept
      Yes, but I bought it at Protosupplies: https://protosupplies.com/product/teensy-4-1-fully-loaded-for-prototyping-system/ Edit: After double thinking about what you said, I went back to the prosupplies site and read this...
    • Lesept
      Sorry about that, and thanks for your help. It fixes the problem indeed, but there is still another error message...
    • Lesept
      I did my best to reduce the size and complexity of the code while keeping the error. You can find a smaller program here. Please tell me if you can donwload it and if it gives the same error I get...
    • Lesept
      Thanks for your answers. I have tried but no improvement. Not easy, I'll try...
    • Lesept
      Actually, input and output cannot be const as they are changed during the execution. I changed my code like this: // Memory block #include "..\include\parameters\onnx__Conv_95.h" #include "..\include\parameters\onnx__Conv_98.h" #include...
    • Lesept
      Thanks Paul. Should I do the same for EXTMEM and DMAMEM? EXTMEM const float input[131072]; DMAMEM const float input2[32768]; EXTMEM const float output[131072]; DMAMEM const float weightsRAM2[73728]; EXTMEM const float weightsPSRAM[921600]...
    • Lesept
      Hi I have a Teensy 4.1 with 8MB PSRAM and 256 MB Flash. I have a large code that uses large arrays declared in .h files. I try to manage the storage between RAM1 & 2, PSRAM and Flash, depending on their size. For example, the file...
    • Lesept
      No, because I don't know how to use them.
    • Lesept
      Thanks for the answer. Using these functions enables a great speed gain, so it would be worth the effort of using the latest versions. How can I do this?
    • Lesept
      Just a remark. I see on the CMSIS link provided above that the arm_dot_prod_f32 is defined with const arguments: void arm_dot_prod_f32 (const float32_t *pSrcA, const float32_t *pSrcB, uint32_t blockSize, float32_t *result) When I use it and...
    • Lesept
      Thanks for your answers. I understand now better how to use the header files and optimize the memory usage. Here what I do : all remarks and suggestions are welcome. My objective is to save as much memoray as I can and increase speed also...
    • Lesept
      Thanks Paul. My initial array definition is in a .h file. Is it the same? Do I add PROGMEM as well?
    • Lesept
      Do you mean that I should remove the static keyword? float weights[1234] = { 1.0, 2.0, ... ... ... };
    • Lesept
      Great, thanks a lot, I'll have a look! EDIT: It's not really simple... :(
    • Lesept
      Is there a way to compute the unused number of bytes in each memory block (I mean RAM1, RAM2, PSRAM, Flash) ?
    • Lesept
      Thanks a lot for your help. Happy new year !
    • Lesept
      Lesept reacted to thebigg's post in the thread Can arrays in DMAMEM be initialized? with Like Like.
      #include <Arduino.h> or #include <avr/pgmspace.h>
    • Lesept
      So the code snippet proposed in post 10 is correct? Sometimes, at compilation, I get an error such as: "DMAMEM is not known" or "EXTMEM is not known". Do I need to #include something before using DMAMEM or EXTMEM ?
    • Lesept
      Actually, this is my first time using DMAMEM and EXTMEM on a Teensy 4.1 I have large arrays whose values are defined in .h files, for example: static float weights[1234] = { 1.0, 2.0, ... ... ... }; To put this array into RAM2, I understand that...
    • Lesept
      Thanks, is it worth the effort in terms of execution time reduction?
    • Lesept
      Hi, sorry to dig this message from the past, but is this still true, or did you find a solution? My question is: can we initialize arrays defined as DMAMEM and EXTMEM?
  • Loading…
  • Loading…
Back
Top