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

Data log "full" marker is not being written to interface storage #406

Open
microbit-carlos opened this issue Feb 14, 2024 · 2 comments
Open

Comments

@microbit-carlos
Copy link
Collaborator

microbit-carlos commented Feb 14, 2024

Running this programme on tag v0.2.63, which writes to the data log one byte at a time until the log is full:

#include "MicroBit.h"

MicroBit uBit;

int main() {
    uBit.init();

    uBit.display.print("?");

    while (true) {
        uBit.log.logString("X");
        uBit.sleep(1);

        if (uBit.log.isFull()) {
            uBit.display.print("D");
            uBit.sleep(100);
        }
    }
}

MICROBIT.hex.zip

We should expect the last 4 bytes, which are reserved for this marker, to contain FULL:

logEnd = flash.getFlashEnd() - sizeof(uint32_t);

if (!(status & MICROBIT_LOG_STATUS_FULL))
{
cache.write(logEnd+1, "FUL", 3);
status |= MICROBIT_LOG_STATUS_FULL;
}

However, the last 4 bytes are left untouched: MY_DATA.HTM.txt

image
@jaustin
Copy link
Collaborator

jaustin commented May 7, 2024

This is odd - do you know whether the byte-by-byte case ever wrote 'log full'? Does it still work if logging longer lengths? From MakeCode?

@microbit-carlos
Copy link
Collaborator Author

It must have worked at some point, as I believe that's how the "log full" message is meant to be displayed:

I haven't tried it in MakeCode yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants