Skip to content

Commit

Permalink
Separate the compiler config options, enable it if is_debug=false
Browse files Browse the repository at this point in the history
  • Loading branch information
sweetymhaiske committed Feb 15, 2021
1 parent 27d56ba commit cd26f9c
Show file tree
Hide file tree
Showing 6 changed files with 88 additions and 9 deletions.
4 changes: 4 additions & 0 deletions examples/temperature-measurement-app/esp32/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,10 @@ CFLAGS += -Os -DLWIP_IPV6_SCOPES=0

top: all flashing_script

ifeq ($(is_debug),false)
export SDKCONFIG_DEFAULTS = sdkconfig.optimize.defaults
endif

include $(IDF_PATH)/make/project.mk

FLASHING_SCRIPT=$(BUILD_DIR_BASE)/$(PROJECT_NAME).flash.py
Expand Down
9 changes: 9 additions & 0 deletions examples/temperature-measurement-app/esp32/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
# Temperature Sensor Example

### Temperature-measurement-app optimization
Optimize the temperature-measurement-app to use less RAM and Flash.

To enable this option set is_debug=false from command-line

```
idf make build flash monitor is_debug=false
```

// TODO Fill this out
3 changes: 0 additions & 3 deletions examples/temperature-measurement-app/esp32/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,6 @@ CONFIG_LWIP_IPV6_AUTOCONFIG=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"

# Compiler options
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y

# Bluetooth controller
CONFIG_BTDM_CTRL_BLE_MAX_CONN=1
CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=1
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
#
# Copyright (c) 2020 Project CHIP Authors
# Copyright (c) 2018 Nest Labs, Inc.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Description:
# Some useful defaults for the optimizing temperature-measurement-app configuration.
#


# Default to 921600 baud when flashing and monitoring device
CONFIG_ESPTOOLPY_BAUD_921600B=y
CONFIG_ESPTOOLPY_BAUD=921600
CONFIG_ESPTOOLPY_COMPRESSED=y
CONFIG_ESPTOOLPY_MONITOR_BAUD_115200B=y
CONFIG_ESPTOOLPY_MONITOR_BAUD=115200

#enable BT
CONFIG_BT_ENABLED=y
CONFIG_BT_NIMBLE_ENABLED=y

#enable lwip ipv6 autoconfig
CONFIG_LWIP_IPV6_AUTOCONFIG=y

# Use a custom partition table
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"

# Compiler options
CONFIG_COMPILER_OPTIMIZATION_SIZE=y
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y

# Bluetooth controller
CONFIG_BTDM_CTRL_BLE_MAX_CONN=1
CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=1

# NimBLE Options
CONFIG_BT_NIMBLE_MAX_CONNECTIONS=1

# Wi-Fi
CONFIG_ESP32_WIFI_STATIC_RX_BUFFER_NUM=4
CONFIG_ESP32_WIFI_DYNAMIC_RX_BUFFER_NUM=8
CONFIG_ESP32_WIFI_DYNAMIC_TX_BUFFER_NUM=16

# FreeRTOS
CONFIG_FREERTOS_UNICORE=y

# Log output
CONFIG_LOG_DEFAULT_LEVEL_NONE=y

# LWIP
CONFIG_LWIP_TCPIP_RECVMBOX_SIZE=16

# TCP
CONFIG_LWIP_TCP_SYNMAXRTX=6

# Compatibility options
CONFIG_OPTIMIZATION_ASSERTIONS_DISABLED=y
CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN=1
CONFIG_BTDM_CONTROLLER_BLE_MAX_CONN_EFF=1
CONFIG_NIMBLE_MAX_CONNECTIONS=1
CONFIG_TCPIP_RECVMBOX_SIZE=16
CONFIG_TCP_SYNMAXRTX=6
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ CONFIG_LWIP_IPV6_AUTOCONFIG=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"

# Compiler options
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y

# Bluetooth controller
CONFIG_BTDM_CTRL_BLE_MAX_CONN=1
CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ CONFIG_LWIP_IPV6_AUTOCONFIG=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"

# Compiler options
CONFIG_COMPILER_OPTIMIZATION_ASSERTIONS_DISABLE=y

# Bluetooth controller
CONFIG_BTDM_CTRL_BLE_MAX_CONN=1
CONFIG_BTDM_CTRL_BLE_MAX_CONN_EFF=1
Expand Down

0 comments on commit cd26f9c

Please sign in to comment.