'board_android-IoT/W7500_STM32'에 해당되는 글 2건

  1. 2021.07.19 :: KEIL MDK compiled code and RAM usage details
  2. 2021.07.19 :: [ W7500 / Link error ] Sections of aggregate size 0xc bytes could not fit into
board_android-IoT/W7500_STM32 2021. 7. 19. 11:49

KEIL MDK compiled code and RAM usage details

#W7500 #KEIL #uVision #LinkError #Sectionsofaggregatesize0xcbytescouldnotfitinto

-> solution:  decrease size of variable , ex: uint8_t SomeVariable[128] ;// 128 --> 120

 

Generally, MCU contains storage space: on-chip Flash and on-chip RAM, RAM is equivalent to memory, and Flash is equivalent to hard disk. The compiler divides a program into several parts and stores them in different memory areas of the MCU.
After the Keil project is compiled, there will be a prompt message about the space occupied by the corresponding program, as shown below:
Program Size: Code=12266 RO-data=790 RW-data=232 ZI-data=8096

 

- build result of SNMP firmware :

Program Size: Code=36724 RO-data=4760 RW-data=7244 ZI-data=8972 

 

The Program Size mentioned above contains the following parts:
1) Code: Code segment, which stores the code part of the program;
2) RO-data: read-only data segment, storing constants defined in the program;
3) RW-data: Read and write data segment, store global variables initialized to non-zero values;
4) ZI-data: 0 data segment, storing uninitialized global variables and variables initialized to 0;

 

After compiling the project, a .map file will be generated, which explains the size and address occupied by each function. The last few lines of the file also explain the relationship between the above several fields:
Total RO Size (Code + RO Data) 13056 ( 12.75kB)
Total RW Size (RW Data + ZI Data) 8328 ( 8.13kB)
Total ROM Size (Code + RO Data + RW Data) 13288 ( 12.98kB)

 

- Last part of Map file when SNMP firmware build :

    Total RO  Size (Code + RO Data)                41484 (  40.51kB)
    Total RW  Size (RW Data + ZI Data)             16216 (  15.84kB)
    Total ROM Size (Code + RO Data + RW Data)      42340 (  41.35kB)

1) RO Size includes Code and RO-data, indicating the size of the Flash space occupied by the program;
2) RW Size includes RW-data and ZI-data, indicating the size of RAM occupied during runtime;
3) ROM Size includes Code, RO Data, and RW Data, indicating the size of the Flash space occupied by the programming program.

 

 

Before the program runs, a file entity needs to be burned into the STM32 Flash, usually a bin or hex file. The burned file is called an executable image file. As shown in the left figure below, it is the memory distribution after the executable image file is burned to STM32. It contains two parts: the RO segment and the RW segment: the RO segment saves the data of Code and RO-data, and the RW segment saves The data of RW-data is not included in the image file because ZI-data is all 0.
STM32 is booted from Flash by default after power-on. After booting, the RW-data (initialized global variables) in the RW segment will be moved to RAM, but the RO segment will not be moved, that is, the execution code of the CPU is read from Flash. In addition, the ZI segment is allocated according to the ZI address and size given by the compiler, and this RAM area is cleared, as shown in the right figure below; the remaining RAM space is used as a dynamic memory heap.

posted by cskimair
:
board_android-IoT/W7500_STM32 2021. 7. 19. 11:17

[ W7500 / Link error ]  Sections of aggregate size 0xc bytes could not fit into

#STM32M0  #KEIL #uVision #LINKERROR #COULDNOTFITINTO #Sectionsofaggregatesize #ErrorL6407E

 

<BEFORE>
linking...
.\Obj\SNMPOOOOO_OOOO_OO.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(.data).
.\Obj\SNMPOOOOO_OOOO_OO.axf: Error: L6406E: No space in execution regions with .ANY selector matching retarget.o(.data).
.\Obj\SNMPOOOOO_OOOO_OO.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(.data).
.\Obj\SNMPOOOOO_OOOO_OO.axf: Error: L6407E: Sections of aggregate size 0xc bytes could not fit into .ANY selector(s).

<AFTER>
linking...
Program Size: Code=36900 RO-data=4528 RW-data=6820 ZI-data=8972  


// map file 
    Total RO  Size (Code + RO Data)                41428 (  40.46kB)
    Total RW  Size (RW Data + ZI Data)             15792 (  15.42kB)
    Total ROM Size (Code + RO Data + RW Data)      42284 (  41.29kB)

 

How to fix:

- decrease size in Variable declarations.

ex. uint8_t SomeVariable[256] ;  // ex. 256 ->128

> above change makes RAM(RW size) size smaller. Then I can fix this problem 'could not fit into'.

 

 

*. https://developer.arm.com/documentation/ka002785/latest

 

Documentation – Arm Developer

 

developer.arm.com

- W7500 (coretex m0) memory map

http://wizwiki.net/wiki/lib/exe/fetch.php?media=products:w7500:overview:w7500_memory_map.png 

 

'board_android-IoT > W7500_STM32' 카테고리의 다른 글

KEIL MDK compiled code and RAM usage details  (0) 2021.07.19
posted by cskimair
: