Skip to content

Commit 1198e45

Browse files
committed
doc: improve documents for examples
correct mismatch of sample output for freertos_blinky and xymem add multicore example README.rst correct license to copyright 2021 Signed-off-by: Yuguo Zou <yuguo.zou@synopsys.com>
1 parent 579f1be commit 1198e45

File tree

10 files changed

+107
-30
lines changed

10 files changed

+107
-30
lines changed

board/board.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,7 @@ static void task_main(void *par)
209209
ercd = arc_goto_main(main_arg->argc, main_arg->argv);
210210
}
211211

212-
EMBARC_PRINTF("Exit from main function, error code:%d....\r\n", ercd);
212+
EMBARC_PRINTF("Exit from main function, return code: %d \r\n", ercd);
213213
while (1) {
214214
vTaskSuspend(NULL);
215215
}

doc/documents/example/example.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,11 @@ JTAG, or the .bin files through SD card by secondary bootloader.
2525
Example Directory Example Document Link
2626
======================================================= =============================================
2727
example/baremetal/arc_feature/cache :ref:`example_arc_feature_cache`
28+
example/baremetal/arc_feature/memory_protection :ref:`example_arc_feature_memory_protection`
29+
example/baremetal/arc_feature/multicore :ref:`example_arc_feature_smp`
2830
example/baremetal/arc_feature/timer_interrupt :ref:`example_arc_feature_timer_interrupt`
2931
example/baremetal/arc_feature/udma :ref:`example_arc_feature_udma`
32+
example/baremetal/arc_feature/xymem :ref:`example_arc_feature_xymem`
3033
example/baremetal/ble_hm1x :ref:`example_ble_hm1x`
3134
example/baremetal/blinky :ref:`example_blinky`
3235
example/baremetal/bootloader :ref:`example_bootloader`
@@ -37,6 +40,7 @@ JTAG, or the .bin files through SD card by secondary bootloader.
3740
example/baremetal/openthread/cli :ref:`example_openthread_cli`
3841
example/baremetal/openthread/ncp :ref:`example_openthread_ncp`
3942
example/freertos/esp8266_wifi :ref:`example_esp8266_wifi`
43+
example/freertos/freertos_blinky :ref:`example_freertos_blinky`
4044
example/freertos/iot/coap/coap_server :ref:`example_iot_coap_coap_server`
4145
example/freertos/iot/lwm2m/lwm2m_client :ref:`example_iot_lwm2m_lwm2m_client`
4246
example/freertos/iot/lwm2m/lwm2m_server :ref:`example_iot_lwm2m_lwm2m_server`

example/baremetal/arc_feature/memory_protection/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ------------------------------------------
2-
* Copyright (c) 2017, Synopsys, Inc. All rights reserved.
2+
* Copyright (c) 2021, Synopsys, Inc. All rights reserved.
33
44
* Redistribution and use in source and binary forms, with or without modification,
55
* are permitted provided that the following conditions are met:

example/baremetal/arc_feature/multicore/README.rst

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,89 @@ ARC SMP Example
66
Overview
77
********
88

9+
This example shows a paradigm of multi-core programming in |embarc|.
10+
911
Detailed Description
1012
====================
1113

14+
* Extra Required Tools
15+
NO
16+
17+
* Extra Required Peripherals
18+
NO
19+
20+
* Design Concept
21+
This example is designed to show the basics of |arc| multi-core features, including spinlock, inter-core interrupts (ici). This example works on nsim and hsdk.
22+
23+
.. note::
24+
In makefile we provide extra command work for multi-core secnarios. Please use mp_run or mp_gui for running or debugging the example.
25+
1226
Buidling and Running
1327
********************
28+
This example outputs to the console. It is supported by all platform. The commands
29+
to run this example are as follows:
30+
31+
.. code-block:: console
32+
33+
$ cd <embarc_root>/example/baremetal/arc_feature/multicore
34+
$ make BOARD=nsim mp_run
1435
1536
Sample Output
1637
=============
1738

39+
.. code-block:: console
40+
41+
____ _ ____
42+
| _ \ _____ _____ _ __ ___ __| | __ ) _ _
43+
| |_) / _ \ \ /\ / / _ \ '__/ _ \/ _` | _ \| | | |
44+
| __/ (_) \ V V / __/ | | __/ (_| | |_) | |_| |
45+
|_| \___/ \_/\_/ \___|_| \___|\__,_|____/ \__, |
46+
|___/
47+
_ _ ____ ____
48+
___ _ __ ___ | |__ / \ | _ \ / ___|
49+
/ _ \ '_ ` _ \| '_ \ / _ \ | |_) | |
50+
| __/ | | | | | |_) / ___ \| _ <| |___
51+
\___|_| |_| |_|_.__/_/ \_\_| \_\\____|
52+
------------------------------------------------------------
53+
54+
embARC Build Time: Sep 13 2021, 17:28:58
55+
Compiler Version: Metaware, Clang 11.1.0
56+
core 1 starts to run
57+
core 1 in arc connect is 1
58+
core 0 starts to run
59+
core 0 in arc connect is 0
60+
core 1 delay 9 ticks
61+
core 0 receives int from core 1
62+
core 0 delay 5 ticks
63+
core 1 receives int from core 0
64+
core 0 delay 5 ticks
65+
core 1 receives int from core 0
66+
core 1 delay 9 ticks
67+
core 0 receives int from core 1
68+
core 0 delay 5 ticks
69+
core 1 receives int from core 0
70+
core 0 delay 5 ticks
71+
core 1 receives int from core 0
72+
core 1 delay 9 ticks
73+
core 0 receives int from core 1
74+
core 0 delay 5 ticks
75+
core 1 receives int from core 0
76+
core 0 delay 5 ticks
77+
core 1 receives int from core 0
78+
core 1 delay 9 ticks
79+
core 0 receives int from core 1
80+
core 0 delay 5 ticks
81+
core 1 receives int from core 0
82+
core 0 delay 5 ticks
83+
core 1 receives int from core 0
84+
core 1 delay 9 ticks
85+
core 0 receives int from core 1
86+
core 0 delay 5 ticks
87+
core 1 receives int from core 0
88+
core 1 delay 9 ticks
89+
core 0 receives int from core 1
90+
core 0 delay 5 ticks
91+
core 1 receives int from core 0
92+
core 0 delay 5 ticks
93+
core 1 receives int from core 0
94+
.................

example/baremetal/arc_feature/multicore/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ------------------------------------------
2-
* Copyright (c) 2019, Synopsys, Inc. All rights reserved.
2+
* Copyright (c) 2021, Synopsys, Inc. All rights reserved.
33
44
* Redistribution and use in source and binary forms, with or without modification,
55
* are permitted provided that the following conditions are met:

example/baremetal/arc_feature/xymem/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ------------------------------------------
2-
* Copyright (c) 2017, Synopsys, Inc. All rights reserved.
2+
* Copyright (c) 2021, Synopsys, Inc. All rights reserved.
33
44
* Redistribution and use in source and binary forms, with or without modification,
55
* are permitted provided that the following conditions are met:

example/baremetal/arc_feature/xymem/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ JTAG ?= usb
1111
#
1212
EMBARC_ROOT = ../../../..
1313

14+
MID_SEL = common
15+
1416
# application source dirs
1517
APPL_CSRC_DIR = .
1618
APPL_ASMSRC_DIR = .

example/freertos/freertos_blinky/README.rst

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
.. _example_freertos_demo:
1+
.. _example_freertos_blinky:
22

33
FreeRTOS Demo
44
#############
@@ -38,27 +38,16 @@ to run this example are as follows:
3838

3939
.. code-block:: console
4040
41-
$ cd <embarc_root>/example/freertos_demo
42-
$ make BOARD=emsk BD_VER=11 CUR_CORE=arcem6 TOOLCHAIN=gnu run
41+
$ cd <embarc_root>/example/freertos/freertos_blinky
42+
$ make BOARD=emsk run
4343
4444
If you do not have an EMSK development board, you can use the nSIM simulator
4545
which have been installed in MetaWare IDE.
4646

4747
.. code-block:: console
4848
49-
$ cd <embarc_root>/example/freertos_demo
50-
$ gmake BOARD=nsim BD_VER=1506 CUR_CORE=arcemfull TOOLCHAIN=mw run
51-
52-
.. note:: Make sure you have selected the correct configuration of EMSK via dipswitches and that you have reset the board (button above “R”) to confirme its configuration
53-
54-
If you wish to run ARC v1 series cores on nSIM simulator
55-
which have been installed in MetaWare IDE.
56-
Core here is specified to arc610d, other choices are arc605, arc710d
57-
58-
.. code-block:: console
59-
60-
$ cd <embarc_root>/example/freertos_demo
61-
$ gmake BOARD=nsim CUR_CORE=arc610d TOOLCHAIN=mw_mcc run
49+
$ cd <embarc_root>/example/freertos/freertos_blinky
50+
$ gmake BOARD=nsim run
6251
6352
Sample Output
6453
=============
@@ -69,9 +58,11 @@ download is successful.
6958

7059
.. code-block:: console
7160
72-
C:\embarc_bsp\example\freertos_demo> gmake BOARD=nsim CUR_CORE=arc610d TOOLCHAIN=mw_mcc run
73-
"Download & Run obj_nsim_10/mw_mcc_arc610d/freertos_demo_mw_mcc_arc610d.elf"
74-
mdb -nooptions -nogoifmain -toggle=include_local_symbols=1 -nsim -off=binary_stdin -off=binary_stdout -on=load_at_paddr -on=reset_upon_restart -off=flush_pipe -off=cr_for_more -OKN @obj_nsim_10/mw_mcc_arc610d/embARC_generated/mdb.arg -run obj_nsim_10/mw_mcc_arc610d/freertos_demo_mw_mcc_arc610d.elf
61+
C:\embarc_bsp\example\freertos/freertos_blinky> gmake BOARD=nsim run
62+
"Download & Run obj_nsim_10/mw_arcem/freertos_blinky_mw_arcem.elf"
63+
mdb -nooptions -nogoifmain -toggle=include_local_symbols=1 -nsim -off=binary_stdin -off=binary_stdout -on=load_at_paddr -on=reset_upon_restart -off=flush_pipe -off=cr_for_more -OKN -prop=nsim_mem-dev=uart0,kind=dwuart,base=0xf0000000,irq=24 @obj_nsim_10/mw_arcem/embARC_generated/mdb.arg -run obj_nsim_10/mw_arcem/freertos_blinky_mw_arcem.elf
64+
11:19:04.575058 WARN:[IO-DEVMGR] SYS device uart0: Unhandled property: kind
65+
Console now belongs to UART, hit CRTL-] to return to simulator.
7566
-----------------------------------------------------------
7667
____ _ ____
7768
| _ \ _____ _____ _ __ ___ __| | __ ) _ _
@@ -86,12 +77,14 @@ download is successful.
8677
\___|_| |_| |_|_.__/_/ \_\_| \_\\____|
8778
------------------------------------------------------------
8879
89-
embARC Build Time: Aug 4 2020, 15:43:58
90-
Compiler Version: Metaware, mcc
91-
80+
embARC Build Time: Sep 14 2021, 10:54:36
81+
Compiler Version: Metaware, Clang 11.1.0
9282
[main] Helloworld! This is a freertos demo!
9383
[task_blinky] Helloworld! This is a freertos demo!
9484
led out: ff, ff
85+
Exit from main function, return code: 0
86+
led out: ff00, ff
87+
led out: ff, ff
9588
led out: ff00, ff
9689
led out: ff, ff
9790
led out: ff00, ff

example/freertos/freertos_blinky/main.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/* ------------------------------------------
2-
* Copyright (c) 2017, Synopsys, Inc. All rights reserved.
2+
* Copyright (c) 2021, Synopsys, Inc. All rights reserved.
33
44
* Redistribution and use in source and binary forms, with or without modification,
55
* are permitted provided that the following conditions are met:
@@ -43,9 +43,8 @@ int main(void)
4343

4444
EMBARC_PRINTF("[main] Helloworld! This is a freertos demo!\r\n");
4545
xTaskCreate(task_blinky, "blinky", configMINIMAL_STACK_SIZE, NULL, (tskIDLE_PRIORITY + 3), NULL);
46-
// vTaskStartScheduler();
47-
// should not reach here
48-
return E_SYS;
46+
47+
return E_OK;
4948
}
5049

5150
static void task_blinky(void *par)

example/freertos/freertos_blinky/makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ OS_SEL ?= freertos
77
#
88
EMBARC_ROOT = ../../..
99

10+
MID_SEL = common
11+
1012
# application source dirs
1113
APPL_CSRC_DIR = .
1214
APPL_ASMSRC_DIR = .

0 commit comments

Comments
 (0)