Git Product home page Git Product logo

dueflashstorage's People

Contributors

panamajoecu avatar per1234 avatar rmcolbert avatar sebnil avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

dueflashstorage's Issues

Where ends my virtual EEPROM? Where starts my sketch?

Hi everybody,

 now in my project I want to store lots of configuration data, and my sketch iv very big.

So...I am very scared....because I don't know if my configuration overwrite the code or if the code overwrite configuration data.

Are there struments to check it?!?

Thanks

Type 'Efc' could not be resolved

Greetings,

I try use this library in Eclipse/Sloeber, and show this error:

Type 'Efc' could not be resolved

For any function use it, like this:
uint32_t efc_init(Efc *p_efc, uint32_t ul_access_mode, uint32_t ul_fws);

How solve this?

Best regards

flash write error

I use a slightly modified version of your lib for years and I faced a strange problem. If there is a longer period between writes (10+ days) then the writes will be unsuccessful until system reset. Have you experienced similar problem ever?

Can't read or write float values on the adress specified

Hello, I'm using an arduino due with due board version 1.6.12 and an IDE arduino 1.8.12.

My code is the following:

`
#include <DueFlashStorage.h>
DueFlashStorage dueFlashStorage;

void setup() {
Serial.begin(9600);

}

void loop() {

float aModif = dueFlashStorage.read(0);
Serial.print("aModif =");Serial.println(aModif);
aModif=aModif + 0.1 ;
dueFlashStorage.write(0,aModif);
delay(1000);

}

`
I have the following results on serial:
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00
aModif =255.00

My question is, how can I read or write an increment of 0.1 in the specified adress ?

Thanks in advance.

Writing a pointer returned by a function to (char*) struct member causes junk value after resetting the board.

//void setup(){
//Same as in original example script.
}
void loop(){
  /* read configuration struct from flash */
  byte* b = dueFlashStorage.readAddress(4); // byte array which is read from flash at adress 4
  Configuration configurationFromFlash; // create a temporary struct
  memcpy(&configurationFromFlash, b, sizeof(Configuration)); // copy byte array to temporary struct


char string[]="Name=Marcus&greeting=goodmorning";
char* Name=parsePostData("Name",string); // See function below.


Serial.print(" message:");
  Serial.print(configurationFromFlash.message);

configurationFromFlash.message = Name;//This is causing problems in Case 1 inside below function.

// write configuration struct to flash at adress 4
  byte b2[sizeof(Configuration)]; // create byte array to store the struct
  memcpy(b2, &configurationFromFlash, sizeof(Configuration)); // copy the struct to the byte array
  dueFlashStorage.write(4, b2, sizeof(Configuration)); // write byte array to flash

}



char* parsePostData(char s[],char t[])
{
  char *pch;
  char *pp="Marcus";

  char tCpy[512];//Make a copy. Otherwise, strtok works on the char pointer, and original char array gets modified/ corrupted.
  strcpy(tCpy,t);
  pch = strtok (tCpy,"=&");
  while (pch != NULL)
  {
      if(strcmp(pch,s)==0) {
            pch= strtok (NULL, "&"); 
            //**Case 1. what I need. but it is causing issues 
            //after I write to flash, and restart the board.**
            //return pch;   
           return stdup(pch);

            //Case 2. Forced test case. works perfect.   Even after board is reset, values are correct.       
            //return pp;


      }else{
        pch = strtok (NULL, "=&");  
      }
  }

}```

Adding the DueFlashStorage library affects the results of my code

I have some code to read monitor the energy usage in my home, similar to that of Emonlib.

Without the DueFlashStorage the code works as expected. However, as soon as I add the following lines to my code, the measurement results of my code change:
#include <DueFlashStorage.h>
DueFlashStorage dueFlashStorage;

How is it possible that only addding these 2 lines of code can affect the output results? Where can I start looking?
Kind regards,
Gerard.

Attempting to move FLASH_START_ADDR to 0xA0000 causes hang on flash_write()

Great library! A real project-enabler. However, I am facing one issue.

I have a project where my sketch is currently using about 90KB, and I need 384KB of writable flash.

I verified via assembly output that my sketch is only being written to flash address range 0x80000-0x9ffff. I attempted to enable DueFlashStorage to write to address range $a0000-$fffff by changing FLASH_START to point to $a0000, and changing the validations in DueFlashStorage::write accordingly. I have verified that the pointer is correct at runtime.

When attempting to run in this configuration, the Due hangs on the call to flash_write(). I did take a look at flash_write(), but nothing immediately jumped out at me as being amiss. Can you please take a look?

Crash on writing struct as byte array

For control reasons, I've set the constant FLASH_START to 0 (I calculate where I want to write with the right offsets). Needed to update the "address too high check" too.

However, when I call write(), it simply waits and does nothing after that. Possible crash?

Please tag the current commit as v1.0

The Adruino library manager needs the master branch to be tagged so it can add it to the list. I have submitted the request to have it monitor the repository.

Where to safely store one byte of data?

Hi, first of all thanks a lot for this great library!
I have read #7, and thanks to the instructions there, I found out that my sketch which consumes approx. 65% of flash memory, goes way beyond 0xC0000 which you said is the place where data gets stored by default in your library.
I have three questions:

  1. Why did you use 0xC0000 and not something like 0xFF000 which should almost never be occupied?
  2. How can I tell the write function to start writing from a different offset?
  3. (and probably most important for me) Is there a way I can 'reserve' flash memory by for example putting an unused string in flash and use that to store my data?

All I need is just one byte, but that one byte could still destroy my code, so I have to make sure it works even if the code is continuing to grow (which it will).

Thanks a lot again for your great work!

licensing

Hi, the code does not clearly states the license, except for atmel code that is something like mit + atmel hardware only clause

FlashPage error while uploading the new code to arduino due.

Hi,

I am not sure if I am raising an issue here would help me. However, the issue is bit serious and related to flash memory in Arduino Due. If you think this is not related to the DueFlashStorage libray, I will remove this from this page.

I am facing a serious problem with Arduino due. In my application, I am using this library to save some data to flash memory as Arduino due has no EEPROM. I am using this library to save the data. Once I program the board, it works good. But when I change something in my code and try to upload I am facing "Flash page locked" error message and it could not load the program to the board. There is no particular pattern that I can explain here when this issue occur. Sometimes, I upload the program 5 - 6 time, then this issue comes, or sometime in the second attempt it happened. Once this issue occur, the program can not be loaded to the board. I tried by pressing the erase button and then reset, but it did not help. The standard Bilnk Led program also does not work. It gives same error flash page locked. After this I have to do nothing but change the board. Till now, I have broken six board.
Please let me know if you can help me here.

I am using following memory locations in flash to save the data.

const short saveIntoEEPROMAddress = 196;
const short firstIrrStrtAddress = 200;
const short motorStatusAddress = 92; // save the motor states. 0=; 1=left, 2=right, 3=cutback
const short currIrrStartAdd = 100;
const short controllerSuspendAddr = 96; // Location on EEPROM for surgeSuspended variable
const short totalDataAddress = 300;
const short totalDataPerEventAddress = 305;
const short numOfEventsCompAddress = 310;
const short lastEventTimeAddress = 315;
const short totalTimeAddress = 320;

I am facing following error while uploading blink program.

Please take a look on following link to know more about issue.
arduino/ArduinoCore-sam#45

Regards,
Prash

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.