From 45c1ef0f7416a5bc043cccadf1eed761a0365fec Mon Sep 17 00:00:00 2001 From: Watson Zeng Date: Fri, 7 Feb 2020 14:29:16 +0800 Subject: [PATCH 1/3] arc_design_contest: add folder for FY19 contest Signed-off-by: Watson Zeng --- arc_design_contest/2020/README.md | 1 + 1 file changed, 1 insertion(+) create mode 100644 arc_design_contest/2020/README.md diff --git a/arc_design_contest/2020/README.md b/arc_design_contest/2020/README.md new file mode 100644 index 00000000..ed60c9dd --- /dev/null +++ b/arc_design_contest/2020/README.md @@ -0,0 +1 @@ +# This folder for FY20 contest. From 5c51e7e73d19d59340a21ee9c48d7dfe4116c5f9 Mon Sep 17 00:00:00 2001 From: Watson Zeng Date: Tue, 11 Feb 2020 09:16:24 +0800 Subject: [PATCH 2/3] contest: 2020: add a blinky application Signed-off-by: Watson Zeng --- arc_design_contest/2020/blinky/README.rst | 89 +++++++++++++++++++++++ arc_design_contest/2020/blinky/main.c | 49 +++++++++++++ arc_design_contest/2020/blinky/makefile | 23 ++++++ 3 files changed, 161 insertions(+) create mode 100644 arc_design_contest/2020/blinky/README.rst create mode 100644 arc_design_contest/2020/blinky/main.c create mode 100644 arc_design_contest/2020/blinky/makefile diff --git a/arc_design_contest/2020/blinky/README.rst b/arc_design_contest/2020/blinky/README.rst new file mode 100644 index 00000000..f4e6b6a0 --- /dev/null +++ b/arc_design_contest/2020/blinky/README.rst @@ -0,0 +1,89 @@ +.. _example_blinky: + +Blinky +###### + +Overview +******** + + This example is designed to test board without any extra peripheral. + +Detailed Description +==================== + * Extra Required Tools + NO + + * Extra Required Peripherals + NO + + * Design Concept + This example is designed to test board without any extra peripheral + + * Usage Manual + Toggle all leds on board in 1s period + + * Extra Comments + NO + +Buidling and Running +******************** + +This example outputs to the console. It is supported by all platform. The commands +to run this example are as follows: + +.. code-block:: console + + $ cd /example/baremetal/blinky + $ make BOARD=emsk BD_VER=11 CUR_CORE=arcem6 TOOLCHAIN=gnu run + +If you do not have an EMSK development board, you can use the nSIM simulator +which have been installed in MetaWare IDE. + +.. code-block:: console + + $ cd /example/baremetal/blinky + $ gmake BOARD=nsim BD_VER=1506 CUR_CORE=arcemfull TOOLCHAIN=mw run + +.. 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 + +Sample Output +============= + +If you are using the **nSIM**, one console msg wil be used to simulate the +bink of LEDs, you will see the following output in the CMD window when the +download is successful. + +.. code-block:: console + + Microsoft Windows [Version 10.0.15063] + (c) 2017 Microsoft Corporation. All rights reserved. + + C:\embarc_osp-master\example\baremetal\blinky>gmake BOARD=nsim TOOLCHAIN=mw -j4 run + "Creating Directory : " obj_nsim_1506/mw_arcemfull/application/. + "Creating Directory : " obj_nsim_1506/mw_arcemfull/arc + "Creating Directory : " obj_nsim_1506/mw_arcemfull/board + "Creating Directory : " obj_nsim_1506/mw_arcemfull/board/nsim/drivers/uart + "Creating Directory : " obj_nsim_1506/mw_arcemfull/library/clib + ......................... + "Linking : " obj_nsim_1506/mw_arcemfull/blinky_mw_arcemfull.elf + "Download & Run obj_nsim_1506/mw_arcemfull/blinky_mw_arcemfull.elf" + 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 -arcv2em -core2 -Xtimer0 -Xtimer1 -Xlib -Xmpy_option=6 -Xdiv_rem=radix2 -Xcode_density -Xatomic -Xbitscan -Xbarrel_shifter -mpu -mpu_regions=16 -Xdsp2 -Xdsp_complex -Xdsp_divsqrt=radix2 -Xdsp_itu -Xdsp_accshift=full -Xagu_large -Xxy -Xbitstream -Xfpus_div -Xfpu_mac -Xfpus_mpy_slow -Xfpus_div_slow -firq -interrupts=8 -ext_interrupts=6 -interrupt_priorities=16 -icache_feature=2 -iccm_base=0x00000000 -iccm_size=0x00080000 -dcache_feature=2 -dccm_base=0x80000000 -dccm_size=0x00080000 -rgf_num_banks=2 -rgf_banked_regs=32 -pc_width=32 -dmac -dmac_channels=2 -dmac_registers=0 -dmac_fifo_depth=2 -dmac_int_config=single_internal -run obj_nsim_1506/mw_arcemfull/blinky_mw_arcemfull.elf + led out: ff, ff + led out: ff00, ff + led out: ff, ff + led out: ff00, ff + led out: ff, ff + led out: ff00, ff + led out: ff, ff + led out: ff00, ff + led out: ff, ff + led out: ff00, ff + led out: ff, ff + led out: ff00, ff + led out: ff, ff + led out: ff00, ff + led out: ff, ff + ................. + +If you are using the **ARC EMSK** development board, you will see the leds +start to blink when the download is successful. diff --git a/arc_design_contest/2020/blinky/main.c b/arc_design_contest/2020/blinky/main.c new file mode 100644 index 00000000..bf9e589d --- /dev/null +++ b/arc_design_contest/2020/blinky/main.c @@ -0,0 +1,49 @@ +/* ------------------------------------------ + * Copyright (c) 2017, Synopsys, Inc. All rights reserved. + + * Redistribution and use in source and binary forms, with or without modification, + * are permitted provided that the following conditions are met: + + * 1) Redistributions of source code must retain the above copyright notice, this + * list of conditions and the following disclaimer. + + * 2) Redistributions in binary form must reproduce the above copyright notice, + * this list of conditions and the following disclaimer in the documentation and/or + * other materials provided with the distribution. + + * 3) Neither the name of the Synopsys, Inc., nor the names of its contributors may + * be used to endorse or promote products derived from this software without + * specific prior written permission. + + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR + * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT + * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + * +--------------------------------------------- */ +#include "embARC.h" +#include "embARC_debug.h" + +#define LED_TOGGLE_MASK BOARD_LED_MASK + +/** + * \brief Test hardware board without any peripheral + */ +int main(void) +{ + uint16_t led_toggle_val = LED_TOGGLE_MASK; + + while (1) { + led_write(led_toggle_val, BOARD_LED_MASK); + led_toggle_val = ~led_toggle_val; + board_delay_ms(500, 1); + } + + return E_SYS; +} diff --git a/arc_design_contest/2020/blinky/makefile b/arc_design_contest/2020/blinky/makefile new file mode 100644 index 00000000..0ad9ff9a --- /dev/null +++ b/arc_design_contest/2020/blinky/makefile @@ -0,0 +1,23 @@ +# Application name +APPL ?= blinky + +# +# root dir of embARC +# +EMBARC_ROOT = ../../.. + +MID_SEL = common + +# application source dirs +APPL_CSRC_DIR = . +APPL_ASMSRC_DIR = . + +# application include dirs +APPL_INC_DIR = . + +# include current project makefile +COMMON_COMPILE_PREREQUISITES += makefile + +### Options above must be added before include options.mk ### +# include key embARC build system makefile +include $(EMBARC_ROOT)/options/options.mk \ No newline at end of file From 8c693c4628f8c471a8245e866537dc28b76a1954 Mon Sep 17 00:00:00 2001 From: Watson Zeng Date: Tue, 11 Feb 2020 09:21:50 +0800 Subject: [PATCH 3/3] contest: 2020: blinky: fix the embarc_osp root path Signed-off-by: Watson Zeng --- arc_design_contest/2020/blinky/makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arc_design_contest/2020/blinky/makefile b/arc_design_contest/2020/blinky/makefile index 0ad9ff9a..48b3c2c9 100644 --- a/arc_design_contest/2020/blinky/makefile +++ b/arc_design_contest/2020/blinky/makefile @@ -4,7 +4,7 @@ APPL ?= blinky # # root dir of embARC # -EMBARC_ROOT = ../../.. +EMBARC_ROOT = ../../../../../ MID_SEL = common