Bug in nvmWrite()

Home Forums mDot/xDot Bug in nvmWrite()

Tagged: 

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #18517
    Mark Ruys
    Participant

    I think we got a bug in mDot::nvmWrite(). This is my code:

    
    #include "mDot.h"
    #include "xdot_eeprom.h"
    
    int main() {
        mDot *dot = mDot::getInstance();
    
        uint8_t data[1];
        data[0] = 33;
    
        if ( ! dot->nvmWrite(37, data, 1) ) {
            printf("nvmWrite() failed\r\n");
        }
    
        if ( ! dot->nvmRead(37, data, 1) ) {
            printf("nvmRead() failed\r\n");
        }
        printf("Read %d\r\n", data[0]);
    
        data[0] = 33;
        if ( xdot_eeprom_write_buf(37, data, 1) != 0 ) {
            printf("xdot_eeprom_write_buf() failed\r\n");
        }
    
        if ( ! dot->nvmWrite(37, data, 1) ) {
            printf("nvmWrite() failed\r\n");
        }
    
        while ( true ) { wait(1); }
    }
    

    This is the output:

    
    nvmWrite() failed
    Read 32
    

    I expected 33 and no failure.

    Work around is to use xdot_eeprom_write_buf() which works okay.

    mbed-os 5.4.2 (139), libxDot-mbed5 2.0.17-mbed139

    #18518
    Mark Ruys
    Participant

    I’m sorry, it appeared to be a hardware issue after all. No bug.

    Mark

Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.