• Home
Name
Date
Size
#Lines
LOC

..--

docs/12-May-2024-12191

include/12-May-2024-9830

js/12-May-2024-2215

ld/12-May-2024-3328

user/12-May-2024-557333

LICENSED12-May-20243 KiB5737

MakefileD12-May-20244.1 KiB16380

Makefile.esp8266D12-May-20242.6 KiB8755

Makefile.travisD12-May-20241.8 KiB4714

readme.mdD12-May-20242.1 KiB8959

readme.md

1 ### About
2 
3 Files in this folder (targets/esp8266) are copied from
4 `examples/project_template` of `esp_iot_rtos_sdk` and modified for JerryScript.
5 You can view online from
6 [this](https://github.com/espressif/esp_iot_rtos_sdk/tree/master/examples/project_template) page.
7 
8 
9 ### How to build JerryScript for ESP8266
10 
11 #### 1. SDK
12 
13 Follow [this](./docs/ESP-PREREQUISITES.md) page to setup build environment
14 
15 
16 #### 2. Building JerryScript
17 
18 ```
19 # assume you are in jerryscript folder
20 make -f ./targets/esp8266/Makefile.esp8266
21 ```
22 
23 Output files should be placed at $BIN_PATH
24 
25 #### 3. Flashing for ESP8266 12E
26 Follow
27 [this](http://www.kloppenborg.net/images/blog/esp8266/esp8266-esp12e-specs.pdf) page to get details about this board.
28 
29 ```
30 make -f ./targets/esp8266/Makefile.esp8266 flash
31 ```
32 
33 Default USB device is `/dev/ttyUSB0`. If you have different one, give with `USBDEVICE`, like;
34 
35 ```
36 USBDEVICE=/dev/ttyUSB1 make -f ./targets/esp8266/Makefile.esp8266 flash
37 ```
38 
39 ### 4. Running
40 
41 * power off
42 * connect GPIO2 with serial of 470 Ohm + LED and to GND
43 * power On
44 
45 LED should blink on and off every second
46 
47 #### 5. Cleaning
48 
49 To clean the build result:
50 
51 ```
52 make -f ./targets/esp8266/Makefile.esp8266 clean
53 ```
54 
55 To clean the board's flash memory:
56 ```
57 make -f ./targets/esp8266/Makefile.esp8266 erase_flash
58 ```
59 
60 
61 ### 6. Optimizing initial RAM usage (ESP8266 specific)
62 The existing open source gcc compiler with Xtensa support stores const(ants) in
63 the same limited RAM where our code needs to run.
64 
65 It is possible to force the compiler to store a constant into ROM and also read it from there thus saving RAM.
66 The only requirement is to add `JERRY_ATTR_CONST_DATA` attribute to your constant.
67 
68 For example:
69 
70 ```C
71 static const lit_magic_size_t lit_magic_string_sizes[] =
72 ```
73 
74 can be modified to
75 
76 ```C
77 static const lit_magic_size_t lit_magic_string_sizes[] JERRY_ATTR_CONST_DATA =
78 ```
79 
80 That is already done to some constants in jerry-core. E.g.:
81 
82 - vm_decode_table
83 - ecma_property_hashmap_steps
84 - lit_magic_string_sizes
85 - unicode_letter_interv_sps
86 - unicode_letter_interv_len
87 - unicode_non_letter_ident_
88 - unicode_letter_chars
89