Other Parts Discussed in Thread: CC3220MOD
Hi,
Recently I implement the Embedded Programming functions as described in document SWPA230A. The host MCU can successfully send commands to CC3120 as described in Step 1 to 10. The received responses (Ack and Info) are correct. But it is failed at Step 11 (FS Programming). There is no Ack at all. I have checked the UART data by logic analyzer. They are matched with Figure 16. The only difference is the content of chunk data.
Then, I try to use different chunk size. I have tried 512 bytes, 1024 bytes, 2048 bytes and the original 4096 bytes.
For chunk_szie = 512 bytes, it starts to fail once the accumulated size > 2048 bytes. Here is the log:
CC3x20::embeddedProgramming() program image chunk=0 size=512 CC3x20::fsProgram() accumulated 512 bytes CC3x20::embeddedProgramming() program image chunk=1 size=512 CC3x20::fsProgram() accumulated 1024 bytes CC3x20::embeddedProgramming() program image chunk=2 size=512 CC3x20::fsProgram() accumulated 1536 bytes CC3x20::embeddedProgramming() program image chunk=3 size=512 CC3x20::fsProgram() accumulated 2048 bytes CC3x20::embeddedProgramming() program image chunk=4 size=512 CC3x20::txCommand() failed to get ack. rc=0
For chunk_szie = 1024 bytes, it starts to fail once the accumulated size > 2048 bytes. Here is the log:
CC3x20::embeddedProgramming() program image chunk=0 size=1024 CC3x20::fsProgram() accumulated 1024 bytes CC3x20::embeddedProgramming() program image chunk=1 size=1024 CC3x20::fsProgram() accumulated 2048 bytes CC3x20::embeddedProgramming() program image chunk=2 size=1024 CC3x20::txCommand() failed to get ack. rc=0
For chunk_szie = 2048 bytes, it also starts to fail once the accumulated size > 2048 bytes. Here is the log:
CC3x20::embeddedProgramming() program image chunk=0 size=2048 CC3x20::fsProgram() accumulated 2048 bytes CC3x20::embeddedProgramming() program image chunk=1 size=2048 CC3x20::txCommand() failed to get ack. rc=0
And for chunk_size = 4096 bytes, it fails from the beginning.
CC3x20::embeddedProgramming() program image chunk=0 size=4096 CC3x20::txCommand() failed to get ack. rc=0
Then, I tried to send GetStatus command after txCommand() failed. There is also no Ack for GetStatus. Obviously, CC3120 hangs after receiving 2048 chunk data bytes in step FS_PROGRAMMING.
The "up-to-date" bootloader is successfully patched to SRAM and SFLASH in step 6 and step 9 using the same txCommand() function. So, the function itself should be no problem.
It is really difficult to debug in this situation. Does anyone has this kind of experience? Any idea is helpful.