BQ34Z100EVM: Writing golden image

Part Number: BQ34Z100EVM
Other Parts Discussed in Thread: BQSTUDIO, BQ34Z100-R2, EV2400

Tool/software:

I have been trying to write software to write a golden image. I copied the c library out of the communicating with the gauge document, and wrote the appropriate functions for i2c communication. I can read and write values, but the actual flash always fails soon after unsealing. 

As a sanity check, got a brand new R2 chip, then dumped it as a golden image, and attempted to flash it to the same chip from bqstudio. This failed. It said there was no acknowledge from the device. What am I missing? There must be some other step I'm not seeing. Is there a document that explains this in detail? I'm using bqstudio 1.3.124 Build 3 11/11/2024.

Thanks

  • Hello,

    This question has been assigned and will be reviewed when possible. In the meantime please attach your .gg and/or .log files associated with this project.

    Thank you,
    Alan

  • Hi,

    You are trying to flash the bq.fs or the .srec?

    Regards,

    Diego

  • I tried both and had the same result.

  • Hi,

    The .srec is encrypted so this wont work flashing over a regular MCU. You should flash the bq.fs.

    If you get a no acknowledge meant from the device, this is a NAK.

    This documentation should help: Gauge Communication

    Regards,

    Diego

  • I have read that guide many times and I am using the code from the library at the end of it. Please help me understand why I can not flash a golden image to the chip from bqstudio first then we can go into doing it from an MCU. 

  • Hi,

    My mistake, I did not realize you were unable to flash using BQstudio.

    Does your device autodetect when you open BQstudio?

    Can you share the file you are trying to flash?

    Regards,

    Diego

  • Yes, it does autodetect. I don't have the file with me and I'm out of the office until Tuesday, but all I did was take a brand new bq34z100-r2, plug it in to the ev2400, start bqstudio, it auto detected, I immediately dumped the golden image files, then tried to flash both, and neither worked. They both failed the same way with no ack. I will upload the file tuesday if that helps.

  • Hello Marco,

    Diego is currently out of office and will be back within the week to follow up with the message.

    Thank you,
    Alan

  • Hi,

    Sounds good please share the file when possible.

    One other thing to check is your voltage reading, is it above the flash update ok voltage.

    Regards,

    Diego

  • Here are the files:

    1602.test.zip

  • Hi,

    I had no issues flashing the files you provided.

    Did you check that the voltage reported in BQstudio is above the flash update ok voltage?

    Regards,

    Diego

  • I did. It was set to 2800 mV and the reported voltage is 13316. I dropped it to 1000 mV and it still won't flash.

  • This is what I get when I try to write from bqstudio. 

    For comparison, here is a successful FW_VERSION command with the same setup:

     

  • As for flashing it myself, I have the c library running on a raspberry pi. Here is the result:

    BQ34Z100 Gauge Programmer for Raspberry Pi
    ==========================================
    I2C address set to 0x55 (7-bit)
    I2C initialized successfully on /dev/i2c-1
    Testing I2C communication...
    Device communication test successful - FW Version: 0x0201
    
    === Flashing Golden Image ===
    Loaded golden image file '0100_2_01-bq34z100_BRAND_NEW_TEST.bq.fs' (180458 bytes)
    Executing FlashStream commands...
    I2C address set to 0x0B (7-bit)
    Error: Failed to write 2 bytes to register 0x64 (wrote -2): Remote I/O error
    Error: Golden image flashing failed at position 730
    Error context: '
    W:160002010000014F033F110CD9FF30E0FF352F100CE0FF3'
    Golden image flashing failed
    I2C cleaned up

    And that would mean that I'm getting this far into the image file:

    ;--------------------------------------------------------
    ;Unseal device
    ;--------------------------------------------------------
    W: AA 00 14 04
    W: AA 00 72 36
    W: AA 00 FF FF
    W: AA 00 FF FF
    X: 1000
    ;--------------------------------------------------------
    ;Go To ROM Mode
    ;--------------------------------------------------------
    W: AA 00 00 0F
    X: 1000
    ;--------------------------------------------------------
    ;Data Block
    ;--------------------------------------------------------
    W: 16 00 04 00 00 00 83 DE
    W: 16 64 65 01
    X: 400
    C: 16 66 00
    W: 16 00 02 00 00 00 EA FF 33 FA FA 33 B5 FB 33 95 FE 33 AD FE 33 FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F FF FF 3F 01 02 3F 58 CB 33 C3 A0 08 19 00 00 00 00 00 FF AA 0E FB A7 0E FF A6 0E FF A1 0E FF A0 0E FE A3 0E 53 A2 0E DE FF 3A 67 FF 3A E2 FF 33 FF AF 0E
    W: 16 64 35 38
    X: 2
    C: 16 66 00
    W: 16 00 02 01 00 00 01 4F 03 3F 11 0C D9 FF 30 E0 FF 35 2F 10 0C E0 FF 35 FF FF 23 E3 AF 04 E2 BF 04 D1 FF 36 E2 A0 04 E3 A1 04 00 C7 02 01 C6 02 E5 AF 04 E3 BF 01 E4 AF 04 E2 BF 01 FF AC 0E E1 1C 04 8A FF 31 E2 A0 04 E3 A1 04 02 AB 18 7F 2B 0E FF 1B 0E BF FF 32 FC FA 0E FB AF 0C 02 2B 18 FF 1B 0E 98 FF 36

  • Hi,

    When you flash the FW on BQstudio is there an error message?

    What version of BQstudio are you using? I recommend using the most current test version of BQstudio.

    Regards,

    Diego

  • As I said in the first post the error is no acknowledge from device and im on 1.3.124 Build 3 11/11/2024.

  • Hi,

    Typically, that means the device is not powered on correctly. 

    Does the TS pin pulse when powered on?

    Please upgrade to latest TEST version of BQstudio.

    Regards,

    Diego

  • Currently when battery power is applied it goes high to 2.5V and stays there. This is after a failed flashing which I believe left it in bootrom mode. I'm not entirely sure what to do about that or how to get it out of bootrom mode. At this point the device that is auto detected is 0001_0_02. I have just been replacing the chip on the EVM when it gets into this state, assuming I've done something wrong and it's not worth trying to force it back to its normal condition.

    I downloaded the new version and now it seems that instead of giving me a no acknowledge error it just pulls SCL low indefinitely and the device disconnects from bqstudio. I suppose I'll swap out the chip again and try writing to it from bqstudio. 

    Just to be sure, there is no other process I need to do, right? I just stick a brand new chip on then open bqstudio, go to the programming tab and select my file and hit execute?

  • I tried it both inside and outside of rom mode. Additionally, I was actually able to flash it while in rom mode from an esp32. However, it would be very useful to be able to do it from bqstudio.

  • Hi,

    Great that we found a way to flash the device. 

    Have you had a chance to upgrade to latest test version of BQstudio yet?

    Regards,

    Diego

  • Yes, I upgraded when you asked. 

    I'm pretty sure I know why it's failing, and it's the same reason my code was failing. It's because the image file tries to write the checksum to one command instead of two. There is a two part checksum after every data block write that is meant to go to registers 0x64 and 0x65. The write command is like:

    W: 16 64 35 38

    So it would write to bootrom, with the start address of 0x64, and it's assumed that 00 would be written to 0x65. However, this is not what the bq34z100-R2 wants. It wants two separate commands:

    W: 16 64 35

    W: 16 65 38