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.

USB DFU Secure image

Other Parts Discussed in Thread: TM4C1233D5PM

Hello


I am planning on using the Tivaware supplied boot loader to create a "secure" image upload to my device. For that purpose, I plan on using the BL_DECRYPT_FN_HOOK function which can be enabled in the boot loader configuration. I have two questions, which I cannot find answers to in the documentation:


1. Does the DFU interface specify any requirements to the sizes of the blocks transferred from the host to the device (e.g. is it a fixed block size, word aligned, etc...) ?


2. Does the boot loader support a method to abort the firmware upload in case the decryption of the image fails? I plan on using an authenticated encryption/decryption mode, with the authentication tag embedded in the image header. When the upload is completed and the tag does not match the expected tag, I would like to erase the image from flash (the image which has just been uploaded). Can this be done from within the decrypt call-back function, or does the boot loader support a better solution?


For the project I am currently using:
- TivaWare 2.1.0.12573
- Tm4c1233d5pm
- CCS v6
- TI v5.1.6 compiler

I appreciate any help you can provide.

Best regards
Christian

  • Hello Christian,

    The DFU device information structure can handle flash page sizes in the range 1KB to 32KB. The configuration option "FLASH_PAGE_SIZE" has to be set to the correct page size. If a value greater than 32KB is set then it is defaulted to 32KB. Refer the file "<TivaWare_Install_Directory>/boot_loader/bl_usb.c" for details of this implementaion.

    The bootloader has another hook function "BL_END_FN_HOOK" which is called when the firmware download is completed. This seems to be a more appropriate function to do the clean-up.

    Thanks,
    Sai
  • Hello Sai,

    I did not know that the upload block size would be defined by the flash page size - thanks for clarifying. Also, the BL_END_FN_HOOK sounds like a good solution.

    Thansk for your help!

    Br
    Christian