1.. _ip_k66f:
2
3SEGGER IP Switch Board
4######################
5
6Overview
7********
8
9The Segger IP Switch Board is a Evaluation board based on NXP Kinetis K66 MCU.
10It comes with Micrel/Microchip KSZ8794CNX integrated 4-port 10/100 managed
11Ethernet switch with Gigabit RGMII/MII/RMII interface.
12
13- KSZ8794CNX enables evaluation for switch functions
14- On-board debug probe J-Link-OB for programming
15
16.. image:: ./ip_k66f.png
17   :width: 720px
18   :align: center
19   :alt: IP-K66F
20
21Hardware
22********
23
24- MK66FN2M0VMD18 MCU (180 MHz, 2 MB flash memory, 256 KB RAM, low-power,
25  crystal-less USB
26- Dual role USB interface with micro-B USB connector
27- 2 User LED
28- On-board debug probe J-Link-OB for programming
29- Micrel/Microchip Ethernet Switch KSZ8794CNX with 3 RJ45 connectors
30
31For more information about the K66F SoC and IP-K66F board:
32
33- `K66F Website`_
34- `K66F Datasheet`_
35- `K66F Reference Manual`_
36- `IP-K66F Website`_
37- `IP-K66F User Guide`_
38- `IP-K66F Schematics`_
39
40Supported Features
41==================
42
43The ip_k66f board configuration supports the following hardware features:
44
45+-----------+------------+-------------------------------------+
46| Interface | Controller | Driver/Component                    |
47+===========+============+=====================================+
48| NVIC      | on-chip    | nested vector interrupt controller  |
49+-----------+------------+-------------------------------------+
50| SYSTICK   | on-chip    | systick                             |
51+-----------+------------+-------------------------------------+
52| PINMUX    | on-chip    | pinmux                              |
53+-----------+------------+-------------------------------------+
54| GPIO      | on-chip    | gpio                                |
55+-----------+------------+-------------------------------------+
56| WATCHDOG  | on-chip    | watchdog                            |
57+-----------+------------+-------------------------------------+
58| FLASH     | on-chip    | soc flash                           |
59+-----------+------------+-------------------------------------+
60| RTC       | on-chip    | rtc                                 |
61+-----------+------------+-------------------------------------+
62
63The default configuration can be found in the defconfig file:
64
65	``boards/arm/ip_k66f/ip_k66f_defconfig``
66
67Micrel/Microchip KSZ8794CNX Ethernet Switch is not currently
68supported.
69
70Connections and IOs
71===================
72
73The K66F SoC has five pairs of pinmux/gpio controllers.
74
75+-------+-----------------+---------------------------+
76| Name  | Function        | Usage                     |
77+=======+=================+===========================+
78| PTA8  | GPIO            | Red LED                   |
79+-------+-----------------+---------------------------+
80| PTA10 | GPIO            | RED LED                   |
81+-------+-----------------+---------------------------+
82
83System Clock
84============
85
86The K66F SoC is configured to use the 12 MHz low gain crystal oscillator on the
87board with the on-chip PLL to generate a 180 MHz system clock.
88
89Serial Port
90===========
91
92The K66F SoC has six UARTs. None of them are used.
93
94Programming and Debugging
95*************************
96
97Build and flash applications as usual (see :ref:`build_an_application` and
98:ref:`application_run` for more details).
99
100Configuring a Debug Probe
101=========================
102
103A debug probe is used for both flashing and debugging the board. This board is
104configured by default to use the :ref:`opensda-jlink-onboard-debug-probe`.
105
106:ref:`opensda-jlink-onboard-debug-probe`
107--------------------------------------------------
108
109Install the :ref:`jlink-debug-host-tools` and make sure they are in your search
110path.
111
112Follow the instructions in :ref:`opensda-jlink-onboard-debug-probe` to program
113the `OpenSDA J-Link Generic Firmware for V3.2 Bootloader`_. Note that Segger
114does provide an OpenSDA J-Link Board-Specific Firmware for this board, however
115it is not compatible with the DAPLink bootloader.
116
117The default flasher is ``jlink`` using the built-in SEGGER Jlink interface.
118
119Flashing
120========
121
122Here is an example for the :ref:`blinky-sample` application.
123
124.. zephyr-app-commands::
125   :zephyr-app: samples/basic/blinky
126   :board: ip_k66f
127   :goals: flash
128
129Red LED0 should blink at 1 second delay.
130
131Debugging
132=========
133
134Here is an example for the :ref:`blinky-sample` application.
135
136.. zephyr-app-commands::
137   :zephyr-app: samples/basic/blinky
138   :board: ip_k66f
139   :goals: debug
140
141Step through the application in your debugger.
142
143.. _IP-K66F Website:
144   https://www.segger.com/evaluate-our-software/segger/embosip-switch-board/
145
146.. _IP-K66F User Guide:
147   https://www.segger.com/downloads/emnet/UM06002
148
149.. _IP-K66F Schematics:
150   https://www.segger.com/downloads/emnet/embOSIP_SwitchBoard_V2.0_WEB_Schematic.pdf
151
152.. _K66F Website:
153   https://www.nxp.com/products/processors-and-microcontrollers/arm-microcontrollers/general-purpose-mcus/k-series-cortex-m4/k6x-ethernet/kinetis-k66-180-mhz-dual-high-speed-full-speed-usbs-2mb-flash-microcontrollers-mcus-based-on-arm-cortex-m4-core:K66_180
154
155.. _K66F Datasheet:
156   https://www.nxp.com/docs/en/data-sheet/K66P144M180SF5V2.pdf
157
158.. _K66F Reference Manual:
159   https://www.nxp.com/docs/en/reference-manual/K66P144M180SF5RMV2.pdf
160
161.. _OpenSDA J-Link Generic Firmware for V3.2 Bootloader:
162   https://www.segger.com/downloads/jlink/OpenSDA_V3_2
163
164Serial console
165==============
166
167The ``ip_k66f`` board only uses Segger's RTT console for providing serial
168console. There is no physical serial port available.
169
170- To communicate with this board one needs in one console:
171
172``/opt/SEGGER/JLink_V664/JLinkRTTLogger -Device MK66FN2M0XXX18 -RTTChannel 1 -if SWD -Speed 4000 ~/rtt.log``
173
174- In another one:
175
176``nc localhost 19021``
177