Help with compiling for qemu ARM cortex m3


Priyanka
 

Hi 


I tried to compile my sample application code for the target
BOARD ?= qemu_cortex_m3

It compiles for qemu_x86 however for qemu_cortex_m3 it gives me errors related to SRAM overflowed.

$zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-zephyr-eabi/gcc/arm-zephyr-eabi/6.2.0/real-ld: zephyr_prebuilt.elf section `noinit' will not fit in region `SRAM'
$zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-zephyr-eabi/gcc/arm-zephyr-eabi/6.2.0/real-ld: section .intList VMA [0000000020010000,0000000020010043] overlaps section noinit VMA [000000002000d5a0,000000002002413b]
$zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-zephyr-eabi/gcc/arm-zephyr-eabi/6.2.0/real-ld: region `SRAM' overflowed by 82236 bytes
collect2: error: ld returned 1 exit status
$zephyr/Makefile:878: recipe for target 'zephyr_prebuilt.elf' failed


I test with the recent zephyr version (master branch).
In dts/arm/ti/lm3s6965.dtsi the SRAM for qemu_cortex_m3 defined is 64 KB.

I can manage to compile for qemu_cortex_m3  by increasing the value of SRAM from 64 KB to 128 KB in
dts/arm/ti/lm3s6965.dtsi

sram0: memory@20000000 {
        device_type = "memory";
        compatible = "mmio-sram";
        reg = <0x20000000 (64*1024)>;    
};

However, I want to test with the same
SRAM value as in real hardware (e.g., eventually I want to test with KW41Z board). So instead of increasing the current SRAM value, I would rather modify proj.conf.
 
Could someone please tell me what would be the right approach to address this issue of SRAM overflow for qemu ARM ?

Thanks
Priyanka



Kumar Gala
 

On Sep 7, 2017, at 4:37 AM, Priyanka Rawat <priyanka.rawat@nxp.com> wrote:

Hi

I tried to compile my sample application code for the target
BOARD ?= qemu_cortex_m3

It compiles for qemu_x86 however for qemu_cortex_m3 it gives me errors related to SRAM overflowed.

$zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-zephyr-eabi/gcc/arm-zephyr-eabi/6.2.0/real-ld: zephyr_prebuilt.elf section `noinit' will not fit in region `SRAM'
$zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-zephyr-eabi/gcc/arm-zephyr-eabi/6.2.0/real-ld: section .intList VMA [0000000020010000,0000000020010043] overlaps section noinit VMA [000000002000d5a0,000000002002413b]
$zephyr-sdk/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-zephyr-eabi/gcc/arm-zephyr-eabi/6.2.0/real-ld: region `SRAM' overflowed by 82236 bytes
collect2: error: ld returned 1 exit status
$zephyr/Makefile:878: recipe for target 'zephyr_prebuilt.elf' failed


I test with the recent zephyr version (master branch).
In dts/arm/ti/lm3s6965.dtsi the SRAM for qemu_cortex_m3 defined is 64 KB.

I can manage to compile for qemu_cortex_m3 by increasing the value of SRAM from 64 KB to 128 KB in
dts/arm/ti/lm3s6965.dtsi

sram0: memory@20000000 {
device_type = "memory";
compatible = "mmio-sram";
reg = <0x20000000 (64*1024)>;
};

However, I want to test with the same SRAM value as in real hardware (e.g., eventually I want to test with KW41Z board). So instead of increasing the current SRAM value, I would rather modify proj.conf.

Could someone please tell me what would be the right approach to address this issue of SRAM overflow for qemu ARM ?

Thanks
Priyanka
I don’t believe there is a way to change the amount of memory in qemu. Even with switching to the KW41Z guess you are going to run into memory issues (as it has 128k). So are you building your own application or one of the samples/tests? You can try and remove config options to reduce memory, but if you are 82K overflowing than I’m guessing you need to look at how your application is utilizing memory and see if you can reduce that.

- k


Boie, Andrew P
 

However, I want to test with the same SRAM value as in real hardware (e.g.,
eventually I want to test with KW41Z board). So instead of increasing the current
SRAM value, I would rather modify proj.conf.

Could someone please tell me what would be the right approach to address
this issue of SRAM overflow for qemu ARM ?
"make ram_report" and "make rom_report" dump out some helpful information to see what in your code is using so much memory.

Andrew


Vakul Garg <vakul.garg@...>
 

Hi Andrew

The suggested commands are very useful.
Thanks for your advice.

Regards, Vakul

-----Original Message-----
From: zephyr-users-bounces@lists.zephyrproject.org [mailto:zephyr-users-bounces@lists.zephyrproject.org] On Behalf Of Boie, Andrew P
Sent: Thursday, September 07, 2017 9:39 PM
To: Kumar Gala <kumar.gala@linaro.org>; Priyanka Rawat <priyanka.rawat@nxp.com>
Cc: zephyr-users@lists.zephyrproject.org
Subject: Re: [Zephyr-users] Help with compiling for qemu ARM cortex m3

However, I want to test with the same SRAM value as in real hardware
(e.g.,
eventually I want to test with KW41Z board). So instead of increasing
the current SRAM value, I would rather modify proj.conf.

Could someone please tell me what would be the right approach to
address
this issue of SRAM overflow for qemu ARM ?
"make ram_report" and "make rom_report" dump out some helpful information to see what in your code is using so much memory.

Andrew
_______________________________________________
Zephyr-users mailing list
Zephyr-users@lists.zephyrproject.org
https://lists.zephyrproject.org/mailman/listinfo/zephyr-users