1.. zephyr:board:: hsdk
2
3Overview
4********
5
6The DesignWare(R) ARC(R) HS Development Kit is a ready-to-use platform for
7rapid software development on the ARC HS3x family of processors. It supports
8single-core and multi-core ARC HS34, HS36 and HS38 processors and offers a wide
9range of interfaces including Ethernet, WiFi, Bluetooth, USB, SDIO, I2C, SPI,
10UART, I2S, ADC, PWM and GPIO. A Vivante GPU is also contained in the ARC
11Development System SoC. This allows developers to build and debug complex
12software on a comprehensive hardware platform
13
14For details about the board, see: `ARC HS Development Kit
15(HSDK) <https://www.synopsys.com/dw/ipdir.php?ds=arc-hs-development-kit>`__
16
17Hardware
18********
19
20The ARC HSDK has 24 general GPIOs, which divided into 8 groups named from GPIO_SEL_0 to GPIO_SEL_7.
21Each sel can configured for different functions, such as: GPIO, UART, SPI, I2C and PWM. We can program
22CREG_GPIO_MUX register to do configuration for each sel. Tables below show the bit definition for
23CREG_GPIO_MUX register and the details configuration for each pin.
24
25+--------+-------------+---------+--------------+---------------------------------+
26| Bit    | Name        | Access  | Reset value  | Description                     |
27+--------+-------------+---------+--------------+---------------------------------+
28| 2:0    | GPIO_SEL_0  | RW      | 0x0*         | GPIO mux select for gpio[3:0]   |
29+--------+-------------+---------+--------------+---------------------------------+
30| 5:3    | GPIO_SEL_1  | RW      | 0x0*         | GPIO mux select for gpio[7:4]   |
31+--------+-------------+---------+--------------+---------------------------------+
32| 8:6    | GPIO_SEL_2  | RW      | 0x0*         | GPIO mux select for gpio[11:8]  |
33+--------+-------------+---------+--------------+---------------------------------+
34| 11:9   | GPIO_SEL_3  | RW      | 0x0*         | GPIO mux select for gpio[15:12] |
35+--------+-------------+---------+--------------+---------------------------------+
36| 14:12  | GPIO_SEL_4  | RW      | 0x0*         | GPIO mux select for gpio[17:16] |
37+--------+-------------+---------+--------------+---------------------------------+
38| 17:15  | GPIO_SEL_5  | RW      | 0x0*         | GPIO mux select for gpio[19:18] |
39+--------+-------------+---------+--------------+---------------------------------+
40| 20:18  | GPIO_SEL_6  | RW      | 0x0*         | GPIO mux select for gpio[21:20] |
41+--------+-------------+---------+--------------+---------------------------------+
42| 23:21  | GPIO_SEL_7  | RW      | 0x0*         | GPIO mux select for gpio[23:22] |
43+--------+-------------+---------+--------------+---------------------------------+
44
45+------+-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
46| SELS | GPIO PINS | FUN0     | FUN1      | FUN2       | FUN3     | FUN4      | FUN5        | FUN6      | FUN7        |
47+------+-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
48| SEL0 | 0         | gpio[0]  | uart0_cts | spi1_cs[0] | gpio[0]  | gpio[0]   | pwm_ch[6]   | pwm_ch[6] | pwm_ch[1]   |
49|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
50|      | 1         | gpio[1]  | uart0_txd | spi1_mosi  | gpio[1]  | pwm_ch[0] | gpio[1]     | pwm_ch[0] | pwm_ch[0]   |
51|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
52|      | 2         | gpio[2]  | uart0_rxd | spi1 _miso | i2c1_scl | gpio[2]   | gpio[2]     | gpio[2]   | gpio[2]     |
53|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
54|      | 3         | gpio[3]  | uart0_rts | spi1_clk   | i2c1_sda | gpio[3]   | gpio[3]     | gpio[3]   | gpio[3]     |
55+------+-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
56| SEL1 | 4         | gpio[4]  | uart1_cts | spi2_cs[0] | gpio[4]  | gpio[4]   | pwm_ch[4]   | pwm_ch[4] | pwm_ch[3]   |
57|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
58|      | 5         | gpio[5]  | uart1_txd | spi2_mosi  | gpio[5]  | pwm_ch[2] | gpio[5]     | pwm_ch[2] | pwm_ch[2]   |
59|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
60|      | 6         | gpio[6]  | uart1_rxd | spi2_miso  | i2c2_scl | gpio[6]   | gpio[6]     | gpio[6]   | gpio[6]     |
61|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
62|      | 7         | gpio[7]  | uart1_rts | spi2_clk   | i2c2_sda | gpio[7]   | gpio[7]     | gpio[7]   | gpio[7]     |
63+------+-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
64| SEL2 | 8         | gpio[8]  | uart2_cts | spi1_cs[1] | gpio[8]  | gpio[8]   | pwm_ch[2]   | pwm_ch[2] | pwm_ch[5]   |
65|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
66|      | 9         | gpio[9]  | uart2_txd | spi1_mosi  | gpio[9]  | pwm_ch[4] | gpio[9]     | pwm_ch[4] | pwm_ch[4]   |
67|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
68|      | 10        | gpio[10] | uart2_rxd | spi1_miso  | i2c1_scl | gpio[10]  | gpio[10]    | gpio[10]  | gpio[10]    |
69|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
70|      | 11        | gpio[11] | uart2_rts | spi1_clk   | i2c1_sda | gpio[11]  | gpio[11]    | gpio[11]  | gpio[11]    |
71+------+-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
72| SEL3 | 12        | gpio[12] | uart0_cts | spi2_cs[1] | gpio[12] | gpio[12]  | pwm_ch[0]   | pwm_ch[0] | pwm_ch[7]   |
73|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
74|      | 13        | gpio[13] | uart0_txd | spi2_mosi  | gpio[13] | pwm_ch[6] | gpio[13]    | pwm_ch[6] | pwm_ch[6]   |
75|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
76|      | 14        | gpio[14] | uart0_rxd | spi2_miso  | i2c2_scl | gpio[14]  | gpio[14]    | gpio[14]  | gpio[14]    |
77|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
78|      | 15        | gpio[15] | uart0_rts | spi2_clk   | i2c2_sda | gpio[15]  | gpio[15]    | gpio[15]  | gpio[15]    |
79+------+-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
80| SEL4 | 16        | gpio[16] | uart1_txd | spi1_cs[2] | i2c1_scl | gpio[16]  | pwm_fault_0 | gpio[16]  | pwm_fault_0 |
81|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
82|      | 17        | gpio[17] | uart1_rxd | spi1_mosi  | i2c1_sda | pwm_ch[0] | pwm_ch[0]   | pwm_ch[5] | pwm_ch[5]   |
83+------+-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
84| SEL5 | 18        | gpio[18] | uart2_txd | spi1_miso  | i2c2_scl | gpio[18]  | gpio[18]    | gpio[18]  | gpio[18]    |
85|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
86|      | 19        | gpio[19] | uart2_rxd | spi1_clk   | i2c2_sda | gpio[19]  | gpio[19]    | gpio[19]  | gpio[19]    |
87+------+-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
88| SEL6 | 20        | gpio[20] | uart0_txd | spi2_cs[2] | i2c1_scl | gpio[20]  | pwm_fault_1 | gpio[20]  | pwm_fault_1 |
89|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
90|      | 21        | gpio[21] | uart0_rxd | spi2_mosi  | i2c1_sda | pwm_ch[6] | pwm_ch[6]   | pwm_ch[3] | pwm_ch[3]   |
91+------+-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
92| SEL7 | 22        | gpio[22] | uart2_txd | spi2_miso  | i2c2_scl | gpio[22]  | gpio[22]    | gpio[22]  | gpio[22]    |
93|      +-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
94|      | 23        | gpio[23] | uart2_rxd | spi2_clk   | i2c2_sda | gpio[23]  | gpio[23]    | gpio[23]  | gpio[23]    |
95+------+-----------+----------+-----------+------------+----------+-----------+-------------+-----------+-------------+
96
97Digilent Pmod
98=============
99
100The ARC HSDK features two 12-pin Pmod connectors Pmod_A and Pmod_B and one 6-pin Pmod connector Pmod_C.
101The functionality of the Pmod connectors is programmable and includes GPIO, UART, SPI, I2C and PWM.
102The location of the pins on the Pmod connectors is shown in Figure below. Detailed pin descriptions
103depending on the pin multiplexer settings are provided in the subsequent sections.
104
105.. image:: pinout_diagram_of_the_pmod.jpg
106   :align: center
107   :alt: Pinout Diagram of the Pmod
108
109Pmod_A Connector
110----------------
111
112Table below lists the pin assignment of valid protocols that can be multiplexed on the Pmod_A
113connector. The GPIO column is the default assignment after Reset.
114
115+------+-----------+------------+-------------+-----------+------------+-----------+
116| Pin  | GPIO      | UART       | SPI         | I2C       | PWM_1      | PWM_2     |
117+------+-----------+------------+-------------+-----------+------------+-----------+
118| A1   | gpio[8]   | uart2_cts  | spi1_cs[1]  | gpio[8]   | gpio[8]    | pwm_ch[2] |
119+------+-----------+------------+-------------+-----------+------------+-----------+
120| A2   | gpio[9]   | uart2_txd  | spi1_mosi   | gpio[9]   | pwm_ch[4]  | gpio[9]   |
121+------+-----------+------------+-------------+-----------+------------+-----------+
122| A3   | gpio[10]  | uart2_rxd  | spi1_miso   | i2c1_scl  | gpio[10]   | gpio[10]  |
123+------+-----------+------------+-------------+-----------+------------+-----------+
124| A4   | gpio[11]  | uart2_rts  | spi1_clk    | i2c1_sda  | gpio[11]   | gpio[11]  |
125+------+-----------+------------+-------------+-----------+------------+-----------+
126| A5   | GND       | GND        | GND         | GND       | GND        | GND       |
127+------+-----------+------------+-------------+-----------+------------+-----------+
128| A6   | 3V3       | 3V3        | 3V3         | 3V3       | 3V3        | 3V3       |
129+------+-----------+------------+-------------+-----------+------------+-----------+
130| A7   | gpio[20]  | gpio[20]   | gpio[20]    | gpio[20]  | gpio[20]   | gpio[20]  |
131+------+-----------+------------+-------------+-----------+------------+-----------+
132| A8   | gpio[21]  | gpio[21]   | gpio[21]    | gpio[21]  | gpio[21]   | gpio[21]  |
133+------+-----------+------------+-------------+-----------+------------+-----------+
134| A9   | n.c.      | n.c.       | n.c.        | n.c.      | n.c.       | n.c.      |
135+------+-----------+------------+-------------+-----------+------------+-----------+
136| A10  | n.c.      | n.c.       | n.c.        | n.c.      | n.c.       | n.c.      |
137+------+-----------+------------+-------------+-----------+------------+-----------+
138| A11  | GND       | GND        | GND         | GND       | GND        | GND       |
139+------+-----------+------------+-------------+-----------+------------+-----------+
140| A12  | 3V3       | 3V3        | 3V3         | 3V3       | 3V3        | 3V3       |
141+------+-----------+------------+-------------+-----------+------------+-----------+
142
143Pmod_B Connector
144----------------
145
146Table below lists the pin assignment of valid protocols that can be multiplexed on the Pmod_B
147connector. The GPIO column is the default assignment after Reset.
148
149+------+-----------+------------+-------------+-----------+------------+-----------+
150| Pin  | GPIO      | UART       | SPI         | I2C       | PWM_1      | PWM_2     |
151+------+-----------+------------+-------------+-----------+------------+-----------+
152| B1   | gpio[12]  | uart0_cts  | spi2_cs[1]  | gpio[12]  | gpio[12]   | pwm_ch[0] |
153+------+-----------+------------+-------------+-----------+------------+-----------+
154| B2   | gpio[13]  | uart0_txd  | spi2_mosi   | gpio[13]  | pwm_ch[6]  | gpio[13]  |
155+------+-----------+------------+-------------+-----------+------------+-----------+
156| B3   | gpio[14]  | uart0_rxd  | spi2_miso   | i2c2_scl  | gpio[14]   | gpio[14]  |
157+------+-----------+------------+-------------+-----------+------------+-----------+
158| B4   | gpio[15]  | uart0_rts  | spi2_clk    | i2c2_sda  | gpio[15]   | gpio[15]  |
159+------+-----------+------------+-------------+-----------+------------+-----------+
160| B5   | GND       | GND        | GND         | GND       | GND        | GND       |
161+------+-----------+------------+-------------+-----------+------------+-----------+
162| B6   | 3V3       | 3V3        | 3V3         | 3V3       | 3V3        | 3V3       |
163+------+-----------+------------+-------------+-----------+------------+-----------+
164| B7   | gpio[22]  | gpio[22]   | gpio[22]    | gpio[22]  | gpio[22]   | gpio[22]  |
165+------+-----------+------------+-------------+-----------+------------+-----------+
166| B8   | gpio[23]  | gpio[23]   | gpio[23]    | gpio[23]  | gpio[23]   | gpio[23]  |
167+------+-----------+------------+-------------+-----------+------------+-----------+
168| B9   | n.c.      | n.c.       | n.c.        | n.c.      | n.c.       | n.c.      |
169+------+-----------+------------+-------------+-----------+------------+-----------+
170| B10  | n.c.      | n.c.       | n.c.        | n.c.      | n.c.       | n.c.      |
171+------+-----------+------------+-------------+-----------+------------+-----------+
172| B11  | GND       | GND        | GND         | GND       | GND        | GND       |
173+------+-----------+------------+-------------+-----------+------------+-----------+
174| B12  | 3V3       | 3V3        | 3V3         | 3V3       | 3V3        | 3V3       |
175+------+-----------+------------+-------------+-----------+------------+-----------+
176
177Pmod_C Connector
178----------------
179
180Table below lists the pin assignment of valid protocols that can be multiplexed on the Pmod_C
181connector. The GPIO column is the default assignment after Reset.
182
183+------+-----------+------------+-------------+-----------+-----------+
184| Pin  | GPIO      | UART       | SPI         | I2C       | PWM       |
185+------+-----------+------------+-------------+-----------+-----------+
186| C1   | gpio[16]  | uart1_txd  | spi1_cs[2]  | i2c1_scl  | gpio[16]  |
187+------+-----------+------------+-------------+-----------+-----------+
188| C2   | gpio[17]  | uart1_rxd  | spi1_mosi   | i2c1_sda  | pwm_ch[0] |
189+------+-----------+------------+-------------+-----------+-----------+
190| C3   | gpio[18]  | uart2_txd  | spi1_miso   | i2c2_scl  | gpio[18]  |
191+------+-----------+------------+-------------+-----------+-----------+
192| C4   | gpio[19]  | uart2_rxd  | spi1_clk    | i2c2_sda  | gpio[19]  |
193+------+-----------+------------+-------------+-----------+-----------+
194| C5   | GND       | GND        | GND         | GND       | GND       |
195+------+-----------+------------+-------------+-----------+-----------+
196| C6   | 3V3       | 3V3        | 3V3         | 3V3       | 3V3       |
197+------+-----------+------------+-------------+-----------+-----------+
198
199Mikrobus
200========
201
202The ARC HSDK features a set of MikroBUS headers. Figure below shows the relevant function assignments,
203fully compatible with the MikroBUS standard. Table below shows the pin assignment on the I/O Multiplexer.
204
205.. image:: mikrobus_header.jpg
206   :align: center
207   :alt: mikrobus header
208
209+-------+-----------------+------+-----------+
210| Pin   | I/O             | Pin  | I/O       |
211+-------+-----------------+------+-----------+
212| AN    | ADC VIN6*       | PWM  | pwm_ch[0] |
213+-------+-----------------+------+-----------+
214| RST   | GPX_Port0_bit1  | INT  | gpio[16]  |
215+-------+-----------------+------+-----------+
216| CS    | spi2_cs[1]      | RX   | uart2_rxd |
217+-------+-----------------+------+-----------+
218| SCK   | spi2_clk        | TX   | uart2_txd |
219+-------+-----------------+------+-----------+
220| MISO  | spi2_miso       | SCL  | i2c2_scl  |
221+-------+-----------------+------+-----------+
222| MOSI  | spi2_mosi       | SDA  | i2c2_sda  |
223+-------+-----------------+------+-----------+
224
225.. note::
226    ADC VIN6 is available through the on-board ADC and is
227    read though SPI0 using SPI chip select 1.
228
229Arduino
230=======
231
232The ARC HSDK provides an Arduino shield interface. Figure below shows the relevant
233function assignments. The Arduino shield interface is compatible with the Arduino UNO
234R3 with the following exceptions: 5 Volt shields are not supported, the IOREF voltage on
235the ARC HSDK board is fixed to 3V3. Note that the ICSP header is also not available. Most
236shields do not require this ICSP header as the SPI master interface on this ICSP header
237is also available on the IO10 to IO13 pins.
238
239.. image:: arduino_shield_interface.jpg
240   :align: center
241   :alt: arduino shield interface
242
243Table below shows the pin assignment on the I/O Multiplexer. Multiplexing is controlled by software
244using the CREG_GPIO_MUX register (see Pinmux ). After a reset, all ports are configured as GPIO inputs.
245
246+-------+------------+-----------------+------------+
247| Pin   | I/O-1      | I/O-2           | I/O-3      |
248+-------+------------+-----------------+------------+
249| AD0   | ADC VIN0*  | GPX_port0_bit2  | -          |
250+-------+------------+-----------------+------------+
251| AD1   | ADC VIN1*  | GPX_port0_bit3  | -          |
252+-------+------------+-----------------+------------+
253| AD2   | ADC VIN2*  | GPX_port0_bit4  | -          |
254+-------+------------+-----------------+------------+
255| AD3   | ADC VIN3*  | GPX_port0_bit5  | -          |
256+-------+------------+-----------------+------------+
257| AD4   | ADC VIN4*  | gpio[18]        | i2c2_sda   |
258+-------+------------+-----------------+------------+
259| AD5   | ADC VIN5*  | gpio[19]        | i2c2_scl   |
260+-------+------------+-----------------+------------+
261| IO0   | gpio[23]   | uart2_rxd       | -          |
262+-------+------------+-----------------+------------+
263| IO1   | gpio[22]   | uart2_txd       | -          |
264+-------+------------+-----------------+------------+
265| IO2   | gpio[16]   | -               | -          |
266+-------+------------+-----------------+------------+
267| IO3   | gpio[17]   | pwm_ch[5]       | -          |
268+-------+------------+-----------------+------------+
269| IO4   | gpio[11]   | -               |            |
270+-------+------------+-----------------+------------+
271| IO5   | gpio[9]    | pwm_ch[4]       | -          |
272+-------+------------+-----------------+------------+
273| IO6   | gpio[21]   | pwm_ch[3]       | -          |
274+-------+------------+-----------------+------------+
275| IO7   | gpio[20]   | -               | -          |
276+-------+------------+-----------------+------------+
277| IO8   | gpio[10]   | -               | -          |
278+-------+------------+-----------------+------------+
279| IO9   | gpio[8]    | pwm_ch[2]       | -          |
280+-------+------------+-----------------+------------+
281| IO10  | gpio[12]   | pwm_ch[0]       | spi2_cs[1] |
282+-------+------------+-----------------+------------+
283| IO11  | gpio[13]   | pwm_ch[6]       | spi2_mosi  |
284+-------+------------+-----------------+------------+
285| IO12  | gpio[14]   | -               | spi2_miso  |
286+-------+------------+-----------------+------------+
287| IO13  | gpio[15]   | -               | spi2_clk   |
288+-------+------------+-----------------+------------+
289
290I/O expander
291============
292
293The ARC HSDK board includes a CY8C9520A I/O expander from `Cypress CY8C9520A
294<https://www.cypress.com/file/37971/download>`__. The I/O
295expander offers additional GPIO signals and board control signals and can be accessed
296through the on-board I2C bus, we have implemented a basic driver for it.
297Tables below shows an overview of relevant I/O signals.
298
299+------------+---------------------------------------------+
300| Pins       | Usage                                       |
301+------------+---------------------------------------------+
302| port0_bit0 | RS9113 Bluetooth I2S RX enable (active low) |
303+------------+---------------------------------------------+
304| port0_bit1 | mikroBUS Reset (active low)                 |
305+------------+---------------------------------------------+
306| port0_bit2 | GPIO for Arduino AD0                        |
307+------------+---------------------------------------------+
308| port0_bit3 | GPIO for Arduino AD1                        |
309+------------+---------------------------------------------+
310| port0_bit4 | GPIO for Arduino AD2                        |
311+------------+---------------------------------------------+
312| port0_bit5 | GPIO for Arduino AD3                        |
313+------------+---------------------------------------------+
314| port1_bit4 | On-board user LED0                          |
315+------------+---------------------------------------------+
316| port1_bit5 | On-board user LED1                          |
317+------------+---------------------------------------------+
318| port1_bit6 | On-board user LED2                          |
319+------------+---------------------------------------------+
320| port1_bit7 | On-board user LED3                          |
321+------------+---------------------------------------------+
322
323On-board user LEDS
324==================
325
326The ARC HSDK includes 4 user LEDs(active high), which can be controlled through the I/O expander pins.
327
328+-------+-----------------+
329| LEDs  | PINs            |
330+-------+-----------------+
331| LED0  | GPX_port1_bit4  |
332+-------+-----------------+
333| LED1  | GPX_port1_bit5  |
334+-------+-----------------+
335| LED2  | GPX_port1_bit6  |
336+-------+-----------------+
337| LED3  | GPX_port1_bit7  |
338+-------+-----------------+
339
340For hardware feature details, refer to : `Designware HS Development Kit website
341<https://www.synopsys.com/dw/ipdir.php?ds=arc-hs-development-kit>`__.
342
343Programming and Debugging
344*************************
345
346.. zephyr:board-supported-runners::
347
348Required Hardware and Software
349==============================
350
351To use Zephyr RTOS applications on the HS Development Kit board, a few
352additional pieces of hardware are required.
353
354* A micro USB cable provides USB-JTAG debug and USB-UART communication
355  to the board
356
357* A universal switching power adaptor (110-240V
358  AC to 12V DC), provided in the package, provides power to the board.
359
360* :ref:`The Zephyr SDK <toolchain_zephyr_sdk>`
361
362* Terminal emulator software for use with the USB-UART. Suggestion:
363  `Putty Website`_.
364
365* (optional) A collection of Pmods, Arduino modules, or Mikro modules.
366  See `Digilent Pmod Modules`_ or develop your custom interfaces to attach
367  to the Pmod connector.
368
369Set up the ARC HS Development Kit
370==================================
371
372To run Zephyr application on IoT Development Kit, you need to
373set up the board correctly.
374
375* Connect the digilent USB cable from your host to the board.
376
377* Connect the 12V DC power supply to your board
378
379Set up Zephyr Software
380======================
381
382Building Sample Applications
383==============================
384
385You can try many of the :zephyr:code-sample-category:`sample applications and demos <samples>`.
386We'll use :zephyr:code-sample:`hello_world`, found in :zephyr_file:`samples/hello_world` as an
387example.
388
389Configuring
390-----------
391
392You may need to write a prj_arc.conf file if the sample doesn't have one.
393Next, you can use the menuconfig rule to configure the target. By specifying
394``hsdk`` as the board configuration, you can select the ARC HS Development
395Kit board support for Zephyr.
396
397.. zephyr-app-commands::
398   :board: hsdk
399   :zephyr-app: samples/hello_world
400   :goals: menuconfig
401
402
403Building
404--------
405
406You can build an application in the usual way.  Refer to
407:ref:`build_an_application` for more details. Here is an example for
408:zephyr:code-sample:`hello_world`.
409
410.. zephyr-app-commands::
411   :board: hsdk
412   :zephyr-app: samples/hello_world
413   :maybe-skip-config:
414   :goals: build
415
416
417Connecting Serial Output
418=========================
419
420In the default configuration, Zephyr's HS Development Kit images support
421serial output via the USB-UART on the board.  To enable serial output:
422
423* Open a serial port emulator (i.e. on Linux minicom, putty, screen, etc)
424
425* Specify the tty driver name, for example, on Linux this may be
426  :file:`/dev/ttyUSB0`
427
428* Set the communication settings to:
429
430
431========= =====
432Parameter Value
433========= =====
434Baud:     115200
435Data:     8 bits
436Parity:    None
437Stopbits:  1
438========= =====
439
440Debugging
441==========
442
443Using the latest version of Zephyr SDK(>=0.10), you can debug and
444flash (run) HS Development Kit directly.
445
446One option is to build and debug the application using the usual
447Zephyr build system commands.
448
449.. zephyr-app-commands::
450   :board: hsdk
451   :app: <my app>
452   :goals: debug
453
454At this point you can do your normal debug session. Set breakpoints and then
455:kbd:`c` to continue into the program.
456
457The other option is to launch a debug server, as follows.
458
459.. zephyr-app-commands::
460   :board: hsdk
461   :app: <my app>
462   :goals: debugserver
463
464Then connect to the debug server at the HS Development Kit from a second
465console, from the build directory containing the output :file:`zephyr.elf`.
466
467.. code-block:: console
468
469   $ cd <my app>
470   $ $ZEPHYR_SDK_INSTALL_DIR/arc-zephyr-elf/arc-zephyr-elf-gdb zephyr.elf
471   (gdb) target remote localhost:3333
472   (gdb) load
473   (gdb) b main
474   (gdb) c
475
476Flashing
477========
478
479If you just want to download the application to the HS Development Kit's DDR
480and run, you can do so in the usual way.
481
482.. zephyr-app-commands::
483   :board: hsdk
484   :app: <my app>
485   :goals: flash
486
487This command still uses openocd and gdb to load the application elf file to
488HS Development Kit, but it will load the application and immediately run. If
489power is removed, the application will be lost since it wasn't written to flash.
490
491Most of the time you will not be flashing your program but will instead debug
492it using openocd and gdb. The program can be download via the USB cable into
493the code and data memories.
494
495The HS Development Kit also supports flashing the Zephyr application
496with the U-Boot bootloader, a powerful and flexible tool for loading
497an executable from different sources and running it on the target platform.
498
499The U-Boot implementation for the HS Development Kit was further extended with
500additional functionality that allows users to better manage the broad
501configurability of the HS Development Kit
502
503When you are ready to deploy the program so that it boots up automatically on
504reset or power-up, you can follow the steps to place the program on SD card.
505
506For details, see: `Uboot-HSDK-Command-Reference
507<https://github.com/foss-for-synopsys-dwc-arc-processors/linux/wiki/Uboot-HSDK-Command-Reference#launching-baremetal-application-on-hsdk>`__
508
509
510Release Notes
511*************
512
513References
514**********
515
516.. target-notes::
517
518.. _embARC website: https://www.embarc.org
519
520.. _Designware HS Development Kit website: https://www.synopsys.com/dw/ipdir.php?ds=arc-hs-development-kit
521
522.. _Digilent Pmod Modules: http://store.digilentinc.com/pmod-modules
523
524.. _Putty website: http://www.putty.org
525