Developer

Help wanted - new logging code

Hi all,I'd like to fix or replace the current logging code in Arducopter. It works but can fail in some circumstances which I can't repeat or predict.We need to keep the current messages and but can replace the logic for log management.If you are interested, please have a look at the code and let me know.Thanks!Jason

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Jason,

     

    There is a problem in start_new_log function in Log.pde.

    When num_existing_logs equals 0, after erasing log for example, the second if is end_pages[num_existing_logs - 1] which is end_pages[- 1] which is impossible or in C somewhere in the memory out of the end_pages array and then the value is unexpected.

    I just experiment this 

    erasing logs

    reboot in flying mode

    num_existing_logs = 0

    end_pages[num_existing_logs - 1] = 6146

    no log created !

     

    At least one should modify the if with :


    if(num_existing_logs==0 || ((end_pages[num_existing_logs - 1] < 4095) && (num_existing_logs < MAX_NUM_LOGS /*50*/))) {


    Don't know if this will fix all the log problems but should contribute to.

     

    Olivier.

  • Jason,

     

    I looked at the code briefly last night and I think I can help - at least look for what is happening. When you say "fail" do you mean a corrupted log/no log recorded, or are there dropped samples or corrupted samples.  I haven't noticed any log issues to speak of in my short testing over the last week, but I'm interested in looking at the timing of the eeprom writes with respect to the high rate loop and any other timing issues with my logic analyzer and adding some bit blips as outputs to the code to watch while the log is writing.

     

    Heino

This reply was deleted.

Activity