Skip to content
This repository was archived by the owner on Sep 6, 2023. It is now read-only.

BLE Implementation #86

Closed
wants to merge 110 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
110 commits
Select commit Hold shift + click to select a range
6f5b5d5
esp32/Makefile: Initial changes for bluetooth
MrSurly Apr 3, 2017
fef2158
esp32/Makefile: Updated to include BT code from ESP-IDF
MrSurly Apr 3, 2017
b53cb3c
esp32/main.c: reduced heap to 64k
MrSurly Apr 5, 2017
f4661ff
Merge branch 'esp32' into dev-bluetooth
MrSurly Apr 6, 2017
6690be0
esp32/Makefile: added includes for bluetooth
MrSurly Apr 6, 2017
5ab9967
esp32/modnetwork: added declaration for bluetooth object
MrSurly Apr 6, 2017
d6e7755
esp32/network_bluetooth.h: removed this unnecessary header
MrSurly Apr 6, 2017
5dfb599
esp32/network_bluetooth.c: Added init, and params setting
MrSurly Apr 6, 2017
aa66352
esp32/Makefile: added a bunch more objects and headers for bluetooth
MrSurly Apr 10, 2017
430ab74
esp32/network_bluetooth.c: Power through adding more options for ble
MrSurly Apr 10, 2017
aa689cc
esp32/network_bluetooth.c: Power through adding more options for ble
MrSurly Apr 10, 2017
b3f9f9f
esp32/network_bluetooth.c: Power through adding more options for ble
MrSurly Apr 10, 2017
b30b9b0
esp32/Makefile: Added a whole bunch of BT objects
MrSurly Apr 11, 2017
39b25b3
esp32/network_bluetooth.c: Many, many changes, as it's early days
MrSurly Apr 11, 2017
4f0b56b
esp32/network_bluetooth.c: Ensured all params checked
MrSurly Apr 12, 2017
2550151
esp32/network_bluetooth.c: Removed errant comment
MrSurly Apr 12, 2017
1ee5018
esp32/modesp.c: moved FAT fs to 0x200000
MrSurly Apr 12, 2017
63aa7ad
esp32/modules/flashbdev.py: Increased FAT FS to 2MiB
MrSurly Apr 12, 2017
7e2ce6a
esp32/Makefile: Default FLASH_MODE to dio for WROOM-32
MrSurly Apr 12, 2017
4d7b609
Merge branch 'dev_issue_70' into dev-bluetooth
MrSurly Apr 12, 2017
0c3ec62
esp32/main.c: Lowered heap to 16K ... =(
MrSurly Apr 12, 2017
6ad57e0
esp32/sdkconfig.h: Added new needed config for BT
MrSurly Apr 12, 2017
31218f5
esp32/network_bluetooth.c: Added ble_adv_enable function
MrSurly Apr 12, 2017
f1d0fec
esp32/Makefile: added another BT object file
MrSurly Apr 18, 2017
2e9749c
esp32/network_bluetooth: Added services, characteristics, cleanup
MrSurly Apr 18, 2017
0107735
esp32/network_bluetooth.c: API now more like https://goo.gl/Djt044
MrSurly Apr 20, 2017
da2e704
esp32/network_bluetooth.c: More changes as the API evolves
MrSurly Apr 21, 2017
d42bb04
esp32/network_bluetooth.c: Got past exception in callback
MrSurly Apr 24, 2017
5597cc9
Merge branch 'esp32' into dev-bluetooth
MrSurly Apr 24, 2017
9b04924
esp32/Makefile: many changes for new IDF; headers were clashing
MrSurly Apr 24, 2017
7595b38
esp32/Makefile: spi_flash/include --> INC_MAIN
MrSurly Apr 24, 2017
4613494
esp32/network_bluetooth.c: Services working, added Bluetooth.callback()
MrSurly Apr 24, 2017
fa8b776
esp32:network_bluetooth.c: Just got characteristic callbacks working
MrSurly Apr 25, 2017
64fee58
esp32/network_bluetooth.c: Fixed bug in network_bluetooth_find_item
MrSurly Apr 26, 2017
bbb40cd
esp32/network_bluetooth.c: Added connect/disconnect callback
MrSurly Apr 26, 2017
ce8d26a
esp32/Makefile: added GATTC headers/objects
MrSurly Apr 26, 2017
7773bdf
esp32/network_bluetooth.c: Updated event debug, added gattc scanning
MrSurly Apr 26, 2017
7bb0328
esp32/network_bluetooth.c: Added callbacks for scanning
MrSurly Apr 27, 2017
f608a6e
esp32/network_bluetooth.c: Doing callback as a ring buffer
MrSurly Apr 28, 2017
c505d56
esp32/network_bluetooth.c: Added GIL for mallocs in IDF callback
MrSurly Apr 28, 2017
797c2cd
esp32/network_bluetooth.c: Chars() constructor now takes kw args
MrSurly Apr 30, 2017
cc14148
esp32/network_bluetooth.c: Fixed callback handler for char write
MrSurly May 1, 2017
3706cca
esp32/network_bluetooth.c: start/stop/close service is now working
MrSurly May 1, 2017
90d377d
esp32/network_bluetooth.c: Added indication/notification to chars
MrSurly May 1, 2017
eb69763
esp32/network_bluetooth.c: event ringbuffer --> linked list, having G…
MrSurly May 1, 2017
61fc0ad
esp32/main.c: heap 16Kib -> 12kIb
MrSurly May 2, 2017
2f523c9
esp32/network_bluetooth.c: now using FreeRTOS queues for callback data
MrSurly May 2, 2017
717a24c
esp32/bluetooth_api_proposal.txt: updated to reflect current development
MrSurly May 2, 2017
6e3dfd6
esp32/main.c: heap size back to 32Kib
MrSurly May 3, 2017
71fae46
esp32/network_bluetooth.c: Many changes, much more stable now
MrSurly May 3, 2017
7e3214a
esp32/network_bluetooth.c: Working on adding GATTC connections
MrSurly May 5, 2017
0dc0adb
esp32/bluetooth_api_proposal.txt: Updated api
MrSurly May 5, 2017
0307f1f
esp32/network_bluetooth.c: Many changes WRT GATTC
MrSurly May 5, 2017
32f29e9
esp32/network_bluetooth.c: GATTC nearly done; notifications still broken
MrSurly May 8, 2017
8fb8b61
esp32/main.c: heap now 48K
MrSurly May 9, 2017
7bcf664
esp32/sdkconfig.h: added #define CONFIG_BT_DRAM_RELEASE 1
MrSurly May 9, 2017
a2cfc95
esp32/network_bluetooth.c: Finished up GATTC
MrSurly May 9, 2017
261fb5d
esp32/bluetooth_api_proposal.txt: Removed
MrSurly May 9, 2017
48c0c6a
esp32/network_bluetooth.c: Added some final constants, other tweaks
MrSurly May 10, 2017
8eaacc1
reformatted, many minor fixes
MrSurly May 10, 2017
4c4491a
esp32/network_bluetooth.c: Removed many unneccessary switch statement…
MrSurly May 10, 2017
2121a5d
Updated docs to reflect use of bytes, added an example section
MrSurly May 10, 2017
636522e
esp32/network_bluetooth.c: Checked FIXMEs, removed whitespace, fixed …
MrSurly May 12, 2017
c6307a3
esp32/Makefile: Updated to latest IDF
MrSurly May 15, 2017
c1079be
Merge branch 'dev-idf-1e0710f' into dev-bluetooth
MrSurly May 15, 2017
705eb88
esp32/network_bluetooth.c: Updated to latest IDF
MrSurly May 15, 2017
7cfc572
exp32/sdkconfig.h: changed defines from "y" to "1"
MrSurly May 15, 2017
7060dd2
esp32/Makefile: -Wno-error=array-bounds for dport_access.o
MrSurly May 16, 2017
5da175f
Merge branch 'dev-idf-1e0710f' into dev-bluetooth-idf-dev-idf-1e0710f
MrSurly May 16, 2017
d3ce5d6
esp32/network_bluetooth.c: Fixed formatting for char print
MrSurly May 17, 2017
47ea758
Merge branch 'esp32' into dev-bluetooth-idf-dev-idf-1e0710f
MrSurly May 17, 2017
9246c32
esp32/modnetwork.c: Added #if around bluetooth class
MrSurly May 17, 2017
124ef41
esp32/network_bluetooth.c: disabled event debugging
MrSurly May 17, 2017
291438c
esp32/network_bluetooth.c: Added GATTS descriptors
MrSurly May 19, 2017
e4817d0
esp32/network_bluetooth.c: descriptors --> descrs, removed debugging …
MrSurly May 19, 2017
e51467b
esp32/network_bluetooth.c: Fixed print output for descriptors, remove…
MrSurly May 19, 2017
910a2d8
updated docs for GATTS Descr
MrSurly May 19, 2017
9783195
Merge branch 'esp32' into dev-bluetooth
MrSurly May 23, 2017
c7f7574
esp32/network_bluetooth.c: Added more parameters to scan_start
MrSurly May 24, 2017
12c22d1
esp32/bluetoot_docs.md: Updated for scan_start
MrSurly May 24, 2017
1d2a575
esp32/network_bluetooth.c: Fix, GATTS Descr w/ multiple chars
MrSurly May 30, 2017
1702ced
esp32/bluetooth_docs.md: Fixed some incorrect information WRT scan
MrSurly May 31, 2017
009a1d6
Merged in some parts from esp32
MrSurly May 31, 2017
83b66f7
Merge branch 'esp32' into dev-bluetooth
MrSurly May 31, 2017
987525d
esp32/network_bluetooth.c: Fixed descriptor handle enumeration
MrSurly Jun 1, 2017
40f4500
esp32/bluetooth_docs.md: Added RSSI to scan results
MrSurly Jun 6, 2017
e908002
esp32/network_bluetooth.c: Fixed issue with multiple chars
MrSurly Jul 3, 2017
8feee1d
esp32/Makefile: non-working attempt to match Makefile to esp32 branch
MrSurly Jul 5, 2017
293fecd
Merge branch 'esp32' into dev-bluetooth
MrSurly Jul 5, 2017
58618f5
esp32/Makefile: merged esp32 branch
MrSurly Jul 5, 2017
f90d5ba
esp32/sdkconfig.h: Added new flags for BT for updated IDF
MrSurly Jul 6, 2017
83d5cbb
esp32/network_bluetooth.c: Updated for IDF, fixed descr bug
MrSurly Jul 6, 2017
f0b7ba4
esp32/Makefile: Bluetooth now build configurable
MrSurly Jul 6, 2017
073b97c
esp32/Makefile: Fixed WDT crash on BT start
MrSurly Jul 7, 2017
9097c09
Minor formatting
MrSurly Jul 10, 2017
d182a68
esp32/bluetooth_docs.md: Updated docs to reflect current API
MrSurly Jul 10, 2017
3aac389
Merge branch 'dev-bluetooth' of github.com:MrSurly/micropython-esp32 …
MrSurly Jul 10, 2017
8ed22d1
esp32/bluetooth_docs.md: Fixed formatting, added .disconnect
MrSurly Jul 10, 2017
fc166f7
esp32/network_bluetooth.c: Added disconnect() to GATTCConn
MrSurly Jul 10, 2017
2b4dc1c
esp32/network_bluetooth.c: All properties now functions
MrSurly Jul 13, 2017
e00c2a3
esp32/network_bluetooth.c: Fix for bad char write
MrSurly Jul 18, 2017
919c79f
esp32/network_bluetooth.c: Fix for disconnect/reconnect
MrSurly Jul 18, 2017
f782f8a
esp32/bluetooth_docs.md: Updated doc for bluetooth.conns()
MrSurly Jul 18, 2017
88645eb
esp32/network_bluetooth.c: Fixed duplicate conn obj on device disconnect
MrSurly Aug 22, 2017
e00c2d0
Merge branch 'esp32' into dev-bluetooth
MrSurly Aug 23, 2017
6add00f
esp32/Makefile: Modified to be more inline with esp32 branch
MrSurly Aug 23, 2017
54f3547
updated code example to match current API
MrSurly Sep 5, 2017
f494f59
Fix docs > `adv_enable` needs `ble_` prefix
ruudk Sep 19, 2017
fc356a4
Merge pull request #7 from ruudk/patch-1
MrSurly Sep 19, 2017
9d99a77
beginning to update this branch. currently broken
MrSurly Oct 26, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
204 changes: 199 additions & 5 deletions ports/esp32/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,18 @@
include ../../py/mkenv.mk

# qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h

MICROPY_PY_USSL = 0
MICROPY_SSL_AXTLS = 0
MICROPY_FATFS = 1
MICROPY_PY_BTREE = 1
MICROPY_ESP32_BLUETOOTH ?= 1

# qstr definitions (must come before including py.mk)
QSTR_DEFS = qstrdefsport.h
ifeq ($(MICROPY_ESP32_BLUETOOTH),1)
QSTR_GEN_EXTRA_CFLAGS += $(INC_BT)
endif


#FROZEN_DIR = scripts
FROZEN_MPY_DIR = modules
Expand Down Expand Up @@ -44,12 +50,18 @@ endif
IDF_VER := $(shell git -C $(ESPIDF) describe)

INC += -I.
INC += -I..
INC += -I$(TOP)
INC += -I$(TOP)/lib/mp-readline
INC += -I$(TOP)/lib/netutils
INC += -I$(TOP)/lib/timeutils
INC += -I$(BUILD)

# Include dirs for main code base, excluding BT
INC_MAIN += -I../lib/mp-readline
INC_MAIN += -I../lib/netutils
INC_MAIN += -I../lib/timeutils

INC_ESPCOMP += -I$(ESPCOMP)/bootloader_support/include
INC_ESPCOMP += -I$(ESPCOMP)/driver/include
INC_ESPCOMP += -I$(ESPCOMP)/driver/include/driver
Expand Down Expand Up @@ -83,13 +95,54 @@ INC_ESPCOMP += -I$(ESPCOMP)/wpa_supplicant/port/include
INC_ESPCOMP += -I$(ESPCOMP)/ethernet/include
INC_ESPCOMP += -I$(ESPCOMP)/app_trace/include

# Bluetooth includes have to be separate because
# esp-idf/components/bt/bluedroid/osi/include/list.h
# somehow interferes with compiling FreeRTOS, as it
# makes List_t "not defined."
#
# This is why we have separate build rules for
# objects in the /bt/ directory, and for
# the MicroPython esp32/network_bluetooth.c

# Include dirs for BT components
INC_BT =
INC_BT += -I$(ESPCOMP)/bt/bluedroid/api/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/bta/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/bta/sys/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/btc/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/btc/profile/esp/blufi/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/btc/profile/esp/include
INC_BT += -I$(ESPCOMP)/bt/bluedroid/btc/profile/std/include
INC_BT += -I$(ESPCOMP)/bt/bluedroid/btcore/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/device/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/gki/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/hci/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/osi/include/ # Causes problems with List_t in FreeRTOS
INC_BT += -I$(ESPCOMP)/bt/bluedroid/stack/gap/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/stack/gatt/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/stack/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/stack/l2cap/include/
INC_BT += -I$(ESPCOMP)/bt/bluedroid/stack/smp/include/
INC_BT += -I$(ESPCOMP)/bt/include
INC_BT += -I$(ESPCOMP)/bt/bluedroid/stack/sdp/include/

CFLAGS_BASE = -std=gnu99 -Os -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DMBEDTLS_CONFIG_FILE='"mbedtls/esp_config.h"' -DHAVE_CONFIG_H -DESP_PLATFORM
CFLAGS = $(CFLAGS_BASE) $(INC) $(INC_ESPCOMP)

ifeq ($(MICROPY_ESP32_BLUETOOTH),1)
CFLAGS_BASE += -DMICROPY_ESP32_BLUETOOTH=1
endif

CFLAGS = $(CFLAGS_BASE) $(INC) $(INC_MAIN) $(INC_ESPCOMP)
CFLAGS_BT := $(CFLAGS_BASE) $(INC) $(INC_BT) $(INC_ESPCOMP)



CFLAGS += -DIDF_VER=\"$(IDF_VER)\"
CFLAGS += $(CFLAGS_MOD)

# this is what ESPIDF uses for c++ compilation
CXXFLAGS = -std=gnu++11 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DESP_PLATFORM $(INC) $(INC_ESPCOMP)
CXXFLAGS = -std=gnu++11 -fno-exceptions -fno-rtti -ffunction-sections -fdata-sections -fstrict-volatile-bitfields -mlongcalls -nostdlib -Wall -Werror -Wno-error=unused-function -Wno-error=unused-but-set-variable -Wno-error=unused-variable -Wno-error=deprecated-declarations -DESP_PLATFORM $(INC) $(INC_MAIN) $(INC_ESPCOMP)

LDFLAGS = -nostdlib -Map=$(@:.elf=.map) --cref
LDFLAGS += --gc-sections -static -EL
Expand Down Expand Up @@ -145,6 +198,10 @@ SRC_C = \
mpthreadport.c \
$(SRC_MOD)

ifeq ($(MICROPY_ESP32_BLUETOOTH),1)
SRC_C += network_bluetooth.c
endif

EXTMOD_SRC_C = $(addprefix extmod/,\
modonewire.c \
)
Expand Down Expand Up @@ -269,6 +326,135 @@ ESPIDF_ETHERNET_O = $(addprefix $(ESPCOMP)/ethernet/,\
emac_main.o \
)

$(BUILD)/$(ESPCOMP)/bt/%.o: CFLAGS = $(CFLAGS_BT)
$(BUILD)/$(ESPCOMP)/bt/bluedroid/btc/profile/esp/blufi/blufi_prf.o: CFLAGS += -Wno-error=strict-aliasing
$(BUILD)/$(ESPCOMP)/bt/bluedroid/stack/btu/btu_task.o: CFLAGS += -Wno-error=strict-aliasing

ESPIDF_BLUETOOTH_O = $(addprefix $(ESPCOMP)/bt/,\
bluedroid/api/esp_bt_device.o \
bluedroid/api/esp_bt_main.o \
bluedroid/api/esp_gap_ble_api.o \
bluedroid/api/esp_gattc_api.o \
bluedroid/api/esp_gatts_api.o \
bluedroid/bta/dm/bta_dm_act.o \
bluedroid/bta/dm/bta_dm_api.o \
bluedroid/bta/dm/bta_dm_cfg.o \
bluedroid/bta/dm/bta_dm_ci.o \
bluedroid/bta/dm/bta_dm_main.o \
bluedroid/bta/dm/bta_dm_pm.o \
bluedroid/bta/gatt/bta_gattc_act.o \
bluedroid/bta/gatt/bta_gattc_api.o \
bluedroid/bta/gatt/bta_gattc_cache.o \
bluedroid/bta/gatt/bta_gattc_ci.o \
bluedroid/bta/gatt/bta_gattc_main.o \
bluedroid/bta/gatt/bta_gattc_utils.o \
bluedroid/bta/gatt/bta_gatts_act.o \
bluedroid/bta/gatt/bta_gatts_api.o \
bluedroid/bta/gatt/bta_gatts_main.o \
bluedroid/bta/gatt/bta_gatts_utils.o \
bluedroid/bta/sys/bta_sys_conn.o \
bluedroid/bta/sys/bta_sys_main.o \
bluedroid/bta/sys/utl.o \
bluedroid/btc/core/btc_alarm.o \
bluedroid/btc/core/btc_ble_storage.o \
bluedroid/btc/core/btc_config.o \
bluedroid/btc/core/btc_dev.o \
bluedroid/btc/core/btc_dm.o \
bluedroid/btc/core/btc_main.o \
bluedroid/btc/core/btc_manage.o \
bluedroid/btc/core/btc_storage.o \
bluedroid/btc/core/btc_task.o \
bluedroid/btc/core/btc_util.o \
bluedroid/btc/profile/esp/blufi/blufi_prf.o \
bluedroid/btc/profile/esp/blufi/blufi_protocol.o \
bluedroid/btc/profile/std/gap/btc_gap_ble.o \
bluedroid/btc/profile/std/gatt/btc_gatt_util.o \
bluedroid/btc/profile/std/gatt/btc_gattc.o \
bluedroid/btc/profile/std/gatt/btc_gatts.o \
bluedroid/btcore/bdaddr.o \
bluedroid/btif/bta_dm_co.o \
bluedroid/btif/bta_gattc_co.o \
bluedroid/btif/bta_gatts_co.o \
bluedroid/device/controller.o \
bluedroid/device/interop.o \
bluedroid/gki/gki_buffer.o \
bluedroid/gki/gki_ulinux.o \
bluedroid/hci/buffer_allocator.o \
bluedroid/hci/hci_hal_h4.o \
bluedroid/hci/hci_layer.o \
bluedroid/hci/hci_packet_factory.o \
bluedroid/hci/hci_packet_parser.o \
bluedroid/hci/packet_fragmenter.o \
bluedroid/main/bte_init.o \
bluedroid/main/bte_main.o \
bluedroid/osi/alarm.o \
bluedroid/osi/allocator.o \
bluedroid/osi/config.o \
bluedroid/osi/fixed_queue.o \
bluedroid/osi/future.o \
bluedroid/osi/hash_functions.o \
bluedroid/osi/hash_map.o \
bluedroid/osi/list.o \
bluedroid/osi/osi_arch.o \
bluedroid/stack/btm/btm_acl.o \
bluedroid/stack/btm/btm_ble.o \
bluedroid/stack/btm/btm_ble_addr.o \
bluedroid/stack/btm/btm_ble_adv_filter.o \
bluedroid/stack/btm/btm_ble_batchscan.o \
bluedroid/stack/btm/btm_ble_bgconn.o \
bluedroid/stack/btm/btm_ble_cont_energy.o \
bluedroid/stack/btm/btm_ble_gap.o \
bluedroid/stack/btm/btm_ble_multi_adv.o \
bluedroid/stack/btm/btm_ble_privacy.o \
bluedroid/stack/btm/btm_dev.o \
bluedroid/stack/btm/btm_devctl.o \
bluedroid/stack/btm/btm_inq.o \
bluedroid/stack/btm/btm_main.o \
bluedroid/stack/btm/btm_pm.o \
bluedroid/stack/btm/btm_sec.o \
bluedroid/stack/btu/btu_hcif.o \
bluedroid/stack/btu/btu_init.o \
bluedroid/stack/btu/btu_task.o \
bluedroid/stack/gap/gap_api.o \
bluedroid/stack/gap/gap_ble.o \
bluedroid/stack/gap/gap_conn.o \
bluedroid/stack/gatt/att_protocol.o \
bluedroid/stack/gatt/gatt_api.o \
bluedroid/stack/gatt/gatt_attr.o \
bluedroid/stack/gatt/gatt_auth.o \
bluedroid/stack/gatt/gatt_cl.o \
bluedroid/stack/gatt/gatt_db.o \
bluedroid/stack/gatt/gatt_main.o \
bluedroid/stack/gatt/gatt_sr.o \
bluedroid/stack/gatt/gatt_utils.o \
bluedroid/stack/hcic/hciblecmds.o \
bluedroid/stack/hcic/hcicmds.o \
bluedroid/stack/l2cap/l2c_api.o \
bluedroid/stack/l2cap/l2c_ble.o \
bluedroid/stack/l2cap/l2c_csm.o \
bluedroid/stack/l2cap/l2c_fcr.o \
bluedroid/stack/l2cap/l2c_link.o \
bluedroid/stack/l2cap/l2c_main.o \
bluedroid/stack/l2cap/l2c_utils.o \
bluedroid/stack/sdp/sdp_api.o \
bluedroid/stack/sdp/sdp_db.o \
bluedroid/stack/sdp/sdp_utils.o \
bluedroid/stack/smp/aes.o \
bluedroid/stack/smp/p_256_curvepara.o \
bluedroid/stack/smp/p_256_ecc_pp.o \
bluedroid/stack/smp/p_256_multprecision.o \
bluedroid/stack/smp/smp_act.o \
bluedroid/stack/smp/smp_api.o \
bluedroid/stack/smp/smp_br_main.o \
bluedroid/stack/smp/smp_cmac.o \
bluedroid/stack/smp/smp_keys.o \
bluedroid/stack/smp/smp_l2c.o \
bluedroid/stack/smp/smp_main.o \
bluedroid/stack/smp/smp_utils.o \
bt.o \
)


$(BUILD)/$(ESPCOMP)/expat/%.o: CFLAGS += -Wno-unused-function
ESPIDF_EXPAT_O = $(addprefix $(ESPCOMP)/expat/,\
library/xmltok_ns.o \
Expand Down Expand Up @@ -560,6 +746,7 @@ ESPIDF_WPA_SUPPLICANT_O = $(addprefix $(ESPCOMP)/wpa_supplicant/,\
port/os_xtensa.o \
)


OBJ_ESPIDF =
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_NEWLIB_O))
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_DRIVER_O))
Expand All @@ -584,6 +771,11 @@ OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_NVS_FLASH_O))
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_OPENSSL_O))
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_SPI_FLASH_O))
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_WPA_SUPPLICANT_O))

ifeq ($(MICROPY_ESP32_BLUETOOTH),1)
OBJ_ESPIDF += $(addprefix $(BUILD)/, $(ESPIDF_BLUETOOTH_O))
endif

################################################################################
# Main targets

Expand Down Expand Up @@ -619,13 +811,15 @@ APP_LD_ARGS += -L$(dir $(LIBSTDCXX_FILE_NAME)) -lstdc++
APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libc.a
APP_LD_ARGS += $(ESPCOMP)/newlib/lib/libm.a
APP_LD_ARGS += $(ESPCOMP)/esp32/libhal.a
APP_LD_ARGS += $(ESPCOMP)/bt/lib/libbtdm_app.a
APP_LD_ARGS += -L$(ESPCOMP)/esp32/lib -lcore -lnet80211 -lphy -lrtc -lpp -lwpa -lsmartconfig -lcoexist -lwps -lwpa2
APP_LD_ARGS += $(OBJ)
APP_LD_ARGS += --end-group

$(BUILD)/esp32_out.ld: sdkconfig.h
$(Q)$(CC) -I. -C -P -x c -E $(ESPCOMP)/esp32/ld/esp32.ld -o $@
$(Q)$(CC) -I. -C -P -x c -E $(ESPCOMP)/esp32/ld/esp32.ld -o $@ -DMICROPY_ESP32_BLUETOOTH=$(MICROPY_ESP32_BLUETOOTH)

$(BUILD)/network_bluetooth.o: CFLAGS = $(CFLAGS_BT)
$(BUILD)/application.bin: $(BUILD)/application.elf
$(ECHO) "Create $@"
$(Q)$(ESPTOOL) --chip esp32 elf2image --flash_mode $(FLASH_MODE) --flash_freq $(FLASH_FREQ) --flash_size $(FLASH_SIZE) $<
Expand Down
Loading