boards: arm: add QEMU support for Cortex-M0

This commit defines qemu_cortex_m0 board, adding
support for Cortex-M0 in QEMU. The added platform
is based on the (nRF51) bbc_microbit board.

Signed-off-by: Ioannis Glaropoulos <Ioannis.Glaropoulos@nordicsemi.no>
This commit is contained in:
Ioannis Glaropoulos 2019-09-30 13:59:47 +02:00 committed by Anas Nashif
parent 7c26c17be6
commit 3ddd5ebb02
6 changed files with 151 additions and 0 deletions

View file

@ -0,0 +1,10 @@
# Kconfig - QEMU Cortex-M0 board configuration
#
# Copyright (c) 2019 Nordic Semiconductor ASA.
#
# SPDX-License-Identifier: Apache-2.0
config BOARD_QEMU_CORTEX_M0
bool "Cortex-M0 Emulation (QEMU)"
depends on SOC_NRF51822_QFAA
select QEMU_TARGET

View file

@ -0,0 +1,12 @@
# Kconfig - QEMU Cortex-M0 board configuration
#
# Copyright (c) 2019 Nordic Semiconductor ASA.
#
# SPDX-License-Identifier: Apache-2.0
if BOARD_QEMU_CORTEX_M0
config BOARD
default "qemu_cortex_m0"
endif # BOARD_QEMU_CORTEX_M0

View file

@ -0,0 +1,16 @@
#
# Copyright (c) 2019, Nordic Semiconductor ASA
#
# SPDX-License-Identifier: Apache-2.0
set(EMU_PLATFORM qemu)
set(QEMU_CPU_TYPE_${ARCH} cortex-m0)
set(QEMU_FLAGS_${ARCH}
-cpu ${QEMU_CPU_TYPE_${ARCH}}
-machine microbit
-nographic
-vga none
)
board_set_debugger_ifnset(qemu)

View file

@ -0,0 +1,72 @@
/*
* Copyright (c) 2019 Nordic Semiconductor ASA
*
* SPDX-License-Identifier: Apache-2.0
*/
/dts-v1/;
#include <nordic/nrf51822_qfaa.dtsi>
/ {
model = "QEMU Cortex-M0";
compatible = "nordic,nrf51822-qfaa", "nordic,nrf51822";
chosen {
zephyr,console = &uart0;
zephyr,shell-uart = &uart0;
zephyr,bt-mon-uart = &uart0;
zephyr,bt-c2h-uart = &uart0;
zephyr,sram = &sram0;
zephyr,flash = &flash0;
zephyr,code-partition = &slot0_partition;
};
};
&gpiote {
status = "okay";
};
&gpio0 {
status = "okay";
};
&uart0 {
status = "okay";
current-speed = <115200>;
tx-pin = <24>;
rx-pin = <25>;
};
&flash0 {
/*
* For more information, see:
* http://docs.zephyrproject.org/latest/guides/dts/index.html#flash-partitions
*/
partitions {
compatible = "fixed-partitions";
#address-cells = <1>;
#size-cells = <1>;
boot_partition: partition@0 {
label = "mcuboot";
reg = <0x00000000 0x8000>;
};
slot0_partition: partition@8000 {
label = "image-0";
reg = <0x00008000 0x1a000>;
};
slot1_partition: partition@22000 {
label = "image-1";
reg = <0x00022000 0x1a000>;
};
scratch_partition: partition@3c000 {
label = "image-scratch";
reg = <0x0003c000 0x2000>;
};
storage_partition: partition@3e000 {
label = "storage";
reg = <0x0003e000 0x00002000>;
};
};
};

View file

@ -0,0 +1,16 @@
identifier: qemu_cortex_m0
name: QEMU Emulation for Cortex-M0
type: qemu
simulation: qemu
arch: arm
toolchain:
- zephyr
- gnuarmemb
- xtools
ram: 16
flash: 256
testing:
default: true
ignore_tags:
- net
- bluetooth

View file

@ -0,0 +1,25 @@
# SPDX-License-Identifier: Apache-2.0
CONFIG_ARM=y
CONFIG_SOC_FAMILY_NRF=y
CONFIG_SOC_SERIES_NRF51X=y
CONFIG_SOC_NRF51822_QFAA=y
CONFIG_BOARD_QEMU_CORTEX_M0=y
# enable GPIO
CONFIG_GPIO=y
# clock control
CONFIG_CLOCK_CONTROL_NRF_K32SRC_RC=y
CONFIG_CLOCK_CONTROL_NRF_K32SRC_250PPM=y
# enable uart driver
CONFIG_SERIAL=y
CONFIG_UART_0_NRF_UART=y
# enable console
CONFIG_CONSOLE=y
CONFIG_UART_CONSOLE=y
# logging
CONFIG_LOG_BUFFER_SIZE=128