This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Used 25% of memory, but the program restarts due to insufficient memory

At the very beginning of the program in the main function, my stack pointer is 0x20026390, although I expected it to be in the 0x20040000 area.

In this case, static memory is used 26% - 35072 bytes.
Those. my static memory should be in the memory area 0x20020000 - 0x20028900, it turns out that I have already crossed the memory boundary by the stack pointer

The question arises, what could this be related to? I did not change the memory configuration in any way, i.e. sram0_ns is used with a size of 128 KB

Kind regards,

Yuri

Parents
  • Now I looked at the file zephyr.dts This is how the memory is ultimately allocated

    chosen {
    	zephyr,flash-controller = &flash_controller;
    	zephyr,entropy = &cryptocell_sw;
    	zephyr,console = &uart0;
    	zephyr,shell-uart = &uart0;
    	zephyr,uart-mcumgr = &uart0;
    	zephyr,flash = &flash0;
    	zephyr,sram = &sram0_ns;
    	zephyr,code-partition = &slot0_ns_partition;
    	zephyr;
    };
    
    ...
    
    sram0: memory@20000000 {
    	compatible = "mmio-sram";
    	reg = < 0x20000000 0x40000 >;
    };
    
    ...
    
    reserved-memory {
    	#address-cells = < 0x1 >;
    	#size-cells = < 0x1 >;
    	ranges;
    	sram0_s: image_s@20000000 {
    		reg = < 0x20000000 0x10000 >;
    	};
    	sram0_bsd: image_bsd@20010000 {
    		reg = < 0x20010000 0x10000 >;
    	};
    	sram0_ns: image_ns@20020000 {
    		reg = < 0x20020000 0x20000 >;
    	};
    };

Reply
  • Now I looked at the file zephyr.dts This is how the memory is ultimately allocated

    chosen {
    	zephyr,flash-controller = &flash_controller;
    	zephyr,entropy = &cryptocell_sw;
    	zephyr,console = &uart0;
    	zephyr,shell-uart = &uart0;
    	zephyr,uart-mcumgr = &uart0;
    	zephyr,flash = &flash0;
    	zephyr,sram = &sram0_ns;
    	zephyr,code-partition = &slot0_ns_partition;
    	zephyr;
    };
    
    ...
    
    sram0: memory@20000000 {
    	compatible = "mmio-sram";
    	reg = < 0x20000000 0x40000 >;
    };
    
    ...
    
    reserved-memory {
    	#address-cells = < 0x1 >;
    	#size-cells = < 0x1 >;
    	ranges;
    	sram0_s: image_s@20000000 {
    		reg = < 0x20000000 0x10000 >;
    	};
    	sram0_bsd: image_bsd@20010000 {
    		reg = < 0x20010000 0x10000 >;
    	};
    	sram0_ns: image_ns@20020000 {
    		reg = < 0x20020000 0x20000 >;
    	};
    };

Children
No Data
Related