Error l6406e no space in execution regions with any selector matching main o bss

I have written a sample EMWIN Project in KEIL using its package manager, shown below. When I use the Build Project icon I get the following error: .Objectstest.axf: Error: L6406E: No space in

$begingroup$

I have written a sample EMWIN Project in KEIL using its package manager, shown below.

KEIL Package Pic

When I use the Build Project icon I get the following error:

.Objectstest.axf: Error: L6406E: No space in execution regions with .ANY selector matching rtx_conf_cm.o(.bss).

As shown here:

error pic

My keil code can be found here:

The csource Code

NEW Update:

So my IROM1 && IRAM1 setting shown below:

IROM1 && IRAM1

So have I could change those constance for solving this error?

What is causing this error?

asked Feb 5, 2019 at 9:37

Soheil Paper's user avatar

$endgroup$

$begingroup$

It looks like your selected MCU does not have enough space in flash to store the program.

Indicated by this forum post: ST Forum Link

answered Feb 5, 2019 at 9:56

andowt's user avatar

andowtandowt

9901 gold badge7 silver badges25 bronze badges

$endgroup$

6

$begingroup$

There are errors when linking the .data sections. You’re probably asking for too much SRAM.
Which makes sense seeing that you’re trying to fit a graphics library.

The STM32F103 alone won’t fit a color frame buffer. You need this memory on the display, or external.

answered Jan 20, 2020 at 9:11

Jeroen3's user avatar

Jeroen3Jeroen3

21.4k35 silver badges73 bronze badges

$endgroup$

@x893 There is not enough RAM on your target to support this example out of the box.

You can tweak the application to disable components like the RTOS to make it fit on your target. To do that, create a .mbedignore file at the root of the project and paste the following content:

mbed-os/rtos/*
mbed-os/features/FEATURE_CLIENT/*
mbed-os/features/FEATURE_COMMON_PAL/*
mbed-os/features/FEATURE_UVISOR/*
mbed-os/features/frameworks/*
mbed-os/features/net/*
mbed-os/features/netsocket/*
mbed-os/features/storage/*
{
    "macros": [
        "NDEBUG=1",
    ], 
    "target_overrides": {
            "*": {
                    "platform.stdio-flush-at-exit": false
            },
        "K64F": {
            "target.features_add": ["BLE"],
            "target.extra_labels_add": ["ST_BLUENRG"],
            "target.macros_add": ["IDB0XA1_D13_PATCH"]
        },
        "NUCLEO_F401RE": {
            "target.features_add": ["BLE"],
            "target.extra_labels_add": ["ST_BLUENRG"]
        }
    }
}

Unlike the original file, NDEBUG is defined and standard IO will not be flushed at exit.

On a final note, the solutions exposed here are just workarounds which will save few bytes of RAM they might not be enough depending on the application.

Причина проверки

Ucosii переносится.
Среда перед трансплантацией — STM32F103VE + lwip2.1.2
После переноса файла ucosii_v2.92.07 в проект его можно скомпилировать.
В это время измените файл запуска startup_stm32f10x_hd.s

Необходимо изменить 4 точки, заменить PendSV_Handler => OS_CPU_PendSVHandler и SysTick_Handler => OS_CPU_SysTickHandler в таблице векторов прерываний

; Vector Table Mapped to Address 0 at Reset
                AREA    RESET, DATA, READONLY
                EXPORT  __Vectors
                EXPORT  __Vectors_End
                EXPORT  __Vectors_Size

                IMPORT  OS_CPU_PendSVHandler
                IMPORT  OS_CPU_SysTickHandler 

__Vectors       DCD     __initial_sp               ; Top of Stack
                DCD     Reset_Handler              ; Reset Handler
                DCD     NMI_Handler                ; NMI Handler
                DCD     HardFault_Handler          ; Hard Fault Handler
                DCD     MemManage_Handler          ; MPU Fault Handler
                DCD     BusFault_Handler           ; Bus Fault Handler
                DCD     UsageFault_Handler         ; Usage Fault Handler
                DCD     0                          ; Reserved
                DCD     0                          ; Reserved
                DCD     0                          ; Reserved
                DCD     0                          ; Reserved
                DCD     SVC_Handler                ; SVCall Handler
                DCD     DebugMon_Handler           ; Debug Monitor Handler
                DCD     0                          ; Reserved
                DCD     OS_CPU_PendSVHandler        ; PendSV_Handler, PendSV Handler => OS_CPU_PendSVHandler
                DCD     OS_CPU_SysTickHandler       ; SysTick_Handler, SysTick Handler => OS_CPU_SysTickHandler

                ; External Interrupts

В это время возникает ошибка компиляции

compiling sockets.c...
linking...
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_core.o(.bss).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching my_nic.o(.bss).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching dns.o(.bss).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching startup_stm32f10x_hd.o(STACK).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching stats.o(.bss).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching tcpip.o(.bss).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching etharp.o(.bss).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching netif.o(.bss).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_core.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching memp.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching err.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching dhcp.o(.bss).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching tcp_in.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching tcp.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching ip.o(.bss).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching tcp_in.o(.bss).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching mem.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching dhcp.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching netif.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching dns.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching timeouts.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching enc28j60.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching udp.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching igmp.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching ip4.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching ip4_frag.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching os_cpu_c.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching raw.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching stdout.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching pbuf.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6406E: No space in execution regions with .ANY selector matching etharp.o(.data).
.Objectsmy_stm32f1_SPL_template.axf: Error: L6407E: Sections of aggregate size 0x3ecc bytes could not fit into .ANY selector(s).
Not enough information to list image symbols.
Not enough information to list load addresses in the image map.
Finished: 2 information, 0 warning and 32 error messages.
".Objectsmy_stm32f1_SPL_template.axf" - 32 Error(s), 0 Warning(s).
Target not created.
Build Time Elapsed:  00:00:08

В сообщении об ошибке говорится, что код не подходит, либо область кода недостаточна, либо область памяти недостаточна.
В этот раз выделите важность svn (если есть достоверный прогресс, сохраните его).

тестовое задание

Вернемся к до модификации.

; Vector Table Mapped to Address 0 at Reset
                AREA    RESET, DATA, READONLY
                EXPORT  __Vectors
                EXPORT  __Vectors_End
                EXPORT  __Vectors_Size

                ; IMPORT  OS_CPU_PendSVHandler
                ; IMPORT  OS_CPU_SysTickHandler 

__Vectors       DCD     __initial_sp               ; Top of Stack
                DCD     Reset_Handler              ; Reset Handler
                DCD     NMI_Handler                ; NMI Handler
                DCD     HardFault_Handler          ; Hard Fault Handler
                DCD     MemManage_Handler          ; MPU Fault Handler
                DCD     BusFault_Handler           ; Bus Fault Handler
                DCD     UsageFault_Handler         ; Usage Fault Handler
                DCD     0                          ; Reserved
                DCD     0                          ; Reserved
                DCD     0                          ; Reserved
                DCD     0                          ; Reserved
                DCD     SVC_Handler                ; SVCall Handler
                DCD     DebugMon_Handler           ; Debug Monitor Handler
                DCD     0                          ; Reserved
                DCD     PendSV_Handler        ; PendSV_Handler, PendSV Handler => OS_CPU_PendSVHandler
                DCD     SysTick_Handler       ; SysTick_Handler, SysTick Handler => OS_CPU_SysTickHandler

Откройте файл карты для создания

Перекомпилируйте программу и передайте ее.
Просмотр результатов компиляции

compiling app_hooks.c...
linking...
Program Size: Code=94472 RO-data=3872 RW-data=436 ZI-data=64508  
".Objectsmy_stm32f1_SPL_template.axf" - 0 Error(s), 0 Warning(s).
Build Time Elapsed:  00:00:07

Размер используемой области кода = Код = 94472 + RO-данные = 3872 = 98344 = 96 КБ
Используемый размер области ОЗУ на кристалле = RW-data = 436 + ZI-data = 64508 = 64944 = 63 КБ
Ресурсы STM32F103 можно найти в STMCUFinder

Доступная область кода STM32F103 = 512 КБ
Доступная область ОЗУ STM32F103 = 64 КБ
Согласно скомпилированным проектам области кода достаточно, а область памяти близка к 64 КБ. Возможно, области памяти недостаточно (если вы используете немного больше памяти, физический размер области памяти превышает Up).
Когда проект скомпилирован устаревшим, будет создан файл карты, содержащий статистику распределения использования памяти и использования кода.
Перейдите к файлу карты, чтобы увидеть, где область памяти использует большую область памяти.

Component: ARM Compiler 5.06 update 6 (build 750) Tool: armlink [4d35ed]

==============================================================================

Section Cross References

    stm32f10x_it.o(i.EXTI1_IRQHandler) refers to stm32f10x_exti.o(i.EXTI_GetITStatus) for EXTI_GetITStatus
    ...
        depilogue.o(.text) refers to llushr.o(.text) for __aeabi_llsr


==============================================================================

Removing Unused input sections from the image.

    Removing system_stm32f10x.o(i.SystemCoreClockUpdate), (164 bytes).
    ...
        Removing app_hooks.o(i.App_TimeTickHook), (2 bytes).

1025 unused section(s) (total 116499 bytes) removed from the image.

==============================================================================

Image Symbol Table

    Local Symbols

    Symbol Name                              Value     Ov Type        Size  Object(Section)

    ../clib/../cmprslib/zerorunl2.c          0x00000000   Number         0  __dczerorl2.o ABSOLUTE
    ...
        .data                                    0x20000108   Section       68  err.o(.data)
    err_strerr                               0x20000108   Data          68  err.o(.data)
    .data                                    0x2000014c   Section      100  os_core.o(.data)
    .data                                    0x200001b0   Section        4  stdout.o(.data)
    .bss                                     0x200001b4   Section     3140  my_nic.o(.bss)
    MySendbuf                                0x20000240   Data        1500  my_nic.o(.bss)
    MyRecvbuf                                0x2000081c   Data        1500  my_nic.o(.bss)
    .bss                                     0x20000df8   Section     1152  dns.o(.bss)
    dns_pcbs                                 0x20000df8   Data          16  dns.o(.bss)
    dns_table                                0x20000e08   Data        1088  dns.o(.bss)
    dns_requests                             0x20001248   Data          48  dns.o(.bss)
    .bss                                     0x20001278   Section       24  ip.o(.bss)
    .bss                                     0x20001290   Section    10259  mem.o(.bss)
         .bss 0x20003aa4 Раздел 47544 memp.o (.bss) // !!! Слишком много здесь использовано
    memp_stats_RAW_PCB                       0x20003afc   Data          16  memp.o(.bss)
    memp_stats_UDP_PCB                       0x20003bc0   Data          16  memp.o(.bss)
    memp_stats_TCP_PCB                       0x20003ee0   Data          16  memp.o(.bss)
    memp_stats_TCP_PCB_LISTEN                0x20003ff4   Data          16  memp.o(.bss)
    memp_stats_TCP_SEG                       0x20004148   Data          16  memp.o(.bss)
    memp_stats_ALTCP_PCB                     0x20004238   Data          16  memp.o(.bss)
    memp_stats_REASSDATA                     0x200049cc   Data          16  memp.o(.bss)
    memp_stats_FRAG_PBUF                     0x20004b48   Data          16  memp.o(.bss)
    memp_stats_NETBUF                        0x20004b7c   Data          16  memp.o(.bss)
    memp_stats_NETCONN                       0x20006d78   Data          16  memp.o(.bss)
    memp_stats_TCPIP_MSG_API                 0x20006e8c   Data          16  memp.o(.bss)
    memp_stats_TCPIP_MSG_INPKT               0x20006fa0   Data          16  memp.o(.bss)
    memp_stats_ARP_QUEUE                     0x200070a4   Data          16  memp.o(.bss)
    memp_stats_IGMP_GROUP                    0x20007138   Data          16  memp.o(.bss)
    memp_stats_SYS_TIMEOUT                   0x2000725c   Data          16  memp.o(.bss)
    memp_stats_NETDB                         0x200073a4   Data          16  memp.o(.bss)
    memp_stats_PBUF                          0x200074b8   Data          16  memp.o(.bss)
    memp_stats_PBUF_POOL                     0x2000f44c   Data          16  memp.o(.bss)
    .bss                                     0x2000f45c   Section      140  netif.o(.bss)
    loop_netif                               0x2000f45c   Data         140  netif.o(.bss)
    .bss                                     0x2000f4e8   Section      496  stats.o(.bss)
    .bss                                     0x2000f6d8   Section       20  tcp_in.o(.bss)
    inseg                                    0x2000f6d8   Data          20  tcp_in.o(.bss)
    .bss                                     0x2000f6ec   Section       50  dhcp.o(.bss)
    .bss                                     0x2000f720   Section      240  etharp.o(.bss)
    arp_table                                0x2000f720   Data         240  etharp.o(.bss)
    .bss                                     0x2000f810   Section      412  tcpip.o(.bss)
    tcpip_mbox                               0x2000f810   Data         412  tcpip.o(.bss)
    STACK                                    0x2000f9b0   Section     1024  startup_stm32f10x_hd.o(STACK)

    Global Symbols

    Symbol Name                              Value     Ov Type        Size  Object(Section)

    BuildAttributes$$THM_ISAv4$P$D$K$B$S$PE$A:L22UL41UL21$X:L11$S22US41US21$IEEE1$IW$USESV6$~STKCKD$USESV7$~SHL$OSPACE$ROPI$EBA8$MICROLIB$REQ8$PRES8$EABIv2 0x00000000   Number         0  anon$$obj.o ABSOLUTE
    __ARM_use_no_argv                        0x00000000   Number         0  main.o ABSOLUTE
...
    ram_heap                                 0x20001290   Data       10259  mem.o(.bss)
    memp_memory_RAW_PCB_base                 0x20003aa4   Data          87  memp.o(.bss)
    memp_memory_UDP_PCB_base                 0x20003b0c   Data         179  memp.o(.bss)
    memp_memory_TCP_PCB_base                 0x20003bd0   Data         783  memp.o(.bss)
    memp_memory_TCP_PCB_LISTEN_base          0x20003ef0   Data         259  memp.o(.bss)
    memp_memory_TCP_SEG_base                 0x20004004   Data         323  memp.o(.bss)
    memp_memory_ALTCP_PCB_base               0x20004158   Data         223  memp.o(.bss)
    memp_memory_REASSDATA_base               0x20004248   Data        1923  memp.o(.bss)
    memp_memory_FRAG_PBUF_base               0x200049dc   Data         363  memp.o(.bss)
    memp_memory_NETBUF_base                  0x20004b58   Data          35  memp.o(.bss)
    memp_memory_NETCONN_base                 0x20004b8c   Data        8683  memp.o(.bss)
    memp_memory_TCPIP_MSG_API_base           0x20006d88   Data         259  memp.o(.bss)
    memp_memory_TCPIP_MSG_INPKT_base         0x20006e9c   Data         259  memp.o(.bss)
    memp_memory_ARP_QUEUE_base               0x20006fb0   Data         243  memp.o(.bss)
    memp_memory_IGMP_GROUP_base              0x200070b4   Data         131  memp.o(.bss)
    memp_memory_SYS_TIMEOUT_base             0x20007148   Data         275  memp.o(.bss)
    memp_memory_NETDB_base                   0x2000726c   Data         311  memp.o(.bss)
    memp_memory_PBUF_base                    0x200073b4   Data         259  memp.o(.bss)
         memp_memory_PBUF_POOL_base 0x200074c8 Data 32643 memp.o (.bss) // Далее вы можете видеть, что переменная (массив) memp_memory_PBUF_POOL_base использовала 30 КБ
    lwip_stats                               0x2000f4e8   Data         496  stats.o(.bss)
    dhcp_rx_options_val                      0x2000f6ec   Data          40  dhcp.o(.bss)
    dhcp_rx_options_given                    0x2000f714   Data          10  dhcp.o(.bss)
    __initial_sp                             0x2000fdb0   Data           0  startup_stm32f10x_hd.o(STACK)



==============================================================================

Memory Map of the image

  Image Entry point : 0x08000131

  Load Region LR_IROM1 (Base: 0x08000000, Size: 0x000181dc, Max: 0x00080000, ABSOLUTE, COMPRESSED[0x00018070])

    Execution Region ER_IROM1 (Exec base: 0x08000000, Load base: 0x08000000, Size: 0x00018028, Max: 0x00080000, ABSOLUTE)

    Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object

    0x08000000   0x08000000   0x00000130   Data   RO         3836    RESET               startup_stm32f10x_hd.o
    0x08000130   0x08000130   0x00000000   Code   RO         9413  * .ARM.Collect$$$$00000000  mc_w.l(entry.o)
...
    0x08018008   0x08018008   0x00000020   Data   RO         9784    Region$$Table       anon$$obj.o


    Execution Region RW_IRAM1 (Exec base: 0x20000000, Load base: 0x08018028, Size: 0x0000fdb0, Max: 0x00010000, ABSOLUTE, COMPRESSED[0x00000048])

    Exec Addr    Load Addr    Size         Type   Attr      Idx    E Section Name        Object

    0x20000000   COMPRESSED   0x00000008   Data   RW          694    .data               enc28j60.o
    ...
        0x2000f9ac   COMPRESSED   0x00000004   PAD
    0x2000f9b0        -       0x00000400   Zero   RW         3834    STACK               startup_stm32f10x_hd.o


==============================================================================

Image component sizes


      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Object Name

         0          0          0          0          0       5271   altcp.o
         0          0          0          0          0       7832   altcp_alloc.o
      2094        964         84          0          0      13456   autoip.o
         0          0          0          0          0       4599   bridgeif.o
         0          0          0          0          0         32   core_cm3.o
        38          0          0          0          0       3030   def.o
     11490       4898        286         16         50      28572   dhcp.o
      1594        496          0         12       1152      11817   dns.o
      1198         86          0          8          0       8167   enc28j60.o
        48         22        313         68          0       1150   err.o
      4132       1088         65          1        240      12280   etharp.o
       560        130         12          0          0       2578   ethernet.o
       502        230          6          0          0      13080   ethernetif.o
      2376       1026          0          0          0       4722   icmp.o
      2804       1178        257          8          0      10299   igmp.o
       828         78          0          0          0       7328   inet_chksum.o
       140         64         65          0          0      16118   init.o
         0          0          0          0         24       8317   ip.o
      4680       1558        303          8          0      10250   ip4.o
        78          0          8          0          0       9134   ip4_addr.o
      3918       1340          0          6          0      11746   ip4_frag.o
       746         92        184          0          0      19003   main.o
      3148       1270          0         16      10259      10698   mem.o
       820        426        636         72      47544      11984   memp.o
       132         22          0          0          0       1619   misc.o
       456        178          0          0       3140       4765   my_nic.o
      4026       1624          0         14        140      22550   netif.o
         0          0          0        100          0       9496   os_core.o
      5100       2260        141          1          0      20119   pbuf.o
       352         80         73          4          0       7571   raw.o
       148         12          0          0          0       8097   spi.o
        36          8        304          0       1024        816   startup_stm32f10x_hd.o
        20         10          0          0        496       5370   stats.o
       200         18          0          0          0       2220   stm32f10x_exti.o
       350          4          0          0          0       3786   stm32f10x_gpio.o
        54          4         65          0          0     256538   stm32f10x_it.o
        32          6          0          0          0        597   stm32f10x_rcc.o
       112          0          0          0          0       3998   stm32f10x_spi.o
       260         34          0          0          0      16637   sys_arch.o
       328         28          0          0          0       1957   system_stm32f10x.o
     10276       4826        189         32          0      35213   tcp.o
     12076       3908        152         40         20      31967   tcp_in.o
      8494       3614        521          0          0      27934   tcp_out.o
       396        170          0          0        412       5015   tcpip.o
       704        308         68         12          0       5505   timeouts.o
      5710       2390         73          8          0      14144   udp.o

    ----------------------------------------------------------------------
     90502      34450       3872        432      64508     717377   Object Totals
         0          0         32          0          0          0   (incl. Generated)
        46          0         35          6          7          0   (incl. Padding)

    ----------------------------------------------------------------------

      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Library Member Name

        86          0          0          0          0          0   __dczerorl2.o
         0          0          0          0          0          0   entry.o
         0          0          0          0          0          0   entry10a.o
         0          0          0          0          0          0   entry11a.o
         8          4          0          0          0          0   entry2.o
         4          0          0          0          0          0   entry5.o
         0          0          0          0          0          0   entry7b.o
         0          0          0          0          0          0   entry8b.o
         8          4          0          0          0          0   entry9a.o
        30          0          0          0          0          0   handlers.o
        36          8          0          0          0         68   init.o
         0          0          0          0          0          0   iusefp.o
        30          0          0          0          0         68   llshl.o
        36          0          0          0          0         68   llsshr.o
        32          0          0          0          0         68   llushr.o
        26          0          0          0          0         80   memcmp.o
        64          0          0          0          0         76   memmovea.o
        36          0          0          0          0        108   memseta.o
      2324         94          0          0          0        600   printfa.o
         0          0          0          4          0          0   stdout.o
        14          0          0          0          0         68   strlen.o
        24          0          0          0          0         76   strncpy.o
        44          0          0          0          0         80   uidiv.o
        98          0          0          0          0         92   uldiv.o
        48          0          0          0          0         68   cdrcmple.o
       334          0          0          0          0        148   dadd.o
       222          0          0          0          0        100   ddiv.o
       186          0          0          0          0        176   depilogue.o
        48          0          0          0          0         68   dfixul.o
       228          0          0          0          0         96   dmul.o

    ----------------------------------------------------------------------
      3970        110          0          4          0       2108   Library Totals
         4          0          0          0          0          0   (incl. Padding)

    ----------------------------------------------------------------------

      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   Library Name

      2900        110          0          4          0       1452   mc_w.l
      1066          0          0          0          0        656   mf_w.l

    ----------------------------------------------------------------------
      3970        110          0          4          0       2108   Library Totals

    ----------------------------------------------------------------------

==============================================================================


      Code (inc. data)   RO Data    RW Data    ZI Data      Debug   

     94472      34560       3872        436      64508     700997   Grand Totals
     94472      34560       3872         72      64508     700997   ELF Image Totals (compressed)
     94472      34560       3872         72          0          0   ROM Totals

==============================================================================

    Total RO  Size (Code + RO Data)                98344 (  96.04kB)
    Total RW  Size (RW Data + ZI Data)             64944 (  63.42kB)
    Total ROM Size (Code + RO Data + RW Data)      98416 (  96.11kB)

==============================================================================





Обнаружено узкое место использования памяти
.bss 0x20003aa4 Раздел 47544 memp.o (.bss) // !!! Слишком много здесь использовано
memp.o использует 40 КБ памяти.

ram_heap                                 0x20001290   Data       10259  mem.o(.bss)
memp_memory_NETCONN_base                 0x20004b8c   Data        8683  memp.o(.bss)
memp_memory_PBUF_POOL_base 0x200074c8 Data 32643 memp.o (.bss) // Далее вы можете видеть, что переменная (массив) memp_memory_PBUF_POOL_base использовала 30 КБ

  3148       1270          0         16      10259      10698   mem.o
   820        426        636         72      47544      11984   memp.o

Если посмотреть на файл карты, вся используемая память находится в lwip.
memp_memory_PBUF_POOL_base использовано 30 КБ
ram_heap использовано 10 КБ
memp_memory_NETCONN_base использовано 8 КБ
Посмотрите на код и посмотрите, как определены эти 3 переменные. Эти пространства RAM необходимы.

// ram_heap
#define SIZEOF_STRUCT_MEM    LWIP_MEM_ALIGN_SIZE(sizeof(struct mem))
#define MEM_SIZE_ALIGNED     LWIP_MEM_ALIGN_SIZE(MEM_SIZE)
#define MEM_SIZE               10240

LWIP_DECLARE_MEMORY_ALIGNED(ram_heap, MEM_SIZE_ALIGNED + (2U * SIZEOF_STRUCT_MEM));

// memp_memory_NETCONN_base
#define MEMP_NUM_NETCONN        10
LWIP_MEMPOOL(NETCONN,        MEMP_NUM_NETCONN,         sizeof(struct netconn),        "NETCONN")
#define LWIP_MEMPOOL(name,num,size,desc) LWIP_MEMPOOL_DECLARE(name,num,size,desc)

#define LWIP_MEMPOOL_DECLARE(name,num,size,desc) 
  LWIP_DECLARE_MEMORY_ALIGNED(memp_memory_ ## name ## _base, ((num) * (MEMP_SIZE + MEMP_ALIGN_SIZE(size)))); 
    
  LWIP_MEMPOOL_DECLARE_STATS_INSTANCE(memp_stats_ ## name) 
    
  static struct memp *memp_tab_ ## name; 
    
  const struct memp_desc memp_ ## name = { 
    DECLARE_LWIP_MEMPOOL_DESC(desc) 
    LWIP_MEMPOOL_DECLARE_STATS_REFERENCE(memp_stats_ ## name) 
    LWIP_MEM_ALIGN_SIZE(size), 
    (num), 
    memp_memory_ ## name ## _base, 
    &memp_tab_ ## name 
  };

// memp_memory_PBUF_POOL_base
LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE,           PBUF_POOL_BUFSIZE,             "PBUF_POOL")
/* PBUF_POOL_SIZE: the number of buffers in the pbuf pool. */
#define PBUF_POOL_SIZE          120

/* PBUF_POOL_BUFSIZE: the size of each pbuf in the pbuf pool. */
#define PBUF_POOL_BUFSIZE       256

Видно, что это параметры производительности, которые lwip использует для управления макросами.
#define MEM_SIZE 10240
#define MEMP_NUM_NETCONN 10
#define PBUF_POOL_SIZE 120
#define PBUF_POOL_BUFSIZE 256
Не смейте его менять. Если эти макросы уменьшены, производительность lwip снизится (количество подключений, которые можно подключить).
Но если ресурсов недостаточно, можно использовать только два метода:

  • Измените MCU на совместимый вывод с большим количеством ресурсов, например STM32F103VE => STM32F103VG, если это возможно на продукте, то есть припаяйте новую модель, полностью совместимый MCU. Я пробовал, смените на STM32F103VG, вы можете скомпилировать Over.

  • Измените параметры конфигурации lwip, чтобы без задержки для тестирования уменьшить объем памяти, необходимый для тестирования.
    ** Если вы экспериментируете дома, ничего нет, если у вас только плата для разработки, вы можете изменить параметры конфигурации только небольшого LWIP.

Перед модификацией:
.Objectsmy_stm32f1_SPL_template.axf: Error: L6407E: Sections of aggregate size 0x3ecc bytes could not fit into .ANY selector(s).
Не может поместиться около 16 КБ.

// Меняем MEMP_NUM_NETCONN с 10 на 5
#define MEMP_NUM_NETCONN 5
.Objectsmy_stm32f1_SPL_template.axf: Error: L6407E: Sections of aggregate size 0xfa8 bytes could not fit into .ANY selector(s).
Еще около 4 КБ не помещается, а использование памяти снизилось.

// PBUF_POOL_SIZE изменен со 120 на 96 (8 * 12)
#define PBUF_POOL_SIZE 96
имеет следующую ошибку компиляции

#if !MEMP_MEM_MALLOC && PBUF_POOL_SIZE && (TCP_WND > (PBUF_POOL_SIZE * (PBUF_POOL_BUFSIZE - (PBUF_LINK_ENCAPSULATION_HLEN + PBUF_LINK_HLEN + PBUF_IP_HLEN + PBUF_TRANSPORT_HLEN))))
#error "lwip_sanity_check: WARNING: TCP_WND is larger than space provided by PBUF_POOL_SIZE * (PBUF_POOL_BUFSIZE - protocol headers). If you know what you are doing, define LWIP_DISABLE_TCP_SANITY_CHECKS to 1 to disable this error."
#endif


/* TCP receive window. */
#define TCP_WND (20 * 1024)
попробуйте изменить TCP_WND

#define TCP_WND                 (18 * 1024)

На этот раз он был составлен.

Поскольку после трансплантации ucos логика программы должна записывать пробел, попробуйте изменить MEM_SIZE
Обратите внимание на то, что определение MEM_SIZE в opt.h по умолчанию — 1600.
Уменьшить MEM_SIZE на 4 КБ
#define MEM_SIZE (6 * 1024)

Теперь, когда компиляция завершена, посмотрите на использование памяти и оставшиеся условия.
Total RW Size (RW Data + ZI Data) 58912 ( 57.53kB)
Теперь осталось 6,47 КБ (64–57,53 КБ) для написания логики для основной программы.

Теперь посмотрим на RAM, занятую переменными памяти в глобальных символах.
В следующей таблице четвертый столбец — это размер (мы рассматриваем только переменные выше 200 Б), а третий столбец — это тип данных (мы рассматриваем только переменные типа памяти).

    Global Symbols

    Symbol Name                              Value     Ov Type        Size  Object(Section)

    OSUnMapTbl                               0x08017920   Data         256  os_core.o(.constdata)
    ram_heap                                 0x20001298   Data        6163  mem.o(.bss)
    memp_memory_TCP_PCB_base                 0x20002bd8   Data         783  memp.o(.bss)
    memp_memory_TCP_PCB_LISTEN_base          0x20002ef8   Data         259  memp.o(.bss)
    memp_memory_TCP_SEG_base                 0x2000300c   Data         323  memp.o(.bss)
    memp_memory_ALTCP_PCB_base               0x20003160   Data         223  memp.o(.bss)
    memp_memory_REASSDATA_base               0x20003250   Data        1923  memp.o(.bss)
    memp_memory_FRAG_PBUF_base               0x200039e4   Data         363  memp.o(.bss)
    memp_memory_NETCONN_base                 0x20003b94   Data        4343  memp.o(.bss)
    memp_memory_TCPIP_MSG_API_base           0x20004c9c   Data         259  memp.o(.bss)
    memp_memory_TCPIP_MSG_INPKT_base         0x20004db0   Data         259  memp.o(.bss)
    memp_memory_ARP_QUEUE_base               0x20004ec4   Data         243  memp.o(.bss)
    memp_memory_SYS_TIMEOUT_base             0x2000505c   Data         275  memp.o(.bss)
    memp_memory_NETDB_base                   0x20005180   Data         311  memp.o(.bss)
    memp_memory_PBUF_base                    0x200052c8   Data         259  memp.o(.bss)
    memp_memory_PBUF_POOL_base               0x200053dc   Data       26115  memp.o(.bss)
    lwip_stats                               0x2000ba7c   Data         496  stats.o(.bss)
    OSEventTbl                               0x2000bf40   Data        4200  os_core.o(.bss)
    OSTaskStatStk                            0x2000cff8   Data         512  os_core.o(.bss)
    OSTaskIdleStk                            0x2000d1f8   Data         512  os_core.o(.bss)
    OSTCBPrioTbl                             0x2000d3f8   Data         256  os_core.o(.bss)
    OSTCBTbl                                 0x2000d4f8   Data        1936  os_core.o(.bss)
    OSTmrTbl                                 0x2000dd60   Data         640  os_core.o(.bss)
    OSTmrTaskStk                             0x2000dfe0   Data         512  os_core.o(.bss)

Вы можете видеть, что использование памяти самой большой головы уменьшилось.
ram_heap => 6163B
memp_memory_NETCONN_base => 4343B
memp_memory_PBUF_POOL_base => 26115B
Если это формальная программа, эти параметры по-прежнему нельзя изменить, в противном случае производительность снизится, например, размер PBUF_POOL станет меньше, тогда во время связи, после того, как мощность обработки превышена, если он не застревает, это необходимо Без потери пакетов.

** Если дома есть другие платы разработки (например, микроконтроллеры высокого класса), вы можете перейти на другую плату разработки для экспериментов. Но этот тест является lwip-тестом, который связан с сетевой картой. Если плата заменена, а сетевая карта другая, драйвер сетевой карты должен быть повторно адаптирован для lwip. Это требует времени. До сих пор пользуюсь методом изменения параметров.

Hi.

I’m trying to declare an uint16_t array while programming on the NRF52 Development kit as follows :

uint16_t FinalSignalArray[225000];

However, I keep getting the following errors:

._buildnrf52832_xxaa.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(.bss).
._buildnrf52832_xxaa.axf: Error: L6406E: No space in execution regions with .ANY selector matching arm_startup_nrf52.o(STACK).
._buildnrf52832_xxaa.axf: Error: L6406E: No space in execution regions with .ANY selector matching app_uart_fifo.o(.bss).
._buildnrf52832_xxaa.axf: Error: L6406E: No space in execution regions with .ANY selector matching nrf_drv_uart.o(.bss).
._buildnrf52832_xxaa.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(.data).
._buildnrf52832_xxaa.axf: Error: L6406E: No space in execution regions with .ANY selector matching app_uart_fifo.o(.data).
._buildnrf52832_xxaa.axf: Error: L6406E: No space in execution regions with .ANY selector matching system_nrf52.o(.data).
._buildnrf52832_xxaa.axf: Error: L6406E: No space in execution regions with .ANY selector matching errno.o(.data).
._buildnrf52832_xxaa.axf: Error: L6407E: Sections of aggregate size 0x6ff28 bytes could not fit into .ANY selector(s).

What should I do ? Please advise. :(

  • Wojtek

    I am not sure, but that error may occur because that declaration tries to reserve 450kB in RAM, while nRF52 has 64kB RAM.

  • Muhammad Ahmad Shah

    So does that mean that I cannot declare any such Array ? But I don’t have much of a choice because my system needs an Array of size 225,000.

  • Wojtek

    You can try to store it somewhere else, like in some external memory.
    Or if this is read-only array, you can allocate it in ROM memory instead (nRF52 has 512kB ROM as far as i remember), but you have to define it’s values.

  • Muhammad Ahmad Shah

    Fortunately, I have the values. How do I define the array to be stored in ROM ?

  • Wojtek

    Probably something like that:

    const uint16_t FinalSignalArray[10] = { 1, 2, 3, 4, 6, 7, 8, 9, 10};
    

    But your array will be a bit longer.

Доброго времени суток. Пытаюсь подключить дисплей с разрешением 800х480 по интерфейсу RGB565 к контроллеру stm32f767zit без использования внешней SRAM памяти. Пользуюсь связкой CubeMX и Keil uVision. При инициализации массива памяти:

volatile uint32_t RGB565[192000] = {0x00000000};

в конечном итоге Keil выдаёт ошибки при компиляции:

767767.axf: Error: L6406E: No space in execution regions with .ANY selector matching main.o(.bss).
767767.axf: Error: L6406E: No space in execution regions with .ANY selector matching startup_stm32f767xx.o(STACK).
767767.axf: Error: L6406E: No space in execution regions with .ANY selector matching stm32f7xx_hal.o(.data).
767767.axf: Error: L6406E: No space in execution regions with .ANY selector matching system_stm32f7xx.o(.data).
767767.axf: Error: L6407E: Sections of aggregate size 0xbf93c bytes could not fit into .ANY selector(s).
Not enough information to list image symbols.
Not enough information to list the image map.
Finished: 2 information, 0 warning and 5 error messages.
"767767.axf" - 5 Error(s), 0 Warning(s).

Размер необходимого буффера, если я не ошибаюсь, 480*800*2=6144000 бит. Насколько мне известно, у данного микроконтроллера есть необходимая память. Можно ли как либо её использовать, и если да, то как?

Понравилась статья? Поделить с друзьями:
  • Error l6235e more than one section matches selector cannot all be first last
  • Error l6218e undefined symbol main referred from rtentry2 o
  • Error l6218e undefined symbol apbpresctable
  • Error l6200e keil
  • Error l6031u could not open scatter description file