Fix issue when you don't flash the ARC and the x86 waits

- Fixed problem when the x86 hangs waiting for the ARC to
be initialized. If you flash as arduino_101 instead of
arduino_101_factory this will happen and you will not get
a command line.

- Changed default build to arduino_101_factory which is
the current recommended method of flashing the arduino_101

- Updated documentation to explain a few bits on how to flash
the board and conform to the v1.4.0 way of flashing the device.

- Added a helper to run the dfu-util command directly on make.

JerryScript-DCO-1.0-Signed-off-by: Sergio Martinez sergio.martinez.rodriguez@intel.com
This commit is contained in:
Sergio Martinez
2016-07-01 11:40:43 +01:00
parent 4921a030b3
commit c8db27c4af
4 changed files with 32 additions and 25 deletions
+1 -1
View File
@@ -20,7 +20,7 @@ $(error Missing zephyr base)
endif endif
# For testing without real hardware use qemu_x86 instead of arduino_101 # For testing without real hardware use qemu_x86 instead of arduino_101
BOARD ?= arduino_101 BOARD ?= arduino_101_factory
O ?= $(PROJECT_BASE)/outdir O ?= $(PROJECT_BASE)/outdir
+7 -7
View File
@@ -18,15 +18,11 @@ ifeq ($(.DEFAULT_GOAL),)
$(warning no default goal is set) $(warning no default goal is set)
endif endif
ifeq ($(MAKECMDGOALS),qemu) BOARD ?= arduino_101_factory
BOARD ?= qemu_x86
else
BOARD ?= arduino_101
BOARD_NAME ?= arduino_101 BOARD_NAME ?= arduino_101
endif
ifeq ($(BOARD),qemu_x86) ifeq ($(BOARD),qemu_x86)
BOARD_NAME ?= qemu_x86 BOARD_NAME = qemu_x86
endif endif
TARGET_ZEPHYR ?= ./targets/zephyr TARGET_ZEPHYR ?= ./targets/zephyr
@@ -156,6 +152,11 @@ qemu: $(EXTERNAL_LIB) $(ZEPHYR_BIN)
flash: $(EXTERNAL_LIB) $(OUTPUT)/zephyr/zephyr.strip flash: $(EXTERNAL_LIB) $(OUTPUT)/zephyr/zephyr.strip
make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG) flash make -f $(TARGET_ZEPHYR)/Makefile $(BUILD_CONFIG) flash
dfu-x86: all
@- dfu-util -a x86_app -D build/$(BOARD)/zephyr/zephyr.bin; \
if [ $$? -eq 0 ] ; then echo "\nYour program will launch in 5 seconds." ; \
else echo "\nProgram didn't flash, try pressing the reset buttons \nand wait a second for the bootloader to load, \nor flash again the factory bootloader."; fi
usage: usage:
help: help:
@echo Usage: @echo Usage:
@@ -184,7 +185,6 @@ clean:
@echo "Clearing Jerryscript" @echo "Clearing Jerryscript"
@rm -rf $(OUTPUT) @rm -rf $(OUTPUT)
@rm -rf $(INTERM) @rm -rf $(INTERM)
@rm -f $(TARGET_ZEPHYR_SRC_DIR)/.*.o.cmd
@rm -f $(TARGET_ZEPHYR_SRC_DIR)/*.o @rm -f $(TARGET_ZEPHYR_SRC_DIR)/*.o
@echo "Clearing Zephyr" @echo "Clearing Zephyr"
make -f $(TARGET_ZEPHYR)/Makefile clean make -f $(TARGET_ZEPHYR)/Makefile clean
Regular → Executable
+23 -16
View File
@@ -19,7 +19,7 @@ harmony
+ jerryscript + jerryscript
| + targets | + targets
| + zephyr | + zephyr
+ zephyr + zephyr-project
``` ```
@@ -37,13 +37,13 @@ If you just start with Zephyr, you may want to follow "Building a Sample
Application" section in the doc above and check that you can flash your Application" section in the doc above and check that you can flash your
target board. target board.
Remember to source the Zephyr environment: Remember to source the Zephyr environment as explained in the zephyr documenation:
``` ```
cd zephyr-project
source zephyr-env.sh source zephyr-env.sh
export ZEPHYR_GCC_VARIANT=zephyr export ZEPHYR_GCC_VARIANT=zephyr
export ZEPHYR_SDK_INSTALL_DIR=<sdk installation directory> export ZEPHYR_SDK_INSTALL_DIR=<sdk installation directory>
``` ```
@@ -67,20 +67,20 @@ make -f ./targets/zephyr/Makefile.zephyr BOARD=qemu_cortex_m3 qemu
``` ```
# assume you are in harmony folder # assume you are in harmony folder
cd jerry cd jerryscript
make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101 make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101_factory
``` ```
This will generate the following libraries: This will generate the following libraries:
``` ```
./build/arduino_101/librelease-cp_minimal.jerry-core.a ./build/arduino_101_factory/librelease-cp_minimal.jerry-core.a
./build/arduino_101/librelease-cp_minimal.jerry-libm.lib.a ./build/arduino_101_factory/librelease-cp_minimal.jerry-libm.lib.a
./build/arduino_101/librelease.external-cp_minimal-entry.a ./build/arduino_101_factory/librelease.external-cp_minimal-entry.a
``` ```
The final Zephyr image will be located here: The final Zephyr image will be located here:
``` ```
./build/arduino_101/zephyr/zephyr.strip ./build/arduino_101_factory/zephyr/zephyr.strip
``` ```
#### 5. Flashing #### 5. Flashing
@@ -90,32 +90,39 @@ Details on how to flash the image can be found here:
(or similar page for other supported boards). (or similar page for other supported boards).
To be able to use this demo in hardware you will need the serial console To be able to use this demo in hardware you will need the serial console
which will be generating output to Pins 0 & 1 which will be generating output to Pins 0 & 1.
You will need a 3.3v TTL to RS232, please follow the zephyr documentation on it.
Some examples of building the software Some examples of building the software
``` ```
make -f ./targets/zephyr/Makefile.zephyr clean make -f ./targets/zephyr/Makefile.zephyr BOARD=<board> clean
``` ```
- Not using a Jtag and having a factory stock Arduino 101. - Not using a Jtag and having a factory stock Arduino 101.
You can follow the Zephyr instructions to flash using the dfu-util command
or use this helper:
``` ```
make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101_factory make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101_factory dfu-x86
``` ```
Follow the Zephyr instructions to flash using the dfu-util command. Make sure you have the factory bootloader in your device to use this method or it will not flash.
- Using JTAG - Using JTAG
There is a helper function to flash using the JTAG and Flywatter2 There is a helper function to flash using the JTAG and Flywatter2
![alt tag](docs/arduino_101.jpg?raw=true "Example") ![alt tag](docs/arduino_101.jpg?raw=true "Example")
```
make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101 flash
``` ```
make -f ./targets/zephyr/Makefile.zephyr BOARD=arduino_101_factory flash
```
<warning> Careful if you flash the BOARD arduino_101, you will lose the bootloader
and you will have to follow the zephyr documentation to get it back from
the backup we all know you did at the setup. </warning>
#### 6. Serial terminal #### 6. Serial terminal
Regular → Executable
+1 -1
View File
@@ -3,5 +3,5 @@ CONFIG_NEWLIB_LIBC=y
CONFIG_FLOAT=y CONFIG_FLOAT=y
CONFIG_CONSOLE_HANDLER=y CONFIG_CONSOLE_HANDLER=y
CONFIG_CONSOLE_HANDLER_SHELL=y CONFIG_CONSOLE_HANDLER_SHELL=y
CONFIG_ARC_INIT=n