Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

flash.readStr(i,Data) does not return 0 when no string is written #230

Open
Flowmikos opened this issue Dec 29, 2021 · 1 comment
Open
Assignees
Labels
bug Identifies a bug in the current version of the code
Milestone

Comments

@Flowmikos
Copy link

Flowmikos commented Dec 29, 2021

Any bug report / feature request raised here MUST be submitted according to the respective templates or they will be flagged with 'Not enough information'. No action will be taken till all the prerequisite information (according to the right template) is provided. If no information is provided for over a month after the 'Not enough information' label is applied, the issue will be closed.
For support questions (for example, tutorials on how to use the library), please use the Arduino Forums. This repository's issues are reserved for feature requests and bug reports.

Hey there! Thanks for using the SPIFlash library for Arduino. Please explain your issue in a clear and succinct manner - using code examples if required - here.


Hello, I'm working on a flight recorder for an experimental rocket.
We are using string to record data in a flash memory BUT to avoid losing data at every startup the Arduino need to send the data in the memory to an SD card.

So we know what size this string is and can select or addresses BUT cannot know how many strings will be.
The function readStr() always crash every time it reaches the limit of the datalog (known here for testing)

  for(uint32_t i=0; i<flash.getCapacity(); i=i+10){
    if(flash.readStr(i,Data)){
    delay(10);
    Serial.println(Data);
      // écriture sur la carte SD si elle est présente
      if (verif == true)
      {
        myFile = SD.open("flash.txt", FILE_WRITE);

        // if the file opened okay, write to it:
        if (myFile)
        {
          myFile.println(Data);
          // close the file:
          myFile.close();

        }
        else
        {
        // if the file didn't open, print an error:
          Serial.println("error opening flash.txt");
        }
      }
    }

Why did the function flash.readStr(i,Data) still send a "true" when no strings are placed in this address ?

Thanks for your reply.

Regard's

Florian Levray


Note 1: Make sure to add all the information needed to understand the bug so that someone can help. If any essential information is missing we'll add the 'Needs more information' label and close the issue until there is enough information.

Note 2: For support questions (for example, tutorials on how to use the library), please use the Arduino Forums. This repository's issues are reserved for feature requests and bug reports.


GitHub issue state GitHub issue title GitHub issue author GitHub issue label GitHub issue comments GitHub issue age GitHub issue last update

@Marzogh
Copy link
Owner

Marzogh commented Dec 30, 2021

Could you let me know what platform (MCU / Flash module) & OS you're using this with? Once I have the information I will get onto it right away and see if I can fix it up for you asap.

On a side note, what's your rocket meant to do? I'd love to learn a bit more about your project if you have a webpage / GitHub repo. 😄

@Marzogh Marzogh self-assigned this Dec 31, 2021
@Marzogh Marzogh added the bug Identifies a bug in the current version of the code label Dec 31, 2021
@Marzogh Marzogh added this to the v3.4.1 milestone Dec 31, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Identifies a bug in the current version of the code
Projects
None yet
Development

No branches or pull requests

2 participants