This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

[nRF52811]Apply calibrated data to thread chip

Hi,

From previous case, I still not fully understand how chip to retrieve the calibrated data from flash(already implemented read/write data for the interface by FDS), and its behavior in detail,

for "-r A0 -t 11,3,1100/14,11,1000/25,2,1100 -b 11,3,4 -s 1050,-4,300/970,-4,240/630,-8,320/580,-8,120 -b 14,11,4 -s 1020,-4,320/980,-4,260/620,-8,280/600,-8,220 -b 25,2,4 -s
1010,0,280/950,0,260/610,-4,300/590,-4,200" as data example, do I need to parsing each digits to meet thread chip's format for initialization? if so, how/where to get the format and its usage? 

many thanks

Parents
  • Hi Webber,

    I modified a simple example for your calibration data  flash_fds_calibdata.zip . 

    New record structure and data:

    //fds_example.h
    /* A dummy structure to save in flash. */
    typedef struct
    {
        uint32_t boot_count;
        char     data_name[16];
        char     data[300];
    } configuration_t;
    
    
    //main.c
    /* Dummy configuration data. */
    static configuration_t m_dummy_cfg =
    {
        .boot_count  = 0x0,
        .data_name = "calibration",
        .data="-r A0 -t 11,3,1100/14,11,1000/25,2,1100 -b 11,3,4 -s 1050,-4,300/970,-4,240/630,-8,320/580,-8,120 -b 14,11,4 -s 1020,-4,320/980,-4,260/620,-8,280/600,-8,220 -b 25,2,4 -s 1010,0,280/950,0,260/610,-4,300/590,-4,200",
    };

    Simple explanation about the example:

    Remember to run Erase All before programming, this will clear up flash memory. Press the reset button to restart the programe to reboot the program.

    Run the program there times, the program demo flash operation in three different ways. You will see different printouts from the serial port.

    1. First time, the program writes calibration data to flash. 

    2. Second time, the program read the calibration data from flash.

    3. Third time, the program update new calibration data to flash.

    4. After the third-time boot, the program only loads the last-updated data during reboot.

    You need to write your own function to load and parser the calibration data.

    Best regards,

    Charlie

  • Hi Charlie,

    Many thanks for clear description, I'm trying to add some function from example you provided to my code with openthread, as you know, whether we have to read/write data each time after burn new hex file or power on/off?

    thanks,

    Webber

  • Hi Webber,

    The read/write data operation depends on your application program design. My understanding of the general calibration process is: power on-> read calibration value-> calibrate data and reclibrate data-> write calibration value to flash.

    You mentioned two conditions. For the power on/off, the data in flash survive from power toggles, this is the normal reason for using flash. When you burn a new hex, if you do "erase all"first, the data in flash will be erased, otherwise, the data in flash be kept.

    Best regards,

    Charlie

Reply
  • Hi Webber,

    The read/write data operation depends on your application program design. My understanding of the general calibration process is: power on-> read calibration value-> calibrate data and reclibrate data-> write calibration value to flash.

    You mentioned two conditions. For the power on/off, the data in flash survive from power toggles, this is the normal reason for using flash. When you burn a new hex, if you do "erase all"first, the data in flash will be erased, otherwise, the data in flash be kept.

    Best regards,

    Charlie

Children
Related