변수의 ROM 사이즈 절약

기술노트 52791

아키텍처:

ARM

컴포넌트:

linker

업데이트:

2018-02-28 오전 2:52

Introduction

I have a bootloader that will compute the CRC of the application software to launch. My bootloader knows the application's start address, but I also need the application size (for use in the CRC algorithm).

I have used the "Alternative solution" using checksum-start and checksum-end markers from Technical Note 62709 (IELFTOOL Checksum - Placing the checksum).

I would like to store the size of the ROM content in flash, in a section named "ROM_length_used" ...

define block ROM_CONTENT with fixed order
{
readonly section checksum,
readonly section ROM_length_used,
readonly section checksum_start_mark,
readonly,
readonly section checksum_end_mark
};

place in ROM_region { block ROM_CONTENT };

Solution using C

#pragma section = "ROM_CONTENT"
const size_t ROM_CONTENT_size @ "ROM_length_used" = __section_size("ROM_CONTENT");

Solution using assembler

   SECTION ROM_length_used:CODE:NOROOT(2)

EXTERN ROM_CONTENT$$Length

DATA

DC32 ROM_CONTENT$$Length ; Number of RO bytes

END

Example

An example project is available, see link: Example project (TN 52791).zip

 

All Product names are trademarks or registered trademarks of their respective owners.

죄송하지만, 당사 사이트에서는 Internet Explorer를 지원하지 않습니다.보다 편안한 사이트를 위해 Chrome, Edge, Firefox 등과 같은 최신 브라우저를 사용해 주시길 부탁드립니다.