Build Instructions - HomeACcessoryKid/ESP8266-HomeKit GitHub Wiki

Build instructions for ESP8266-HomeKit

Prerequisites

  • xtensa-lx106-elf-gcc toolchain. Recommended way to get this on your computer is to install esp-open-sdk. Install using make toolchain esptool libhal STANDALONE=n
  • ESP8266_RTOS_SDK

Build Instructions

Directory Structure

ESP8266/RTOS SDK

  • If you clone ESP8266_RTOS_SDK using git, first edit ESP8266_RTOS_SDK/.git/info/exclude and add /ESP8266-HomeKit*/ to it.
esp-open-sdk$ git clone https://github.com/espressif/ESP8266_RTOS_SDK.git
esp-open-sdk$ sudo nano ESP8266_RTOS_SDK/.git/info/exclude

image

esp-open-sdk$ cd ESP8266_RTOS_SDK
ESP8266_RTOS_SDK$ git clone https://github.com/HomeACcessoryKid/ESP8266-HomeKit.git  
ESP8266_RTOS_SDK$ git clone https://github.com/HomeACcessoryKid/ESP8266-HomeKit-Demo.git
  • Your folder structure should look like this:
ESP8266_RTOS_SDK
├── ESP8266-HomeKit
├── ESP8266-HomeKit-Demo
├── LICENSE
├── Makefile
├── README.md
├── bin
├── documents
├── driver_lib
├── examples
├── extra_include
├── include
├── ld
├── lib
├── third_party
└── tools

=========================

Compiling

  • Goto the ESP8266-HomeKit directory and run the deploy.sh shell script. This will create the files:
    • ESP8266_RTOS_SDK/lib/libhkc.a
    • ESP8266_RTOS_SDK/include/hkc.h
ESP8266_RTOS_SDK$ cd ESP8266-HomeKit
ESP8266-HomeKit$ ./deploy.sh  
  • If all goes well, you should see
...
xtensa-lx106-elf-ar: creating .output/eagle/debug/lib/libhkc.a
rm -f -r _libhkc

########## success ###########
deployed lib/libhkc.a and include/hkc.h
ESP8266-HomeKit$

=====================

wolfSSL

Included (src,hdr) is a subsection of the wolfSSL 3.9.8 distribution for convenience.
We had to change 3 files which will be documented below the file tree.
Please download your own copy and verify the equality of the files (*.0 is original)
Note that additional src files should be removed to prevent excess irom size.

.
└── wolfcrypt
    ├── COPYING
    ├── LICENSING
    ├── Makefile
    ├── include
    │   └── wolfssl
    │       ├── ssl.h
    │       ├── version.h
    │       └── wolfcrypt
    │           ├── arc4.h
    │           ├── asn.h
    │           ├── asn_public.h
    │           ├── chacha.h
    │           ├── chacha20_poly1305.h
    │           ├── curve25519.h
    │           ├── ed25519.h
    │           ├── error-crypt.h
    │           ├── fe_operations.h
    │           ├── ge_operations.h
    │           ├── hash.h
    │           ├── hmac.h
    │           ├── integer.h
    │           ├── logging.h
    │           ├── memory.h
    │           ├── misc.h
    │           ├── mpi_class.h
    │           ├── mpi_superclass.h
    │           ├── poly1305.h
    │           ├── random.h
    │           ├── rsa.h
    │           ├── settings.h
    │           ├── settings.h.0
    │           ├── sha.h
    │           ├── sha256.h
    │           ├── sha512.h
    │           ├── srp.h
    │           ├── types.h
    │           ├── visibility.h
    │           └── wc_port.h
    └── src
        ├── Makefile
        ├── chacha.c
        ├── chacha20_poly1305.c
        ├── curve25519.c
        ├── ed25519.c
        ├── fe_operations.c
        ├── ge_operations.c
        ├── ge_operations.c.0
        ├── hash.c
        ├── hmac.c
        ├── integer.c
        ├── misc.c
        ├── misc.c.0
        ├── poly1305.c
        ├── random.c
        ├── sha256.c
        ├── sha512.c
        └── srp.c

$ diff ESP8266-HomeKit/wolfcrypt/src/ge_operations.c.0 ESP8266-HomeKit/wolfcrypt/src/ge_operations.c 
770c770
< static ge_precomp base[32][8] = {
---
> static ge_precomp ICACHE_RODATA_ATTR base[32][8] = {
2225c2225
< static ge_precomp Bi[8] = {
---
> static ge_precomp ICACHE_RODATA_ATTR Bi[8] = {

$ diff ESP8266-HomeKit/wolfcrypt/src/misc.c.0 ESP8266-HomeKit/wolfcrypt/src/misc.c 
48,50c48,50
< #if !defined(WOLFSSL_MISC_INCLUDED) && !defined(NO_INLINE)
<     #error misc.c does not need to be compiled when not defined NO_INLINE
< #endif
---
> // #if !defined(WOLFSSL_MISC_INCLUDED) && !defined(NO_INLINE)
> //     #error misc.c does not need to be compiled when not defined NO_INLINE
> // #endif


$ diff include/wolfssl/wolfcrypt/settings.h.0 include/wolfssl/wolfcrypt/settings.h 
33a34,35
> #define WOLFSSL_USER_SETTINGS
>