This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

BQ35100: DataFlash write issue

Part Number: BQ35100


Hello,

I'm trying to modify Operation Config A value in order to perform an EOS operation.
I successfully access the DataFlash in Unsealed and then FullAccess mode, reading in Control Status the value 0x2080. After that I successfully read the current value of Operation Config A register at 0x41b1 (default 0x80).
Now, I want to change it into 0x82 acting as follow:

  1. write(0x3e,0xb10x41)
  2. wait 1 second
  3. write(0x40,0x0082)
  4. wait 1 second
  5. write(0x60,0x008b)
  6. wait 1 second
  7. write(0x61,0x005)

At this point I have in return the following data:




My checksum and length are calculated as shown below:

uint8_t calChecksum(dfAddress address,rxBuffer dataIn,uint8_t length){
    uint8_t hNibble, lNibble;
    uint8_t checksum;

    hNibble = HI_NIBBLE(address);
    lNibble = LO_NIBBLE(address);

    checksum = hNibble + lNibble;

    checksum += dataIn[0];
    checksum += dataIn[1];

    return ~checksum;
}
dataLength = 4 + length;



Are checksum and length rigth? Can anyone explain why I get these value back?  I suspect a timing issue but I'm not sure. 

  • Vincenzo,

    In your example the checksum should be

    0x41 + 0xb1 + 0x00 + 0x82 = NOT(0x74) = 0x8B. 

    and your length should be 0x06. 

    So i would write

    (0xAA, 0x3E, [0xb1, 0x41, 0x82, 0x00])

    (0xAA, 0x60, [0x8b, 0x06])

    thanks,

    Eric Vos


  • Thanks Eric for your reply!

    I tried as you said and it works good. However, I have other few questions:

    1. How is calculated Length ? I did len = address_size + cheksum_size + lenght => 2+1+1 = 4 and then sum up the data_size, so 4+1 = 5. Clearly this is wrong but why ? Have I to consider 0x0082 as a 2 byte data ?
    2. When I read back checksum and length from addresses 0x60 and 0x61 I dont' t read what I send just before, why ? Example: send 0x8B and 0x06 and recieve 0xC8 0xC8 but operation config A value is 0x82 as I aspected.
    3. Why every time I read checksum and length they have always the same value? Do I do somenthing wrong? 

    Regards,
    Vincenzo


  • Hi,

    I find out that I read twice at 0x60, so the question n3 is done. I checked better my code and now I have 0xC8 as checksum and 0x24 as lenght but I don't understand why. 

    Regards,
    Vincenzo