Other Parts Discussed in Thread: BQSTUDIO, , , EV2400, TEST2
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.
Hi Andy,
Thank you for your response. Just wanted to follow up to see if you had a chance to verify the gm.fs file?
Thanks,
Vignesh
Hi Vignesh,
I was told to work from home last Friday and therefore I didn't have the chance to try the gm.fs file.
I took a few EVMs from our lab yesterday. Let me check if I can find a bq27220EVM. If it is available, I will have a try and provide my feedback.
Andy
Hi Vignesh,
I had a chance to verify the gm.fs file. I see that my FlashStream tool also fails. The failure occur to Line 93, which is highlighed below.
Can you follow the steps below and test your gm.fs file again?
a) Use the bqStudio to put the bq27220 into the FULL ACCESS mode.
b) Download the gm.fs file and see if Line 93 also fails.
Andy
Hi Andy,
Thank you for verifying the generated gm.fs file and confirming that you were also able to see it fail. One note I wanted to make: when attempting to load the same file using our host processor, the loading fails much earlier in the file, around line 22. Note that this is the first line which performs a "compare" instruction after writing to the data memory. Could this have any significance as you are seeing a failure much later on?
I explored bqStudio but didn't immediately see an option to load a FlashStream file onto a EVK. This was one of the things I had wanted to do early on, but when I couldn't find the feature I assumed it may not be supported in bqStudio. Could you help point me in the right direction here?
As noted earlier I've also tried to put the bq27220 via our host processor into various combinations of full access/unsealed modes but with similar results.
Would you be able to generate a gm.fs file which you can confirm works correctly on your end? I think it would be a useful exercise if I took the same file that works for you, and ensure that it works for me on our custom PCB (even if the values are not accurate to our application).
Thanks,
Vignesh
Hi Vignesh,
Yes. I can see the same failure when my tool is performing the first "compare" instruction (Line 22), if I don't put the bq27220 into the FULL ACCESS mode first.
The bq27220 device on my EVM is in the UNSEAL mode after power-on. I can see the failure occurs much later (still Line 93) if I comment on the following two lines.
;W: AA 00 14 04
;W: AA 00 72 36
I suggest you double check.
Andy
Hi Andy,
Thanks for the prompt response, I will double check to make sure that the host processor is putting the bq27220 into the FULL ACCESS mode correctly. I will also try commenting out those two lines (which I believe are putting the device into UNSEAL mode?) and let you know how that goes.
Thanks,
Vignesh
Hi Vignesh,
Yes. It seems like it is necessary to comment out these two lines if the gauge device is already in the UNSEAL mode.
Andy
Hi Andy,
I had a chance to test out your suggestion to comment out the two lines pertaining to unsealing the device, but did not notice a difference in which line the file loading failed. It still only got up to line 23. For your reference, I've attached the following files:
test1.fs.txt: original FlashStream file from this post (renamed to .txt extension)
test2.fs.txt: FlashStream file with lines 9 and 10 (device unsealing) commented (renamed to .txt extension)
test1_fs_log.txt: Debug log output when calling the gauge_execute_fs() function with test1.fs as the parameter.
test2_fs_log.txt: Debug log output when calling the gauge_execute_fs() function with test2.fs as the parameter.
I'm attaching the debug log output files so you can double check that the I2C transactions are happening correctly. Every byte sent and received is printed out there.
Currently, the host processor simply boots up and initializes its I2C bus before calling the gauge_execute_fs() function. This is similar to the example in Appendix A of the Gauge Communications document.
Please advise on how to proceed. Thank you!
Vignesh
;-------------------------------------------------------- ;Verify Existing Firmware Version ;-------------------------------------------------------- W: AA 3E 02 00 C: AA 3E 02 00 02 20 00 03 ;-------------------------------------------------------- ;Unseal device ;-------------------------------------------------------- W: AA 00 14 04 W: AA 00 72 36 W: AA 00 FF FF W: AA 00 FF FF X: 1000 ;-------------------------------------------------------- ;Data Block ;-------------------------------------------------------- W: AA 3E B4 91 00 00 00 00 00 00 00 00 CB D4 1A 05 D4 86 4A C6 B4 C2 6E 2B 03 7C 01 48 FD A3 F6 W: AA 5B 75 12 58 2D B7 W: AA 60 62 24 X: 10 W: AA 3E B4 91 C: AA 3E B4 91 00 00 00 00 00 00 00 00 CB D4 1A 05 D4 86 4A C6 B4 C2 6E 2B 03 7C 01 48 FD A3 F6 C: AA 5B 75 12 58 2D B7 W: AA 3E D4 91 1C 98 02 D3 FF B9 30 01 00 EF 05 11 W: AA 60 23 10 X: 10 W: AA 3E D4 91 C: AA 3E D4 91 1C 98 02 D3 FF B9 30 01 00 EF 05 11 W: AA 3E 80 91 FF F0 0B D6 7E 73 B6 45 93 0A A5 22 W: AA 60 CE 10 X: 10 W: AA 3E 80 91 C: AA 3E 80 91 FF F0 0B D6 7E 73 B6 45 93 0A A5 22 W: AA 3E F5 91 00 00 01 C2 00 32 00 C8 10 68 W: AA 60 44 0E X: 10 W: AA 3E F5 91 C: AA 3E F5 91 00 00 01 C2 00 32 00 C8 10 68 W: AA 3E 01 92 00 64 W: AA 60 08 06 X: 10 W: AA 3E 01 92 C: AA 3E 01 92 00 64 W: AA 3E 32 92 02 26 02 01 F4 02 58 02 02 26 F6 W: AA 60 A2 0F X: 10 W: AA 3E 32 92 C: AA 3E 32 92 02 26 02 01 F4 02 58 02 02 26 F6 W: AA 3E 06 92 04 84 10 00 W: AA 60 CF 08 X: 10 W: AA 3E 06 92 C: AA 3E 06 92 04 84 10 00 W: AA 3E 0B 92 01 09 00 00 96 00 AF W: AA 60 13 0B X: 10 W: AA 3E 0B 92 C: AA 3E 0B 92 01 09 00 00 96 00 AF W: AA 3E 12 92 02 20 W: AA 60 39 06 X: 10 W: AA 3E 12 92 C: AA 3E 12 92 02 20 W: AA 3E 17 92 00 0A 05 00 32 01 C2 14 14 W: AA 60 2A 0D X: 10 W: AA 3E 17 92 C: AA 3E 17 92 00 0A 05 00 32 01 C2 14 14 W: AA 3E 28 92 00 3C 00 4B 00 28 00 3C 3C 01 W: AA 60 1D 0E X: 10 W: AA 3E 28 92 C: AA 3E 28 92 00 3C 00 4B 00 28 00 3C 3C 01 W: AA 3E 40 92 0C 4E 02 0C B2 W: AA 60 13 09 X: 10 W: AA 3E 40 92 C: AA 3E 40 92 0C 4E 02 0C B2 W: AA 3E 7F 92 0C 8C 8C 0B B8 0C 1C 00 05 10 68 10 04 64 5F 0C 80 0C E4 06 08 10 68 10 04 64 5F W: AA 60 B2 1F X: 10 W: AA 3E 7F 92 C: AA 3E 7F 92 0C 8C 8C 0B B8 0C 1C 00 05 10 68 10 04 64 5F 0C 80 0C E4 06 08 10 68 10 04 64 5F W: AA 3E 9A 92 00 10 2A 05 14 05 14 W: AA 60 67 0B X: 10 W: AA 3E 9A 92 C: AA 3E 9A 92 00 10 2A 05 14 05 14 W: AA 3E 8F 41 00 W: AA 60 2F 05 X: 10 W: AA 3E 8F 41 C: AA 3E 8F 41 00 W: AA 3E 7D 92 5A W: AA 60 96 05 X: 10 W: AA 3E 7D 92 C: AA 3E 7D 92 5A W: AA 3E 51 92 02 BC W: AA 60 5E 06 X: 10 W: AA 3E 51 92 C: AA 3E 51 92 02 BC W: AA 3E 5B 92 77 W: AA 60 9B 05 X: 10 W: AA 3E 5B 92 C: AA 3E 5B 92 77 W: AA 3E 64 92 05 DC W: AA 60 28 06 X: 10 W: AA 3E 64 92 C: AA 3E 64 92 05 DC W: AA 3E 68 92 14 00 00 00 64 00 00 64 64 08 0E 74 00 64 1F 40 W: AA 60 78 14 X: 10 W: AA 3E 68 92 C: AA 3E 68 92 14 00 00 00 64 00 00 64 64 08 0E 74 00 64 1F 40 W: AA 3E A3 92 0E 74 00 64 0E 9F 00 95 03 63 0F BE 01 3C 09 00 00 0B D7 01 0D 39 01 0D AD 01 10 W: AA 5B 4D 0F CB 0F 55 W: AA 60 A9 24 X: 10 W: AA 3E A3 92 C: AA 3E A3 92 0E 74 00 64 0E 9F 00 95 03 63 0F BE 01 3C 09 00 00 0B D7 01 0D 39 01 0D AD 01 10 C: AA 5B 4D 0F CB 0F 55 W: AA 3E C3 92 0E ED 0E 8D 0E 48 0E 23 0D FE 0D BB 0D 6F 0A 99 W: AA 60 9B 14 X: 10 W: AA 3E C3 92 C: AA 3E C3 92 0E ED 0E 8D 0E 48 0E 23 0D FE 0D BB 0D 6F 0A 99 W: AA 3E 7B 92 02 3C W: AA 60 B4 06 X: 10 W: AA 3E 7B 92 C: AA 3E 7B 92 02 3C
;-------------------------------------------------------- ;Verify Existing Firmware Version ;-------------------------------------------------------- W: AA 3E 02 00 C: AA 3E 02 00 02 20 00 03 ;-------------------------------------------------------- ;Unseal device ;-------------------------------------------------------- ;W: AA 00 14 04 ;W: AA 00 72 36 W: AA 00 FF FF W: AA 00 FF FF X: 1000 ;-------------------------------------------------------- ;Data Block ;-------------------------------------------------------- W: AA 3E B4 91 00 00 00 00 00 00 00 00 CB D4 1A 05 D4 86 4A C6 B4 C2 6E 2B 03 7C 01 48 FD A3 F6 W: AA 5B 75 12 58 2D B7 W: AA 60 62 24 X: 10 W: AA 3E B4 91 C: AA 3E B4 91 00 00 00 00 00 00 00 00 CB D4 1A 05 D4 86 4A C6 B4 C2 6E 2B 03 7C 01 48 FD A3 F6 C: AA 5B 75 12 58 2D B7 W: AA 3E D4 91 1C 98 02 D3 FF B9 30 01 00 EF 05 11 W: AA 60 23 10 X: 10 W: AA 3E D4 91 C: AA 3E D4 91 1C 98 02 D3 FF B9 30 01 00 EF 05 11 W: AA 3E 80 91 FF F0 0B D6 7E 73 B6 45 93 0A A5 22 W: AA 60 CE 10 X: 10 W: AA 3E 80 91 C: AA 3E 80 91 FF F0 0B D6 7E 73 B6 45 93 0A A5 22 W: AA 3E F5 91 00 00 01 C2 00 32 00 C8 10 68 W: AA 60 44 0E X: 10 W: AA 3E F5 91 C: AA 3E F5 91 00 00 01 C2 00 32 00 C8 10 68 W: AA 3E 01 92 00 64 W: AA 60 08 06 X: 10 W: AA 3E 01 92 C: AA 3E 01 92 00 64 W: AA 3E 32 92 02 26 02 01 F4 02 58 02 02 26 F6 W: AA 60 A2 0F X: 10 W: AA 3E 32 92 C: AA 3E 32 92 02 26 02 01 F4 02 58 02 02 26 F6 W: AA 3E 06 92 04 84 10 00 W: AA 60 CF 08 X: 10 W: AA 3E 06 92 C: AA 3E 06 92 04 84 10 00 W: AA 3E 0B 92 01 09 00 00 96 00 AF W: AA 60 13 0B X: 10 W: AA 3E 0B 92 C: AA 3E 0B 92 01 09 00 00 96 00 AF W: AA 3E 12 92 02 20 W: AA 60 39 06 X: 10 W: AA 3E 12 92 C: AA 3E 12 92 02 20 W: AA 3E 17 92 00 0A 05 00 32 01 C2 14 14 W: AA 60 2A 0D X: 10 W: AA 3E 17 92 C: AA 3E 17 92 00 0A 05 00 32 01 C2 14 14 W: AA 3E 28 92 00 3C 00 4B 00 28 00 3C 3C 01 W: AA 60 1D 0E X: 10 W: AA 3E 28 92 C: AA 3E 28 92 00 3C 00 4B 00 28 00 3C 3C 01 W: AA 3E 40 92 0C 4E 02 0C B2 W: AA 60 13 09 X: 10 W: AA 3E 40 92 C: AA 3E 40 92 0C 4E 02 0C B2 W: AA 3E 7F 92 0C 8C 8C 0B B8 0C 1C 00 05 10 68 10 04 64 5F 0C 80 0C E4 06 08 10 68 10 04 64 5F W: AA 60 B2 1F X: 10 W: AA 3E 7F 92 C: AA 3E 7F 92 0C 8C 8C 0B B8 0C 1C 00 05 10 68 10 04 64 5F 0C 80 0C E4 06 08 10 68 10 04 64 5F W: AA 3E 9A 92 00 10 2A 05 14 05 14 W: AA 60 67 0B X: 10 W: AA 3E 9A 92 C: AA 3E 9A 92 00 10 2A 05 14 05 14 W: AA 3E 8F 41 00 W: AA 60 2F 05 X: 10 W: AA 3E 8F 41 C: AA 3E 8F 41 00 W: AA 3E 7D 92 5A W: AA 60 96 05 X: 10 W: AA 3E 7D 92 C: AA 3E 7D 92 5A W: AA 3E 51 92 02 BC W: AA 60 5E 06 X: 10 W: AA 3E 51 92 C: AA 3E 51 92 02 BC W: AA 3E 5B 92 77 W: AA 60 9B 05 X: 10 W: AA 3E 5B 92 C: AA 3E 5B 92 77 W: AA 3E 64 92 05 DC W: AA 60 28 06 X: 10 W: AA 3E 64 92 C: AA 3E 64 92 05 DC W: AA 3E 68 92 14 00 00 00 64 00 00 64 64 08 0E 74 00 64 1F 40 W: AA 60 78 14 X: 10 W: AA 3E 68 92 C: AA 3E 68 92 14 00 00 00 64 00 00 64 64 08 0E 74 00 64 1F 40 W: AA 3E A3 92 0E 74 00 64 0E 9F 00 95 03 63 0F BE 01 3C 09 00 00 0B D7 01 0D 39 01 0D AD 01 10 W: AA 5B 4D 0F CB 0F 55 W: AA 60 A9 24 X: 10 W: AA 3E A3 92 C: AA 3E A3 92 0E 74 00 64 0E 9F 00 95 03 63 0F BE 01 3C 09 00 00 0B D7 01 0D 39 01 0D AD 01 10 C: AA 5B 4D 0F CB 0F 55 W: AA 3E C3 92 0E ED 0E 8D 0E 48 0E 23 0D FE 0D BB 0D 6F 0A 99 W: AA 60 9B 14 X: 10 W: AA 3E C3 92 C: AA 3E C3 92 0E ED 0E 8D 0E 48 0E 23 0D FE 0D BB 0D 6F 0A 99 W: AA 3E 7B 92 02 3C W: AA 60 B4 06 X: 10 W: AA 3E 7B 92 C: AA 3E 7B 92 02 3C
Gauge address set to: 0xAA Writing to reg addr=0x3E [00] 0x02 [01] 0x00 Gauge address set to: 0xAA Reading from reg addr=0x3E [00] 0x02 [01] 0x00 [02] 0x02 [03] 0x20 [04] 0x00 [05] 0x03 Comparing data of length=6 [00] 0x02 -- 0x02 [01] 0x00 -- 0x00 [02] 0x02 -- 0x02 [03] 0x20 -- 0x20 [04] 0x00 -- 0x00 [05] 0x03 -- 0x03 Gauge address set to: 0xAA Writing to reg addr=0x00 [00] 0x14 [01] 0x04 Gauge address set to: 0xAA Writing to reg addr=0x00 [00] 0x72 [01] 0x36 Gauge address set to: 0xAA Writing to reg addr=0x00 [00] 0xFF [01] 0xFF Gauge address set to: 0xAA Writing to reg addr=0x00 [00] 0xFF [01] 0xFF Delay 1000000us Gauge address set to: 0xAA Writing to reg addr=0x3E [00] 0xB4 [01] 0x91 [02] 0x00 [03] 0x00 [04] 0x00 [05] 0x00 [06] 0x00 [07] 0x00 [08] 0x00 [09] 0x00 [10] 0xCB [11] 0xD4 [12] 0x1A [13] 0x05 [14] 0xD4 [15] 0x86 [16] 0x4A [17] 0xC6 [18] 0xB4 [19] 0xC2 [20] 0x6E [21] 0x2B [22] 0x03 [23] 0x7C [24] 0x01 [25] 0x48 [26] 0xFD [27] 0xA3 [28] 0xF6 Gauge address set to: 0xAA Writing to reg addr=0x5B [00] 0x75 [01] 0x12 [02] 0x58 [03] 0x2D [04] 0xB7 Gauge address set to: 0xAA Writing to reg addr=0x60 [00] 0x62 [01] 0x24 Delay 10000us Gauge address set to: 0xAA Writing to reg addr=0x3E [00] 0xB4 [01] 0x91 Gauge address set to: 0xAA Reading from reg addr=0x3E Comparing data of length=29 [00] 0xB4 -- 0xB4 [01] 0x91 -- 0x91 [02] 0x00 -- 0x02 [03] 0x00 -- 0x20 [04] 0x00 -- 0x00 [05] 0x00 -- 0x03 [06] 0x00 -- 0x00 [07] 0x00 -- 0x00 [08] 0x00 -- 0x00 [09] 0x00 -- 0x00 [10] 0xCB -- 0x00 [11] 0xD4 -- 0x00 [12] 0x1A -- 0x00 [13] 0x05 -- 0x00 [14] 0xD4 -- 0x03 [15] 0x86 -- 0x00 [16] 0x4A -- 0x00 [17] 0xC6 -- 0x00 [18] 0xB4 -- 0x00 [19] 0xC2 -- 0x00 [20] 0x6E -- 0x03 [21] 0x2B -- 0x00 [22] 0x03 -- 0x00 [23] 0x7C -- 0x00 [24] 0x01 -- 0x00 [25] 0x48 -- 0x00 [26] 0xFD -- 0x00 [27] 0xA3 -- 0x00 [28] 0xF6 -- 0x00 fs_ret = C:AA5B7512582DB7 W:AA3ED4911C9802D3FFB9300100EF0511 W:AA602310 X:10 W:AA3ED491 C:AA3ED4911C9802D3FFB9300100EF0511 W:AA3E8091FFF00BD67E73B645930AA522 W:AA60CE10 X:10 W:AA3E8091 C:AA3E8091FFF00BD67E73B645930AA522 W:AA3EF591000001C2003200C81068 W:AA60440E X:10 W:AA3EF591 C:AA3EF591000001C2003200C81068 W:AA3E01920064 W:AA600806 X:10 W:AA3E0192 C:AA3E01920064 W:AA3E329202260201F40258020226F6 W:AA60A20F X:10 W:AA3E3292 C:AA3E329202260201F40258020226F6 W:AA3E069204841000 W:AA60CF08 X:10 W:AA3E0692 C:AA3E069204841000 W:AA3E0B92010900009600AF W:AA60130B X:10 W:AA3E0B92 C:AA3E0B92010900009600AF W:AA3E12920220 W:AA603906 X:10 W:AA3E1292 C:AA3E12920220 W:AA3E1792000A05003201C21414 W:AA602A0D X:10 W:AA3E1792 C:AA3E1792000A05003201C21414 W:AA3E2892003C004B0028003C3C01 W:AA601D0E X:10 W:AA3E2892 C:AA3E2892003C004B0028003C3C01 W:AA3E40920C4E020CB2 W:AA601309 X:10 W:AA3E4092 C:AA3E40920C4E020CB2 W:AA3E7F920C8C8C0BB80C1C000510681004645F0C800CE4060810681004645F W:AA60B21F X:10 W:AA3E7F92 C:AA3E7F920C8C8C0BB80C1C000510681004645F0C800CE4060810681004645F W:AA3E9A9200102A05140514 W:AA60670B X:10 W:AA3E9A92 C:AA3E9A9200102A05140514 W:AA3E8F4100 W:AA602F05 X:10 W:AA3E8F41 C:AA3E8F4100 W:AA3E7D925A W:AA609605 X:10 W:AA3E7D92 C:AA3E7D925A W:AA3E519202BC W:AA605E06 X:10 W:AA3E5192 C:AA3E519202BC W:AA3E5B9277 W:AA609B05 X:10 W:AA3E5B92 C:AA3E5B9277 W:AA3E649205DC W:AA602806 X:10 W:AA3E6492 C:AA3E649205DC W:AA3E6892140000006400006464080E7400641F40 W:AA607814 X:10 W:AA3E6892 C:AA3E6892140000006400006464080E7400641F40 W:AA3EA3920E7400640E9F009503630FBE013C0900000BD7010D39010DAD0110 W:AA5B4D0FCB0F55 W:AA60A924 X:10 W:AA3EA392 C:AA3EA3920E7400640E9F009503630FBE013C0900000BD7010D39010DAD0110 C:AA5B4D0FCB0F55 W:AA3EC3920EED0E8D0E480E230DFE0DBB0D6F0A99 W:AA609B14 X:10 W:AA3EC392 C:AA3EC3920EED0E8D0E480E230DFE0DBB0D6F0A99 W:AA3E7B92023C W:AA60B406 X:10 W:AA3E7B92 C:AA3E7B92023C
Gauge address set to: 0xAA Writing to reg addr=0x3E [00] 0x02 [01] 0x00 Gauge address set to: 0xAA Reading from reg addr=0x3E [00] 0x02 [01] 0x00 [02] 0x02 [03] 0x20 [04] 0x00 [05] 0x03 Comparing data of length=6 [00] 0x02 -- 0x02 [01] 0x00 -- 0x00 [02] 0x02 -- 0x02 [03] 0x20 -- 0x20 [04] 0x00 -- 0x00 [05] 0x03 -- 0x03 Gauge address set to: 0xAA Writing to reg addr=0x00 [00] 0xFF [01] 0xFF Gauge address set to: 0xAA Writing to reg addr=0x00 [00] 0xFF [01] 0xFF Delay 1000000us Gauge address set to: 0xAA Writing to reg addr=0x3E [00] 0xB4 [01] 0x91 [02] 0x00 [03] 0x00 [04] 0x00 [05] 0x00 [06] 0x00 [07] 0x00 [08] 0x00 [09] 0x00 [10] 0xCB [11] 0xD4 [12] 0x1A [13] 0x05 [14] 0xD4 [15] 0x86 [16] 0x4A [17] 0xC6 [18] 0xB4 [19] 0xC2 [20] 0x6E [21] 0x2B [22] 0x03 [23] 0x7C [24] 0x01 [25] 0x48 [26] 0xFD [27] 0xA3 [28] 0xF6 Gauge address set to: 0xAA Writing to reg addr=0x5B [00] 0x75 [01] 0x12 [02] 0x58 [03] 0x2D [04] 0xB7 Gauge address set to: 0xAA Writing to reg addr=0x60 [00] 0x62 [01] 0x24 Delay 10000us Gauge address set to: 0xAA Writing to reg addr=0x3E [00] 0xB4 [01] 0x91 Gauge address set to: 0xAA Reading from reg addr=0x3E Comparing data of length=29 [00] 0xB4 -- 0xB4 [01] 0x91 -- 0x91 [02] 0x00 -- 0x02 [03] 0x00 -- 0x20 [04] 0x00 -- 0x00 [05] 0x00 -- 0x03 [06] 0x00 -- 0x00 [07] 0x00 -- 0x00 [08] 0x00 -- 0x00 [09] 0x00 -- 0x00 [10] 0xCB -- 0x00 [11] 0xD4 -- 0x00 [12] 0x1A -- 0x00 [13] 0x05 -- 0x00 [14] 0xD4 -- 0x03 [15] 0x86 -- 0x00 [16] 0x4A -- 0x00 [17] 0xC6 -- 0x00 [18] 0xB4 -- 0x00 [19] 0xC2 -- 0x00 [20] 0x6E -- 0x03 [21] 0x2B -- 0x00 [22] 0x03 -- 0x00 [23] 0x7C -- 0x00 [24] 0x01 -- 0x00 [25] 0x48 -- 0x00 [26] 0xFD -- 0x00 [27] 0xA3 -- 0x00 [28] 0xF6 -- 0x00 fs_ret = C:AA5B7512582DB7 W:AA3ED4911C9802D3FFB9300100EF0511 W:AA602310 X:10 W:AA3ED491 C:AA3ED4911C9802D3FFB9300100EF0511 W:AA3E8091FFF00BD67E73B645930AA522 W:AA60CE10 X:10 W:AA3E8091 C:AA3E8091FFF00BD67E73B645930AA522 W:AA3EF591000001C2003200C81068 W:AA60440E X:10 W:AA3EF591 C:AA3EF591000001C2003200C81068 W:AA3E01920064 W:AA600806 X:10 W:AA3E0192 C:AA3E01920064 W:AA3E329202260201F40258020226F6 W:AA60A20F X:10 W:AA3E3292 C:AA3E329202260201F40258020226F6 W:AA3E069204841000 W:AA60CF08 X:10 W:AA3E0692 C:AA3E069204841000 W:AA3E0B92010900009600AF W:AA60130B X:10 W:AA3E0B92 C:AA3E0B92010900009600AF W:AA3E12920220 W:AA603906 X:10 W:AA3E1292 C:AA3E12920220 W:AA3E1792000A05003201C21414 W:AA602A0D X:10 W:AA3E1792 C:AA3E1792000A05003201C21414 W:AA3E2892003C004B0028003C3C01 W:AA601D0E X:10 W:AA3E2892 C:AA3E2892003C004B0028003C3C01 W:AA3E40920C4E020CB2 W:AA601309 X:10 W:AA3E4092 C:AA3E40920C4E020CB2 W:AA3E7F920C8C8C0BB80C1C000510681004645F0C800CE4060810681004645F W:AA60B21F X:10 W:AA3E7F92 C:AA3E7F920C8C8C0BB80C1C000510681004645F0C800CE4060810681004645F W:AA3E9A9200102A05140514 W:AA60670B X:10 W:AA3E9A92 C:AA3E9A9200102A05140514 W:AA3E8F4100 W:AA602F05 X:10 W:AA3E8F41 C:AA3E8F4100 W:AA3E7D925A W:AA609605 X:10 W:AA3E7D92 C:AA3E7D925A W:AA3E519202BC W:AA605E06 X:10 W:AA3E5192 C:AA3E519202BC W:AA3E5B9277 W:AA609B05 X:10 W:AA3E5B92 C:AA3E5B9277 W:AA3E649205DC W:AA602806 X:10 W:AA3E6492 C:AA3E649205DC W:AA3E6892140000006400006464080E7400641F40 W:AA607814 X:10 W:AA3E6892 C:AA3E6892140000006400006464080E7400641F40 W:AA3EA3920E7400640E9F009503630FBE013C0900000BD7010D39010DAD0110 W:AA5B4D0FCB0F55 W:AA60A924 X:10 W:AA3EA392 C:AA3EA3920E7400640E9F009503630FBE013C0900000BD7010D39010DAD0110 C:AA5B4D0FCB0F55 W:AA3EC3920EED0E8D0E480E230DFE0DBB0D6F0A99 W:AA609B14 X:10 W:AA3EC392 C:AA3EC3920EED0E8D0E480E230DFE0DBB0D6F0A99 W:AA3E7B92023C W:AA60B406 X:10 W:AA3E7B92 C:AA3E7B92023C
Try this gm.fs below. I only changed the Full Charge Capacity and Design Capacity and all the other settings are default.
I can program it without any problem.
Please follow the steps below.
a) Use a bq27220 EVM and put the gauge device into FULL ACCESS mode with the bqStudio .
b) Program the gm.fs file. You are supposed to see zero failure.
c) Launch the bqStudio again and you will see the Full Charge Capacity and Design Capacity are updated to 4000mAh.
https://e2e.ti.com/cfs-file/__key/communityserver-discussions-components-files/196/bq27220_5F00_4000.gm.fs
If you fail to download that gm.fs file, there should be something wrong with your firmware code. I am using the same code from the app note SLUA801.
Andy
Hi Andy,
Thank you so much for sharing the file which you validated as working.
Some good news - I was able to figure out the issue thanks to the alternative gm.fs file you sent. When I tried to load it and compared the debug logs between your file and my previous file, I noticed that there may be a potential timeout issue with the I2C reads. As I debugged the code, I noticed that I2C reads from standard command registers worked fine, but just before the FlashStream file loading failure, the I2C reads from the data memory would time out waiting for an ACK from the bq27220. I had to increase the delay here in order to allow it to be read properly.
The previous file which I sent over originally (test1.fs) now gets loaded in its entirety without issue. I have verified this by printing out the design capacity before (3000mAh) and after (1300mAh) to verify that this parameter is loaded correctly.
However, the new file which you sent over still fails. The failure happens around line 83:
The gm.fs file expects to read 0xA6 there, but the host processor reads 0x00. I have not dug into this further but just wanted to point it out.
Just a few final questions:
1. Is there some spec in the datasheet/TRM which I may have missed specifying what the read latency should be when reading from the data memory as opposed to reading from the standard command registers?
2. In your experience, what is the time it typically takes to fully load a gm.fs file onto the BQ27220 over I2C at standard speeds (100kHz, 400kHz)?
3. It is my understanding that these values are stored in the fuel gauge's volatile memory, which is lost when the battery is physically disconnected (regardless of whether the device itself is on or off). Is it recommended to load the gm.fs file every time the product boots up, or is there some way we can read the fuel gauge status registers and only load the gm.fs file if we find that the file has not been previously loaded?
Thanks again for your help and patience!
See my quick comments below.
a) I'm using 100kHz I2C in my code.
b) I add a 1 ms delay after each i2c read or write operation in the function gauge_read() and gauge_write().
Andy
Andy,
Thanks for sharing your code snippets, that is certainly helpful. I'd just like to repost my final outstanding questions to help better understand in-field usage:
1. Is there some spec in the datasheet/TRM which I may have missed specifying what the read latency should be when reading from the data memory as opposed to reading from the standard command registers?
2. In your experience, what is the time it typically takes to fully load a gm.fs file onto the BQ27220 over I2C at standard speeds (100kHz, 400kHz)? Through a quick measurement, it took me about 9s to load a gm.fs file at 100kHz. Is this on the order of magnitude of what you would expect? I'd like to make sure we don't have any unnecessary delays as boot up time is something we are trying to keep to a minimum.
3. It is my understanding that these values are stored in the fuel gauge's volatile memory, which is lost when the battery is physically disconnected (regardless of whether the device itself is on or off). Is it recommended to load the gm.fs file every time the product boots up, or is there some way we can read the fuel gauge status registers and only load the gm.fs file if we find that the file has not been previously loaded?
See my comments below.
1. Is there some spec in the datasheet/TRM which I may have missed specifying what the read latency should be when reading from the data memory as opposed to reading from the standard command registers?
[Andy] I guess what you should be aware of is the 66us waiting time between all packets. I use a 1ms delay between each i2 writes in my code.
2. In your experience, what is the time it typically takes to fully load a gm.fs file onto the BQ27220 over I2C at standard speeds (100kHz, 400kHz)? Through a quick measurement, it took me about 9s to load a gm.fs file at 100kHz. Is this on the order of magnitude of what you would expect? I'd like to make sure we don't have any unnecessary delays as boot up time is something we are trying to keep to a minimum.
[Andy] It takes my tool around 0.8s to download gm.fs at 100kHz, if the 5 lines below that are used to unseal devices are commented out.
;Unseal device
;--------------------------------------------------------
W: AA 00 14 04
W: AA 00 72 36
W: AA 00 FF FF
W: AA 00 FF FF
X: 1000
3. It is my understanding that these values are stored in the fuel gauge's volatile memory, which is lost when the battery is physically disconnected (regardless of whether the device itself is on or off). Is it recommended to load the gm.fs file every time the product boots up, or is there some way we can read the fuel gauge status registers and only load the gm.fs file if we find that the file has not been previously loaded?
[Andy] We suggest customers use the gm.fs file to program the bq27220 every time the gauge is reset or powered up.
Andy