image crc or encryption problem after OTA

8 posts / 0 new
Last post
mohit3112
Offline
Last seen:9 months 1 week ago
Expert
Joined:2014-08-04 13:45
image crc or encryption problem after OTA

Hi,
i just opted bootloader in da14850 and it boots from eeprom just fine . but when i OTA the device after rebooting bootloder is getting an error in following code

if ( (image1_encryption && !AES_ENCRYPTED_IMAGE_SUPPORTED)
|| crc_image1 != crc32(0,(uint8_t*)SYSRAM_BASE_ADDRESS, codesize1))
return -1;

what did i miss ? how to debug this issue ?

Thanks
Mohit

Device:
MT_dialog
Offline
Last seen:2 months 6 days ago
Staff
Joined:2015-06-08 11:34
Hi mohit3112,

Hi mohit3112,

I suppose that the error is in the secondary bootloader code in the loadActiveImage() function. You can check which of the two conditions returns true, check if in the image you upload from the flash/eeprom supports encryption and the if the crc of the image is valid with the currently calculated crc.

Thanks MT_dialog

mohit3112
Offline
Last seen:9 months 1 week ago
Expert
Joined:2014-08-04 13:45
ok so debug this problem i

ok so debug this problem i made a global variable probe like this

int32_t probe __attribute__((section("retention_mem_area0"), zero_init));

i tried

probe = image1_encryption ;
then
probe = crc32(0,(uint8_t*)SYSRAM_BASE_ADDRESS, codesize1);

both returned 0 so if that is true then why return -1 is even executing
I have attached the image of debugging please take a look , i think compiler is optimizing the code and causing problem

Thanks
Mohit

mohit3112
Offline
Last seen:9 months 1 week ago
Expert
Joined:2014-08-04 13:45
after more debugging i found

after more debugging i found that after OTA my product header signature pProductHeader->signature[1] is changing from 0x52 to 0x10 , why this is happening ?
any suggestions ??

i am using sdk 3.0.10.1

Thanks
Mohit

MT_dialog
Offline
Last seen:2 months 6 days ago
Staff
Joined:2015-06-08 11:34
Hi mohit3112,

Hi mohit3112,

What do you mean after updating your software with OTA the product header changed the signatures to 0x10 ? How do you make your images, are you following the AN-B-010.pdf ? Perhaps you are missing something. The SUOTA doesn't alter the PRODUCT_HEADER_SIGNATURE2, you can dump your spi and check if it is changes after a SUOTA transaction. if your product header was changed the secondary bootloader would load any image.

Thanks MT_dialog

mohit3112
Offline
Last seen:9 months 1 week ago
Expert
Joined:2014-08-04 13:45
i used following steps

i used following steps
1. I made fw_1.img , fw_2.img -- mkimage.exe single fw_1.bin fw_version_1.h fw_1.img
2. ran command -- mkimage.exe multi eeprom fw_1.img 0x8000 fw_2.img 0x13000 0x1F000 multi_part.bin
3. loaded multi_part.bin in offset 0 of eeprom -- with option make_eeprom_bootable = no ( it comes as the popup after pressing burn button)
4.secondary_bootloader燃烧。十六进制的otp
5. burn otp header with
application flag 1 ---- yes
application flag 2 ---- yes
remapping flag --- Otp at 0
DMA长度---- 0x1FC0
JTAG enable flag --- enable

mohit3112
Offline
Last seen:9 months 1 week ago
Expert
Joined:2014-08-04 13:45
I checked the hex dump from

I checked the hex dump after burning image files from smartsnippets it's not correct , and yes it does change the product header signature after ota . i have attached the image of smartsnippets screenshots.

Thanks
Mohit

Attachment:
MT_dialog
Offline
Last seen:2 months 6 days ago
Staff
Joined:2015-06-08 11:34
Hi mohit,

Hi mohit,

What i ment when i said that the SUOTA doesn't change the product header signature is that there is no code in the SUOTA application that will change or alter the product header, after the multipart image is made it stays there and the SUOTA changes only the images. Also in the images you 've uploaded i see data just over the product header, what are those data, perhaps you rewrite somewere your eeprom and the data you sent ovelap the product header. I ve tested the SUOTA with an eeprom and the bootloader run though jtag the header remained unchanged as it should be.

Thanks MT_dialog