Skip to content

Commit 5b35ac8

Browse files
committed
Update almost all hardware related articles and add EM SDP guide
1 parent 569ffcf commit 5b35ac8

File tree

15 files changed

+118
-110
lines changed

15 files changed

+118
-110
lines changed

docs/baremetal/hardware/emsdp.md

Lines changed: 3 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -67,54 +67,11 @@ Here is a list of all available `specs` files:
6767

6868
## Running an Application
6969

70-
Create a configuration file for OpenOCD and name it `emsdp.cfg`. It's necessary
71-
because it's not included in OpenOCD distribution yet:
72-
73-
```tcl
74-
# Configure JTAG cable
75-
# EM SDP has built-in FT2232 chip, which is similar to Digilent HS-1.
76-
adapter driver ftdi
77-
78-
# Only specify FTDI serial number if it is specified via
79-
# "set _ZEPHYR_BOARD_SERIAL 12345" before reading this script
80-
if { [info exists _ZEPHYR_BOARD_SERIAL] } {
81-
ftdi_serial $_ZEPHYR_BOARD_SERIAL
82-
}
83-
84-
ftdi vid_pid 0x0403 0x6010
85-
ftdi layout_init 0x0088 0x008b
86-
ftdi channel 0
87-
88-
# EM11D requires 10 MHz.
89-
adapter speed 10000
90-
91-
# ARCs support only JTAG.
92-
transport select jtag
93-
94-
source [find cpu/arc/em.tcl]
95-
96-
set _CHIPNAME arc-em
97-
set _TARGETNAME $_CHIPNAME.cpu
98-
99-
# EM SDP IDENTITY is 0x200444b1
100-
jtag newtap $_CHIPNAME cpu -irlen 4 -ircapture 0x1 -expected-id 0x200044b1
101-
102-
set _coreid 0
103-
set _dbgbase [expr {0x00000000 | ($_coreid << 13)}]
104-
105-
target create $_TARGETNAME arcv2 -chain-position $_TARGETNAME \
106-
-coreid 0 -dbgbase $_dbgbase -endian little
107-
108-
# There is no SRST, so do a software reset
109-
$_TARGETNAME configure -event reset-assert "arc_em_reset $_TARGETNAME"
110-
111-
arc_em_init_regs
112-
```
113-
114-
Start OpenOCD using `emsdp.cfg` configuration file:
70+
Follow [Using OpenOCD](../../platforms/use-openocd.md) guide and start OpenOCD
71+
with `snps_em_sk_v2.3.cfg` configuration file. Here is a possible output:
11572

11673
```text
117-
$ openocd -f ./emsdp.cfg
74+
$ openocd -f board/snps_em_sk_v2.3.cfg
11875
Open On-Chip Debugger 0.12.0+dev-gffa52f0e0 (2023-08-02-10:41)
11976
Licensed under GNU GPL v2
12077
For bug reports, read

docs/baremetal/hardware/emsk.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,8 +80,7 @@ Here is a list of all available `specs` files:
8080
## Running an Application Using OpenOCD
8181

8282
Follow [Using OpenOCD](../../platforms/use-openocd.md) guide and start OpenOCD
83-
with 49101 port and `snps_em_sk_v2.2.cfg` configuration file. Here is
84-
a possible output:
83+
with `snps_em_sk_v2.2.cfg` configuration file. Here is a possible output:
8584

8685
```text
8786
$ openocd -f board/snps_em_sk_v2.2.cfg
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# Getting Started with EM Software Development Platform
2+
3+
!!! info
4+
5+
Consider reading these guides firstly:
6+
7+
* [Configuring EM Software Development Platform](../../platforms/board-emsdp.md)
8+
* [Installing WinUSB driver on Windows](../../platforms/winusb.md)
9+
10+
## Creating the Project
11+
12+
Select **File****New****Project..** and choose **C Project**.
13+
A list of ARC projects will appear. Choose any ARC EM Starter Kit
14+
"Hello World" project from the **ARC EM SDP Projects** group.
15+
16+
![ARC EM SDP Projects](./images/emsdp-projects.png)
17+
18+
After creating the project, a simple "Hello, World!" program will be created:
19+
20+
```c
21+
/* Print a greeting on UART output and exit. */
22+
23+
#include <stdio.h>
24+
25+
int main(int argc, char *argv[])
26+
{
27+
printf("Hello, World!\n\r");
28+
return 0;
29+
}
30+
```
31+
32+
## Building the Project
33+
34+
Do right click on a project in **Project Explorer** ans choose **Build Project**.
35+
The project will be built with this output:
36+
37+
```text
38+
make all
39+
Building file: ../src/main.c
40+
Invoking: ARC GNU C Compiler
41+
/SCRATCH/ykolerov/tools/arc-2023.09/ide_fixed/bin/arc-elf32-gcc -mcpu=em4_fpuda -mcode-density -mdiv-rem -mswap -mnorm -mmpy-option=6 -mbarrel-shifter -mfpu=fpuda_all --param l1-cache-size=16384 --param l1-cache-line-size=32 -include /SCRATCH/ykolerov/ARC_GNU_IDE_Workspace/emsdp/Debug/core_config.h -O0 -g3 -Wall -c -fmessage-length=0 -gdwarf-2 -Wa,-adhlns="src/main.o.lst" -MMD -MP -MF"src/main.d" -MT"src/main.o" -o "src/main.o" "../src/main.c"
42+
Finished building: ../src/main.c
43+
44+
Building target: emsdp.elf
45+
Invoking: ARC GNU C Linker
46+
/SCRATCH/ykolerov/tools/arc-2023.09/ide_fixed/bin/arc-elf32-gcc -mcpu=em4_fpuda -mcode-density -mdiv-rem -mswap -mnorm -mmpy-option=6 -mbarrel-shifter -mfpu=fpuda_all --param l1-cache-size=16384 --param l1-cache-line-size=32 -specs=emsdp1.1.specs -Wl,-Map,emsdp.map -o "emsdp.elf" ./src/main.o
47+
Finished building target: emsdp.elf
48+
```
49+
50+
## Creating a Debug Configuration
51+
52+
Do right click on projects's name in **Project Explorer** and choose
53+
**Debug As****Debug Configurations...**. Then do right click on
54+
**ARC C/C++ application** and choose **New Configuration**. Here is a main window of
55+
the debug configuration:
56+
57+
![Debug Configuration - Main](./images/emsdp-debug-conf-main.png)
58+
59+
Ensure that a correct project and binary are selected. Navigate to **Main** tab
60+
and **Gdbserver Settings** inner tab:
61+
62+
![Debug Configuration - GDB](./images/emsdp-debug-conf-gdb.png)
63+
64+
Choose **JTAG via OpenOCD** as ARC GDB Server and **EM Software Development Platform** as
65+
a development system (use a corresponding one for your case). Then click on **Apply**.
66+
67+
## Configuring a Serial Terminal
68+
69+
Navigate to **Terminal** inner tab of **Main** tab and select a COM port for
70+
the board. Eclipse automatically detects all available COM ports. In my case
71+
it's `/dev/ttyUSB6`.
72+
73+
![Debug Configuration - Terminal](./images/emsdp-debug-conf-terminal.png)
74+
75+
On Windows you can find the exact number in **Device Manager** (it corresponds
76+
to **USB Serial Port** device):
77+
78+
![Debug Configuration - Port](./images/emsk-debug-conf-port.png)
79+
80+
On Linux a serial device for EM Software Development Platform is usually `/dev/ttyUSB1`
81+
if there are no other serial devices connected to the host.
82+
83+
## Debugging the Project
84+
85+
Open the debug configuration in **Debug Configurations** windows and click
86+
on **Debug** button. The **Debug** perspective will be opened:
87+
88+
![Debug - Perspective](./images/emsdp-debug-perspective.png)
89+
90+
Use **Step Over** button to step over `printf` function and select **Terminal**
91+
in the bottom of the window. "Hello world!" string will be printed:
92+
93+
![Debug - Output](./images/emsdp-debug-output.png)

docs/eclipse/getting-started/emsk.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
Consider reading these guides firstly:
66

7-
* [Configuring EM Starter Kit](https://github.com/foss-for-synopsys-dwc-arc-processors/ARC-Development-Systems-Forum/wiki/ARC-Development-Systems-Forum-Wiki-Home#arc-em-starter-kit-1)
7+
* [Configuring EM Starter Kit](../../platforms/board-emsk.md)
88
* [Installing WinUSB driver on Windows](../../platforms/winusb.md)
99

1010
## Creating the Project
@@ -19,11 +19,13 @@ Suppose, EM11D project is chosen.
1919
After creating the project, a simple "Hello, World!" program will be created:
2020

2121
```c
22+
/* Print a greeting on UART output and exit. */
23+
2224
#include <stdio.h>
2325

2426
int main(int argc, char *argv[])
2527
{
26-
printf("Hello world!\n\r");
28+
printf("Hello, World!\n\r");
2729
return 0;
2830
}
2931
```
@@ -78,7 +80,8 @@ to **USB Serial Port** device):
7880

7981
![Debug Configuration - Port](./images/emsk-debug-conf-port.png)
8082

81-
On Linux a serial device for EM Starter Kit is usually `/dev/ttyUSB1`.
83+
On Linux a serial device for EM Starter Kit is usually `/dev/ttyUSB1`
84+
if there are no other serial devices connected to the host.
8285

8386
## Debugging the Project
8487

docs/eclipse/getting-started/hsdk.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,24 +4,29 @@
44

55
Consider reading these guides firstly:
66

7-
* [Configuring HS Development Kit](https://github.com/foss-for-synopsys-dwc-arc-processors/ARC-Development-Systems-Forum/wiki/ARC-Development-Systems-Forum-Wiki-Home#arc-hs-development-kit-1)
8-
* [Configuring HS Development Kit 4xD](https://github.com/foss-for-synopsys-dwc-arc-processors/ARC-Development-Systems-Forum/wiki/ARC-Development-Systems-Forum-Wiki-Home#arc-hs4xhs4xd-development-kit-1)
7+
* [Configuring HS Development Kit](../../platforms/board-hsdk.md)
8+
* [Configuring HS Development Kit 4xD](../../platforms/board-hsdk-4xd.md)
99
* [Installing WinUSB driver on Windows](../../platforms/winusb.md)
1010

1111
## Creating the Project
1212

1313
Select **File****New****Project..** and choose **C Project**.
1414
A list of ARC projects will appear. Choose any **ARC HS Development Kit Hello World Project**
15-
from the **ARC EM Starter Kit Projects** group:
15+
from the **ARC HS Development Kit Projects** group:
1616

1717
![HS Development Kit Projects](./images/hsdk-projects.png)
1818

1919
An empty project will be created. Add a new C source file with name `main.c`
2020
in `src` directory in **Project Explorer**:
2121

2222
```c
23+
/* Print a greeting on UART output and exit. */
24+
25+
#include <stdio.h>
26+
2327
int main(int argc, char *argv[])
2428
{
29+
printf("Hello, World!\n\r");
2530
return 0;
2631
}
2732
```
@@ -76,7 +81,8 @@ to **USB Serial Port** device):
7681

7782
![Debug Configuration - Port](./images/emsk-debug-conf-port.png)
7883

79-
On Linux a serial device for HS Development Kit is usually `/dev/ttyUSB0`.
84+
On Linux a serial device for HS Development Kit is usually `/dev/ttyUSB0`
85+
if there are no other serial devices connected to the host.
8086

8187
## Debugging the Project
8288

247 KB
Loading
224 KB
Loading
167 KB
Loading
278 KB
Loading
328 KB
Loading

0 commit comments

Comments
 (0)