Part 1
요약·해설
각 MCU를 따로 빌드하거나 CONFIG_NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS 또는 sysbuild로 두 이미지를 결합할 수 있습니다. 이 결과물은 임베디드 바이너리가 아닙니다.
nrf5340/cpuapp
nrf5340/cpunet
TrustZone·SPU·TF-M 미지원
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
4B988CA77644CEA4B0910F5B3596CD45CE80ED68A7B674F9F6BD644B045B2020
.. _nrf5340bsim:
NRF5340 simulated boards (BabbleSim)
####################################
.. contents::
:depth: 1
:backlinks: entry
:local:
Overview
********
To allow simulating nrf5340 SOCs two Zephyr target boards are provided: the
``nrf5340bsim/nrf5340/cpuapp`` and ``nrf5340bsim/nrf5340/cpunet``.
These use `BabbleSim`_ to simulate the radio activity, and the
:ref:`POSIX architecture<Posix arch>` and the `native simulator`_ to
run applications natively on the development system. This has the benefit of
providing native code execution performance and easy debugging using
native tools, but inherits :ref:`its limitations <posix_arch_limitations>`.
Just like for the nrf5340dk targets,
the nrf5340bsim/nrf5340/cpuapp build target provides support for the application core,
and the nrf5340bsim/nrf5340/cpunet build target provides support for the network
core on the simulated nRF5340 SOC.
These boards include models of some of the nRF5340 SOC peripherals:
* AAR (Accelerated Address Resolver)
* AES CCM & AES ECB encryption HW
* CLOCK (Clock control)
* DPPI (Distributed Programmable Peripheral Interconnect)
* EGU (Event Generator Unit)
* FICR (Factory Information Configuration Registers)
* IPC (Interprocessor communication)
* MUTEX (Mutual exclusive peripheral)
* NVMC (Non-Volatile Memory Controller / Flash)
* RADIO
* RNG (Random Number Generator)
* RTC (Real Time Counter)
* TEMP (Temperature sensor)
* TIMER
* UICR (User Information Configuration Registers)
and will use the same drivers as the nrf5340dk targets for these.
For more information on what is modelled to which level of detail,
check the `HW models implementation status`_.
Note that unlike a real nrf5340 device, the nrf5340bsim boards have unlimited RAM and flash for
code.
.. _BabbleSim:
https://BabbleSim.github.io
.. _native simulator:
https://github.com/BabbleSim/native_simulator/blob/main/docs/README.md
.. _HW models implementation status:
https://github.com/BabbleSim/ext_nRF_hw_models/blob/main/docs/README_impl_status.md
Building for, and using these boards
************************************
If you are interested in developing on only one of the MCUs in this SOC, you
can use the corresponding simulated target, nrf5340bsim/nrf5340/cpuapp or nrf5340bsim/nrf5340/cpunet
following the instructions from the :ref:`nrf52_bsim board <nrf52bsim_build_and_run>`.
Simply change the board/target appropriately when building.
.. note::
Unlike in real HW, the net core MCU is set-up to automatically boot at start, to facilitate
developing without an image in the application core. You can control
this with either :kconfig:option:`CONFIG_NATIVE_SIMULATOR_AUTOSTART_MCU`, or the command line
option ``--cpu1_autostart``.
If an MCU is booted without any image, it will automatically set itself to sleep.
Assembling both MCUs images into a single executable
****************************************************
By default, when you build targeting either nrf5340bsim/nrf5340/cpuapp or
nrf5340bsim/nrf5340/cpunet you will end up with a library (``zephyr/zephyr.elf``) that corresponds
to that MCU code image, and an executable (``zephyr/zephyr.exe``) that includes the native simulator
runner, SOC HW models, that image, and an empty image for the other MCU.
If you want to assemble an executable including a previously built image for the other MCU,
built with either Zephyr's build system or another native simulator compatible build system,
you can provide that image to the Zephyr build of the second image using
:kconfig:option:`CONFIG_NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS`.
You can also use :ref:`System build (sysbuild) <sysbuild>` to build your dual MCU executable.
The best way to understand how, may be to look into how this is done in one of the examples
in the tree. For example, for :ref:`the nrf53_sync_rtc sample <nrf53_sync_rtc_sample_build_bsim>`,
:zephyr_file:`samples/boards/nrf/nrf53_sync_rtc/sysbuild.cmake`.
.. note::
These libraries/images are **not** embedded images. You cannot use them for embedded devices,
and cannot use an embedded image to assemble a native executable.
TrustZone, TF-M and other security considerations
*************************************************
ARM's TrustZone is not modelled in these boards. This means that:
* There is no differentiation between secure and non secure execution states or bus accesses.
* All RAM, flash and peripherals are in principle accessible from all SW. Peripherals with their
own interconnect master ports can, in principle, access any other peripheral or RAM area.
* There is no nrf5340bsim/nrf5340/cpuapp/ns board/build target, or posibility of mixing secure
and non-secure images.
* Currently there is no model of the SPU, and therefore neither flash, RAM areas or peripherals
can be labelled as restricted for secure or non secure access.
* TF-M cannot be used.
Note that the ARM cryptocell-312 peripheral is not modelled. The mbedTLS library can still be used
but with a SW crypto backend instead of the cryptocell HW acceleration.
Part 3
한국어 전문 번역
개요
nRF5340 SoC를 시뮬레이션할 수 있도록 Zephyr는 두 대상 보드, nrf5340bsim/nrf5340/cpuapp과 nrf5340bsim/nrf5340/cpunet을 제공합니다.
이 보드들은 BabbleSim으로 무선 활동을 시뮬레이션하고, POSIX 아키텍처와 native simulator를 이용해 개발 시스템에서 애플리케이션을 네이티브로 실행합니다. 따라서 네이티브 코드의 실행 성능과 호스트 도구를 이용한 쉬운 디버깅을 얻지만 POSIX 아키텍처의 제한도 그대로 물려받습니다.
실제 nrf5340dk 대상과 마찬가지로 nrf5340bsim/nrf5340/cpuapp은 애플리케이션 코어를, nrf5340bsim/nrf5340/cpunet은 네트워크 코어를 지원합니다.
모델링된 주변장치
시뮬레이션 보드에는 다음 nRF5340 SoC 주변장치 모델이 포함됩니다.
- AAR(Accelerated Address Resolver)
- AES CCM 및 AES ECB 암호화 하드웨어
- CLOCK(Clock control)
- DPPI(Distributed Programmable Peripheral Interconnect)
- EGU(Event Generator Unit)
- FICR(Factory Information Configuration Registers)
- IPC(Interprocessor communication)
- MUTEX(Mutual exclusive peripheral)
- NVMC(Non-Volatile Memory Controller/Flash)
- RADIO
- RNG(Random Number Generator)
- RTC(Real Time Counter)
- TEMP(Temperature sensor)
- TIMER
- UICR(User Information Configuration Registers)
이 주변장치들은 nrf5340dk 대상과 같은 드라이버를 사용합니다. 각 모델이 어느 수준까지 구현되었는지는 HW models implementation status에서 확인할 수 있습니다.
보드 빌드와 사용
SoC의 MCU 하나만 개발하려면 nrf5340bsim/nrf5340/cpuapp 또는 nrf5340bsim/nrf5340/cpunet 중 해당 시뮬레이션 대상을 선택하고 nrf52_bsim 보드의 빌드·실행 절차를 따르면 됩니다. 빌드할 때 보드/대상 이름만 알맞게 바꾸십시오.
두 MCU 이미지를 하나의 실행 파일로 결합
기본적으로 nrf5340bsim/nrf5340/cpuapp이나 nrf5340bsim/nrf5340/cpunet 중 하나를 대상으로 빌드하면 해당 MCU 코드 이미지에 대응하는 라이브러리 zephyr/zephyr.elf와 실행 파일 zephyr/zephyr.exe가 만들어집니다.
zephyr/zephyr.exe에는 native simulator runner, SoC 하드웨어 모델, 빌드한 MCU 이미지, 그리고 다른 MCU를 위한 빈 이미지가 포함됩니다.
다른 MCU용으로 앞서 빌드한 이미지를 함께 넣고 싶다면 두 번째 이미지를 Zephyr 빌드에 CONFIG_NATIVE_SIMULATOR_EXTRA_IMAGE_PATHS로 전달할 수 있습니다. 그 이미지는 Zephyr 빌드 시스템 또는 native simulator와 호환되는 다른 빌드 시스템으로 만든 것이어야 합니다.
System build(sysbuild)를 이용해 두 MCU가 들어간 실행 파일을 한 번에 빌드할 수도 있습니다. 실제 구성 예는 nrf53_sync_rtc sample의 samples/boards/nrf/nrf53_sync_rtc/sysbuild.cmake에서 확인할 수 있습니다.
TrustZone, TF-M과 보안 제한
이 보드에는 Arm TrustZone이 모델링되어 있지 않습니다. 그 결과 다음 제한이 있습니다.
- Secure 실행 상태와 Non-secure 실행 상태 또는 각각의 버스 접근을 구분하지 않습니다.
- 원칙적으로 모든 소프트웨어가 모든 RAM, Flash와 주변장치에 접근할 수 있습니다. 자체 interconnect master port가 있는 주변장치도 다른 주변장치나 RAM 영역 어디에든 접근할 수 있습니다.
nrf5340bsim/nrf5340/cpuapp/ns보드/빌드 대상이 없으며 Secure 이미지와 Non-secure 이미지를 혼합할 수 없습니다.- 현재 SPU(Security Protection Unit) 모델이 없으므로 Flash, RAM 영역 또는 주변장치를 Secure/Non-secure 접근 제한 대상으로 표시할 수 없습니다.
- TF-M을 사용할 수 없습니다.
Arm CryptoCell-312 주변장치도 모델링되어 있지 않습니다. mbedTLS 라이브러리는 사용할 수 있지만 CryptoCell 하드웨어 가속 대신 소프트웨어 암호화 backend를 사용합니다.
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.