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