Skip to content

Commit

Permalink
feat: Add build type
Browse files Browse the repository at this point in the history
  • Loading branch information
JahazielLem committed Aug 29, 2024
1 parent 65ac41f commit 9576bc6
Show file tree
Hide file tree
Showing 8 changed files with 130 additions and 2 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ hardware/minino-backups/

# Firmware binaries
/**/build/
/**/build*
/**/managed_components/
/**/build_files/
/**/build_files.tgz
Expand Down
2 changes: 1 addition & 1 deletion firmware/partitions_no_ota.csv
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ nvs, data, nvs, , 0x6000,
phy_init, data, phy, , 0x1000,
zb_storage, data, fat, , 16K,
zb_fct, data, fat, , 1K,
factory, app, factory, , 3M,
factory, app, factory, , 7M,
1 change: 1 addition & 0 deletions firmware/profiles/noota
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-B build-noota -DSDKCONFIG=build-noota/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.noota"
1 change: 1 addition & 0 deletions firmware/profiles/ota
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-B build-ota -DSDKCONFIG=build-ota/sdkconfig -DSDKCONFIG_DEFAULTS="sdkconfig.defaults;sdkconfig.ota"
2 changes: 1 addition & 1 deletion firmware/sdkconfig.defaults
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ CONFIG_THREAD_APP_SNIFFER=y
CONFIG_GPS_APPS_ENABLE=y
CONFIG_GPS_APP_WARDRIVING=y
## OTA ##
CONFIG_OTA_ENABLE=y
#CONFIG_OTA_ENABLE=y
## FILE MANAGER ##
CONFIG_FILE_MANAGER_ENABLE=y
CONFIG_FILE_MANAGER_LOCAL=y
Expand Down
34 changes: 34 additions & 0 deletions firmware/sdkconfig.noota
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

#
# Enabled Features
#
## OTA ##
# CONFIG_OTA_ENABLE is not set
#
# Partition Table
#
CONFIG_OPENTHREAD_ENABLED=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions_no_ota.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions_no_ota.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table

#
# Log Level
#
CONFIG_LOG_DEFAULT_LEVEL_NONE=y
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
CONFIG_LOG_DEFAULT_LEVEL=0
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
# CONFIG_LOG_MAXIMUM_LEVEL_ERROR is not set
# CONFIG_LOG_MAXIMUM_LEVEL_WARN is not set
# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
CONFIG_LOG_MAXIMUM_LEVEL=0
34 changes: 34 additions & 0 deletions firmware/sdkconfig.ota
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@

#
# Enabled Features
#
## OTA ##
CONFIG_OTA_ENABLE=y
#
# Partition Table
#
CONFIG_OPENTHREAD_ENABLED=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_OFFSET=0x8000
CONFIG_PARTITION_TABLE_MD5=y
# end of Partition Table

#
# Log Level
#
CONFIG_LOG_DEFAULT_LEVEL_NONE=y
# CONFIG_LOG_DEFAULT_LEVEL_ERROR is not set
# CONFIG_LOG_DEFAULT_LEVEL_WARN is not set
# CONFIG_LOG_DEFAULT_LEVEL_INFO is not set
# CONFIG_LOG_DEFAULT_LEVEL_DEBUG is not set
# CONFIG_LOG_DEFAULT_LEVEL_VERBOSE is not set
CONFIG_LOG_DEFAULT_LEVEL=0
CONFIG_LOG_MAXIMUM_EQUALS_DEFAULT=y
# CONFIG_LOG_MAXIMUM_LEVEL_ERROR is not set
# CONFIG_LOG_MAXIMUM_LEVEL_WARN is not set
# CONFIG_LOG_MAXIMUM_LEVEL_INFO is not set
# CONFIG_LOG_MAXIMUM_LEVEL_DEBUG is not set
# CONFIG_LOG_MAXIMUM_LEVEL_VERBOSE is not set
CONFIG_LOG_MAXIMUM_LEVEL=0
57 changes: 57 additions & 0 deletions firmware/set_build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash

PARTITIONS_FILE_OTA="partitions.csv"
PARTITIONS_FILE_NO_OTA="partitions_no_ota.csv"

PROJECT_PATH="."

# Función para mostrar cómo usar el script
function usage() {
echo "Uso: $0 [--ota | --no-ota]"
echo " --ota Compila el proyecto con soporte para OTA."
echo " --no-ota Compila el proyecto sin soporte para OTA."
exit 1
}

# Verificación de argumentos
if [ "$#" -ne 1 ]; then
usage
fi

# Verificación de entorno IDF
if [ -z "$IDF_PATH" ]; then
echo "Error: El entorno IDF no está configurado. Asegúrate de que el IDF_PATH esté definido y el entorno esté activado."
exit 1
fi


# Selección del archivo de particiones basado en el argumento
case "$1" in
--ota)
echo "Compilando con soporte para OTA..."
PARTITIONS_FILE=$PARTITIONS_FILE_OTA
;;
--no-ota)
echo "Compilando sin soporte para OTA..."
PARTITIONS_FILE=$PARTITIONS_FILE_NO_OTA
;;
*)
usage
;;
esac

# Comprobación si el archivo de particiones existe
if [ ! -f "$PARTITIONS_FILE" ]; then
echo "Error: No se encuentra el archivo de particiones $PARTITIONS_FILE."
exit 1
fi
# Ejecutar build
idf.py build

# Verificar si la compilación fue exitosa
if [ $? -eq 0 ]; then
echo "Compilación completada con éxito."
else
echo "Error: Falló la compilación."
exit 1
fi

0 comments on commit 9576bc6

Please sign in to comment.