zephyrproject-rtos / zephyr

Primary Git Repository for the Zephyr Project. Zephyr is a new generation, scalable, optimized, secure RTOS for multiple hardware architectures.
https://docs.zephyrproject.org
Apache License 2.0
10.98k stars 6.69k forks source link

Increase qemu-nios2 memory size #35758

Open stephanosio opened 3 years ago

stephanosio commented 3 years ago

Is your enhancement proposal related to a problem? Please describe. The flash and RAM size for the qemu-nios2 platform is insufficient for running some tests (for instance, C++ tests; see #32448). Since it doesn't really cost us anything to increase the flash and RAM size of an emulated platform, do it.

Describe the solution you'd like

  1. In QEMU, add a virtual testing platform based on altera_10m50_zephyr with more flash and RAM (see https://github.com/zephyrproject-rtos/sdk-ng/blob/aaa5f956759a1a380bb1c18a59c6705bf80c4d01/meta-zephyr-sdk/recipes-devtools/qemu/files/0004-qemu-nios2-Add-Altera-MAX-10-board-support-for-Zephy.patch).
  2. Make Zephyr qemu_nios2 board make use of that virtual testing platform.
stephanosio commented 3 years ago

cc @galak @nashif @tejlmand

galak commented 3 years ago

@stephanosio will the qemu6 update in SDK 0.13.0 address this issue?

stephanosio commented 3 years ago

@stephanosio will the qemu6 update in SDK 0.13.0 address this issue?

qemu_nios2 is using a custom QEMU machine (i.e. altera_10m50_zephyr) that is not available in upstream, so upgrading to qemu6 won't fix this issue.

The problem is that the QEMU RAM (note that qemu_nios2 emulates XIP by loading both "flash" and "RAM" sections into the QEMU RAM) is too small to load the current C++-capable Zephyr image, so we will need something like https://github.com/zephyrproject-rtos/zephyr/issues/35772#issuecomment-850402529 to be able to run C++ tests on qemu_nios2.

I will submit the relevant patches to sdk-ng and Zephyr to address this later.