Part 1
요약·해설
Carbon 한 장에는 주 STM32F401RET와 보조 nRF51822가 함께 있습니다. 이 문서는 보조 nRF51만 대상으로 하며, 그 칩에 Zephyr의 hci_spi sample을 올려 주 MCU에 Bluetooth 기능을 제공하는 경로를 설명합니다.

SPI를 통해 주 STM32F401RET에 Bluetooth 제공
slow clock 32.768 kHz, main clock 16 MHz
미실장 BLE header에 pin header를 납땜한 뒤 외부 SWD probe 사용
Part 2
접을 수 있는 영어 원문 전체
영어 원문 전체 펼치기
6837E202EEF265819F37E2DE009E2902155C126CFD8C336CC72C85B6F67B85CE
.. _96b_carbon_nrf51_board:
96Boards Carbon nRF51
#####################
Overview
********
This is the secondary nRF51822 chip on the 96Boards Carbon and provides
Bluetooth functionality to the main STM32F401RET chip via SPI.
.. note::
If you're looking to reprogram the main STMicro part, see
:ref:`96b_carbon_board`. Users should not use this configuration
unless they want to reprogram the secondary chip which provides
Bluetooth connectivity.
Hardware
********
The 96Boards Carbon nRF51 has two external oscillators. The frequency
of the slow clock is 32.768 kHz. The frequency of the main clock is 16
MHz.
See :ref:`96b_carbon_board` for other general information about the
board; that configuration is for the same physical board, just a
different chip.
Supported Features
==================
+-----------+------------+-------------------------------------+
| Interface | Controller | Driver/Component |
+===========+============+=====================================+
| NVIC | on-chip | nested vector interrupt controller |
+-----------+------------+-------------------------------------+
| RTC | on-chip | system clock |
+-----------+------------+-------------------------------------+
| UART | on-chip | serial port |
+-----------+------------+-------------------------------------+
| GPIO | on-chip | gpio |
+-----------+------------+-------------------------------------+
| FLASH | on-chip | flash |
+-----------+------------+-------------------------------------+
| SPIS | on-chip | SPI slave |
+-----------+------------+-------------------------------------+
| RADIO | on-chip | Bluetooth |
+-----------+------------+-------------------------------------+
The default configuration can be found in
:zephyr_file:`boards/96boards/carbon/96b_carbon_nrf51822_defconfig`
Connections and IOs
===================
SPI
---
96Boards Carbon nRF51 has one SPI, which for providing Bluetooth
communication. The default SPI mapping for Zephyr is:
- SPI1_NSS : P0.25
- SPI1_SCK : P0.07
- SPI1_MISO : P0.30
- SPI1_MOSI : P0.00
The SWD debug pins are broken out to an external header; all other
connected pins are to the main STM32F401RET chip.
.. _96b_carbon_nrf51_programming:
Programming and Debugging
*************************
Flashing
========
The 96Boards Carbon nRF51 can be flashed using an external SWD
debugger, via the debug header labeled "BLE" on the board's
silkscreen. The header is not populated; 0.1" male header must be
soldered on first.
.. figure:: ../../../../../../../boards/96boards/carbon/doc/img/96b_carbon_nrf51.jpg
:align: center
:alt: 96Boards Carbon nRF51 Debug
96Boards Carbon nRF51 Debug
The following example assumes a Zephyr binary ``zephyr.elf`` will be
flashed to the board.
It uses the `Black Magic Debug Probe`_ as an SWD programmer, which can
be connected to the BLE debug header using flying leads and its 20 Pin
JTAG Adapter Board Kit. When plugged into your host PC, the Black
Magic Debug Probe enumerates as a USB serial device as documented on
its `Getting started page`_.
It also uses the GDB binary provided with the Zephyr SDK,
``arm-zephyr-eabi-gdb``. Other GDB binaries, such as the GDB from GCC
ARM Embedded, can be used as well.
.. code-block:: console
$ arm-zephyr-eabi-gdb -q zephyr.elf
(gdb) target extended-remote /dev/ttyACM0
Remote debugging using /dev/ttyACM0
(gdb) monitor swdp_scan
Target voltage: 3.3V
Available Targets:
No. Att Driver
1 nRF51
(gdb) attach 1
Attaching to Remote target
0xabcdef12 in ?? ()
(gdb) load
Debugging
=========
After you've flashed the chip, you can keep debugging using the same
GDB instance. To reattach, just follow the same steps above, but don't
run "load". You can then debug as usual with GDB. In particular, type
"run" at the GDB prompt to restart the program you've flashed.
As an aid to debugging, this board configuration directs a console
output to a currently unused pin connected to the STM32F401RET. Users
who are experienced in electronics rework can remove a resistor (R22)
on the board and attach a wire to the nRF51822's UART output.
.. _96b_carbon_nrf51_bluetooth:
Providing Bluetooth to 96b_carbon
*********************************
This ``96b_carbon/nrf51822`` Zephyr board configuration can be used to provide
Bluetooth functionality from the secondary nRF51822 chip to the
primary STM32F401RE chip on the :ref:`96b_carbon_board`.
To do this, build the ``samples/bluetooth/hci_spi/`` application
provided with Zephyr with ``BOARD=96b_carbon/nrf51822``, then flash it to
the nRF51822 chip using the instructions :ref:`above
<96b_carbon_nrf51_programming>`. (For instructions on how to build a
Zephyr application, see :ref:`build_an_application`.)
.. warning::
Be sure to flash the hci_spi application to the nRF51822 chip and
not to the main STM32F401RET chip. While both chips are supported
by Zephyr, the hci_spi application providing Bluetooth support will
only run on the nRF51822 chip.
References
**********
- `Board documentation from 96Boards`_
- `nRF51822 information from Nordic Semiconductor`_
.. _Black Magic Debug Probe:
https://github.com/blacksphere/blackmagic/wiki
.. _Getting started page:
https://github.com/blacksphere/blackmagic/wiki/Getting-Started
.. _Board documentation from 96Boards:
http://www.96boards.org/product/carbon/
.. _nRF51822 information from Nordic Semiconductor:
https://www.nordicsemi.com/eng/Products/Bluetooth-low-energy/nRF51822
Part 3
한국어 전문 번역
개요
이 대상은 96Boards Carbon의 secondary nRF51822 chip이며, SPI를 통해 main STM32F401RET chip에 Bluetooth 기능을 제공합니다.
하드웨어
96Boards Carbon nRF51에는 external oscillator가 2개 있습니다. slow clock 주파수는 32.768 kHz이고 main clock 주파수는 16 MHz입니다.
보드의 일반 정보는 96b_carbon 문서를 참고하십시오. 물리적으로 같은 보드이지만 해당 설정은 다른 chip을 대상으로 합니다.
지원 기능
| Interface | Controller | Driver/Component |
|---|---|---|
| NVIC | on-chip | nested vector interrupt controller |
| RTC | on-chip | system clock |
| UART | on-chip | serial port |
| GPIO | on-chip | gpio |
| FLASH | on-chip | flash |
| SPIS | on-chip | SPI slave |
| RADIO | on-chip | Bluetooth |
기본 설정 파일은 boards/96boards/carbon/96b_carbon_nrf51822_defconfig입니다.
연결과 I/O
SPI
Carbon nRF51에는 Bluetooth 통신 제공에 사용하는 SPI가 하나 있습니다. Zephyr의 기본 mapping은 다음과 같습니다.
SPI1_NSS: P0.25SPI1_SCK: P0.07SPI1_MISO: P0.30SPI1_MOSI: P0.00
SWD debug pin은 외부 header로 나와 있습니다. 연결된 나머지 pin은 모두 main STM32F401RET chip으로 이어집니다.
프로그래밍과 디버깅
Flashing
보드 silkscreen에 BLE라고 표시된 debug header를 통해 external SWD debugger로 flash할 수 있습니다. header는 출고 시 실장되지 않았으므로 먼저 0.1 inch male header를 납땜해야 합니다.
다음 예는 Zephyr binary zephyr.elf를 board에 flash한다고 가정합니다. Black Magic Debug Probe를 SWD programmer로 사용하며 flying lead와 20 Pin JTAG Adapter Board Kit로 BLE debug header에 연결할 수 있습니다. host PC에 연결하면 공식 Getting started page 설명대로 USB serial device로 인식됩니다.
Zephyr SDK가 제공하는 arm-zephyr-eabi-gdb를 사용합니다. GCC Arm Embedded의 GDB 같은 다른 GDB binary도 사용할 수 있습니다.
$ arm-zephyr-eabi-gdb -q zephyr.elf
(gdb) target extended-remote /dev/ttyACM0
Remote debugging using /dev/ttyACM0
(gdb) monitor swdp_scan
Target voltage: 3.3V
Available Targets:
No. Att Driver
1 nRF51
(gdb) attach 1
Attaching to Remote target
0xabcdef12 in ?? ()
(gdb) load
Debugging
chip을 flash한 뒤 같은 GDB instance에서 계속 debug할 수 있습니다. 다시 연결하려면 위 단계를 반복하되 load는 실행하지 않습니다. 이후 일반적인 GDB 방식으로 debug하며, GDB prompt에서 run을 입력하면 flash한 program이 다시 시작됩니다.
debug를 돕기 위해 이 보드 설정은 console output을 현재 사용하지 않는, STM32F401RET에 연결된 pin으로 보냅니다. 전자 rework 경험이 있는 사용자는 보드의 resistor R22를 제거하고 nRF51822 UART output에 wire를 연결할 수 있습니다.
96b_carbon에 Bluetooth 제공
96b_carbon/nrf51822 Zephyr 보드 설정은 secondary nRF51822에서 primary STM32F401RE에 Bluetooth 기능을 제공하는 데 사용할 수 있습니다.
Zephyr의 samples/bluetooth/hci_spi/ 애플리케이션을 BOARD=96b_carbon/nrf51822로 빌드한 뒤 앞의 절차에 따라 nRF51822에 flash합니다.
참고 자료
- Black Magic Debug Probe
- Black Magic Getting started
- 96Boards Carbon 문서
- Nordic Semiconductor nRF51822 정보
Source
출처
영어 원문에는 문단, 문서 지시문, 표, 코드, 코드 심벌, 경로를 그대로 보존했습니다.