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