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.

Compiler/BQ78350-R1: BQ78350-R1

Part Number: BQ78350-R1
Other Parts Discussed in Thread: BQSTUDIO

Tool/software: TI C/C++ Compiler

Hello,

i need to write the Data Flash Access () 0x406F

this is the example on page 118 of bq78350-r1 datasheet:

Write to DF example:
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 SMBus block write with command = 0x44
block = starting address + DF data block
= 0x00 + 0x40 + data1_LowByte + data1_HighByte + data2_LowByte + data2_HighByte

when I simulari make for the 0X406F(Manufacturer Name) , I have some thing like that :

data1 = *abcdefghij1234567890"

To update data1 , send a SMBus block write with command = 0x44block = starting address + DF data block
= 0x6F + 0x40 + data1

ist is ok?

tis data1 is suose too stay in the  register 0x406F ?

But when i read this adress like describe in the datasheet , i become the default Manufacturer Name : "Texas
Instruments"

Read from DF example:
Taking the same assuming from the read DF example, to read DF,
a. Send SMBus write block with command 0x44, block = 0x00 + 0x40
b. Send SMBus read block with command 0x44
The returned block
= a starting address + 32 bytes of DF dat
= 0x00 + 0x40 + data1_LowByte + data1_HighByte + data2_LowByte + data2_HighByte.... data32_LowByte +
data32_HighByte

for my code:

a. Send SMBus write block with command 0x44, block = 0x6F + 0x40
b. Send SMBus read block with command 0x44
The returned block
= a starting address + 21 bytes of DF dat
= 0x6F + 0x40 + data1.

Please I am wrong?

  • Hi Arnaud,
    I think the issue is the block length required for block transfers.
    Determine whether you send the length as a separate variable or part of the block. Assuming you put the length in the block your command should probably be:
    a. Send SMBus write block with command 0x44, block = 0x02 + 0x6F + 0x40

    You can see an example with the "Advanced Comm SMB" tab. It formats the block length into decimal so it is more readable but not as clear as to what is on the bus. This is with the default value:
    2018-08-01 11:43:44 217 , 17 , Wr Block , 44 , 2 , 6F 40 , Success
    2018-08-01 11:43:46 828 , 17 , Rd Block , 44 , 34 , 6F 40 11 54 65 78 61 73 20 49 6E 73 74 72 75 6D 65 6E 74 73 20 20 20 07 62 71 37 38 33 35 30 20 20 20 , Success
  • Hello,


    I always had used the length of the bytes, mm for other order. I just wrote in my message going through what is in the IT document.
    What is the procedure for writing. what I mentioned above taking into account the length is true? You just give me the procedure to read(Write/Read), I would like to change the name by default that means , only write an another name.

    Thanks again for your reaction, which is always spontaneous and helps me.

  • Hello,
    I have always used the length of the bytes, even for other commands. I just wrote in my message going through what is in the TI document.
    What is the procedure for writing. what I mentioned above taking into account the length is true? You just give me the procedure to read(Write/Read), I would like to change the name by default. That means , only write an another name.

    Thanks again for your reaction, which is always spontaneous and helps me.

    data1 = *abcdefghij1234567890"

    To update data1 , send a SMBus block write with command = 0x44
    block = length+starting address + DF data block
    = 0x21+0x6F + 0x40 + data1

    ist is ok?
  • Hi Arnaud,
    Your data1 byte count seems to be 20, 10 letter characters and 10 number characters, each of those a byte.
    The command is 2 bytes, so you should have 22 bytes. 22 would be 0x16.
    But there is another aspect. The thing you are writing, Manufacturer Name, is a SBS data string which is defined as a maximum of 32 bytes with the first byte being the number of relevant bytes which follow. So if your name is 20 characters long the length byte is 20 or 0x14. You have 21 bytes to send. Your data flash address adds 2 more bytes so the block command length is 23 or 0x17

    To write to the manufacturer name with 10 characters "abcdefghij" I send (all hex):
    44 0D 6F 40 0A 61 62 63 64 65 66 67 68 69 6A

    In the Advanced Comm SMB display with its mixed decimal and hex field displays it looks like:
    2018-08-03 10:25:09 773 , 17 , Wr Block , 44 , 2 , 6F 40 , Success
    2018-08-03 10:25:11 844 , 17 , Rd Block , 44 , 34 , 6F 40 11 54 65 78 61 73 20 49 6E 73 74 72 75 6D 65 6E 74 73 20 20 20 07 62 71 37 38 33 35 30 20 20 20 , Success
    2018-08-03 10:25:36 491 , 17 , Wr Block , 44 , 13 , 6F 40 0A 61 62 63 64 65 66 67 68 69 6A , Success
    2018-08-03 10:25:38 703 , 17 , Rd Block , 44 , 34 , 6F 40 0A 61 62 63 64 65 66 67 68 69 6A 72 75 6D 65 6E 74 73 20 20 20 07 62 71 37 38 33 35 30 20 20 20 , Success
    Notice the read shows the residual characters from the old name in the data. You could pad the field with spaces on your write if desired, but the length tells an SBS data tool how many of the characters to use, so bqStudio displays abcdefghij