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.

BQ28Z610: Data Flash Access Issues

Part Number: BQ28Z610
Other Parts Discussed in Thread: BQSTUDIO, EV2400

 
We have completed a learning cycle on the BQ28Z. Everything I've read indicates that the new parameters should be written to data flash. I am using the reference manuals section 12.2.45 (included below) but am unable to affect any values in the dataflash. I am able to read them without issues. I am monitoring the I2C traffic and it is as described in the reference manual. What's going on?

    
12.2.45 Data Flash Access() 0x4000–0x5FFF

Accessing data flash (DF) is only supported by the AltManufacturerAccess() by addressing the physical
address.

To write to the DF, send the starting address, followed by the DF data block. The DF data block is the
intended revised DF data to be updated to DF. The size of the DF data block ranges from 1 byte to 32
bytes. All individual data must be sent in Little Endian.

I2C Commands
Assuming: data1 locates at address 0x4000 and data2 locates at address 0x4002.
Both data1 and data2 are U2 type.
To update data1 and data2, send a block write with command = 0x3E
block = starting address + DF data block
      = 0x00 + 0x40 + data1_LowByte + data1_HighByte + data2_LowByte + data2_HighByte

  • Hi Daniel,

    How did you initially set the flash parameters before you ran the learning cycle? Are you using the EV2400 and bqStudio to communicate with the device?

    A couple of things to check: Some device registers can only be modified with the device is Unsealed. Verify the device is unsealed. There is also a Flash Update Ok Voltage that will prevent writing to data flash if the voltage is not high enough. Make sure this value is set to the right level and that the voltage is high enough to allow flash writes.

    Best regards,
    Matt
  • Thanks for the quick reply! The team working on the learning cycle was using BQStudio and the EVK. However, I am now trying to write those parameters to flash on a production board where the BQ28Z can only be access via the microcontroller I2C.

    I'm reading 0x0203 from the Manufacturing Access register which seems to indicate the Security Mode is "Reserved" is this a valid state?

    How would I unseal the device?
  • Daniel,

    The best place to check if the device is sealed is the Operation Status A register (SEC1,SEC0 bits).
    Since the team working on the learning cycle was able to write the flash with BQStudio, I would recommend first playing around with the BQStudio 'Advanced I2C Comm' window to make sure the I2C commands are working before you try with a microcontroller. Using this tool, you can get familiar with the way the commands are structured and the checksum for writing to data flash. Here is a link to a previous thread that goes through the process with an example: e2e.ti.com/.../2336247

    Matt
  • I found operation status (no 'A' though) at 0x0054. Is that the correct one? Reading 4 bytes from that returns 0x06 0x01 0x00 0x00. I assume that's all little endian so really its 0x00000106.

    That seems to indicate bits 9-8 (SEC1, SEC2) are (0,1) ie full access, and bits 14-13 (also SEC1, SEC2) are (0,0) ie reserved. Does this make sense?

    In the meantime I'll follow the attached and work with the test team to see if we can write to the I2C there and reproduce the results via the host IC.
  • Operation Status (0x0054) is the correct place to read the SEC bits. Bits 9-8 are showing that you do have full access. 

    Hope you are able to get I2C working okay with the example!

    Matt

  • Okay it's finally working. I think TI should revise their documents since the described procedure in 12.2.45 is simply incorrect.

    For anyone else struggling with write to data flash here is the procedure:

    1. Write to 0x3E ( AltManufacturingAccess) the MAC address (little endian) followed by the data to write ( Note: Minimum data is 1 and maximum is 32 )
    2. Write to 0x60 ( MacDataChecksum ) the checksum calculated as per below
    3. Write to 0x61 ( MacDataLength ) the total number of bytes written including the MAC address, data bytes, checksum, and MACDataLength itself
    4. Read back from MAC address to verify (Write address to read to 0x3E and read back desired number of bytes)

    Special condition: If writing in chunks of 32 bytes step 1, 2, and 3 can be combined into a single write since the addresses mentioned above are contiguous. For example if writing all data to 0x3E the MAC address will write to 0x3E and 0x3F, the 32 bytes of data will fill 0x40-0x5F and the checksum and data length will flow into 0x60 and 0x61.

    Standard procedure example (Write [0x1, 0x2, 0x3, 0x4] to MAC address 0x4700 ):

    [ Start (W) ] 0x3E 0x00 0x47 0x01 0x02 0x03 0x04 [ Stop ]

    [ Start (W) ] 0x60 0xAE 0x08 [ Stop ]

    [ Start (W) ] 0x3E 0x00 0x47 [ Start (R) ] ( read number of bytes ) [ Stop ]

    Special Condition Example ( Write 32 bytes to 0x4700 ):

    [ Start (W) ] 0x3E 0x00 0x47 0xB4 0x2A 0x00 0x00 0x00 0x00 0x02 0x13 0x6D 0x02 0xBF 0x47 0xC1 0x47 0x65 0x01 0x02 0x92 0x6D 0x02 0xC2 0x47 0xC4 0x47 0x66 0x01 0x04 0x12 0x6D 0x02 0xC5 0x47 0xD3 0x24 [ Stop ]

    [ Start (W) ] 0x3E 0x00 0x47 [ Start (R) ] ( read 32 bytes ) [ Stop ]

    0x3E= 0x00

    0x3F = 0x47

    0x40-0x5F = 0xB4-0x47

    0x60 ( Checksum ) = 0xD3

    0x61 ( Total Length) = 0x24

    Checksum Calculation:

    Checksum = 0xFF - LSB( ADDR1 + ADDR2 + D1 + D2... + Dn )