添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接

Hi,

I am working on p-nucleo-wb55 and run SBSFU example successfully. now i want replace default user application with my application as a secure application (.sfb). I refer AN5056 (Integration guide for the X-CUBE-SBSFU) section 8.1 How to make an application SBSFU compatible . but i am woking on AC6 IDE and example steps are for the IAR IDE.

So can you please tell me what linker script (.ld) changes require to make application SBSFU compatible and as specially how to make bin file length multiple of 16 byte which required during aes encryption.

Thanks,

Arjun

Replace every occurence of ALIGN(4) or ALIGN(8) with ALIGN(16) in the linker script.

Not all of them would be strictly necessary, but it won't waste more than a handful of bytes, and I can't exactly tell which one is necessary in a file that I can't see.

Anyway if you want to find out, the workaround at the bottom of this thread might give you a hint.

Normally the solution is to add a small part to the binary at the end to align the entire binary file to 16B.

Here is an example from a UserApp linker script:

  /* Extra ROM section (last one) to make sure the binary size is a multiple of the AES block size (16 bytes) and F7 flash writing unit (4 bytes)*/
  .align16 :
    . = . + 1;         /* _edata=. is aligned on 8 bytes so could be aligned on 16 bytes: add 1 byte gap */
    . = ALIGN(16) - 1; /* increment the location counter until next 16 bytes aligned address (-1 byte)   */
    BYTE(0);           /* allocate 1 byte (value is 0) to be a multiple of 16 bytes                      */
  } > APPLI_region_ROM

If you would align each section to 16B you would lose some bytes to each section instead of just a few at the end. Either way we're talking peanuts here.

Double buffering: synchronizing LTDC with DMA2D or other method to eliminate the tear flicker in STM32 MCUs products LPBAM I2C data buffer using NUCLEO-U575ZI-Q in STM32 MCUs products IAP Jump to application not working in STM32 MCUs Embedded software