I'm trying to use CC2340's serial bootloader to flash the device by following the steps in the TRM:
However, the device failed to boot after I programmed the main flash and CCFG, it stayed in SBL and returned error -1274 when I tried to connect to it through a debugger.
I compared the CCFG image used for flashing with a flash dump from a running device, they have several bytes of differences. I replaced the CCFG image with the dumped file and the device can boot properly.
From the TRM, these bytes seems are CRC values and in CCS these bytes are modified after loading the program by the IDE:
But in the image file, these bytes are 0x00 initially. How can I calculate these CRC values and generate a valid CCFG to make the SBL work?
Best regards,
Shuyang