diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/Kconfig b/Ubiquitous/XiZi_IIoT/tool/bootloader/Kconfig new file mode 100644 index 000000000..c826295d4 --- /dev/null +++ b/Ubiquitous/XiZi_IIoT/tool/bootloader/Kconfig @@ -0,0 +1,75 @@ +menu "OTA function" + + menuconfig TOOL_USING_OTA + bool "Enable support OTA function" + default n + + if TOOL_USING_OTA + choice + prompt "Compile bootloader bin or application bin." + default MCUBOOT_BOOTLOADER + + config MCUBOOT_BOOTLOADER + bool "Config as bootloader." + + config MCUBOOT_APPLICATION + bool "Config as application." + endchoice + + if MCUBOOT_APPLICATION + choice + prompt "The way of OTA firmware upgrade." + default OTA_BY_PLATFORM + + config OTA_BY_PLATFORM + bool "Through IoT management platform." + select TOOL_USING_MQTT + + config OTA_BY_TCPSERVER + bool "Through the public network TCP server." + select SUPPORT_CONNECTION_FRAMEWORK + select CONNECTION_ADAPTER_4G + endchoice + endif + + + menu "Flash area address and size configuration." + config CHIP_FLAH_BASE + hex "Flash base address of the chip." + default 0x60000000 + + config XIUOS_FLAH_ADDRESS + hex "Flash area address of the XiUOS system." + default 0x60100000 + + config BAKUP_FLAH_ADDRESS + hex "Flash area address of the backup firmware." + default 0x60300000 + + config DOWN_FLAH_ADDRESS + hex "Flash area address of the downloaded firmware." + default 0x60500000 + + config FLAG_FLAH_ADDRESS + hex "Flash area address of the OTA information." + default 0x60700000 + + config APP_FLASH_SIZE + hex "Application package size,the default size is limited to 1M." + default 0x00100000 + endmenu + + config OTA_RX_TIMEOUT + int "OTA receive data timeout(ms)." + default 600 if OTA_BY_PLATFORM + default 10000 if OTA_BY_TCPSERVER + default 10000 if MCUBOOT_BOOTLOADER + + config OTA_RX_BUFFERSIZE + int "OTA receive data buffer size." + default 3072 if OTA_BY_PLATFORM + default 2048 if OTA_BY_TCPSERVER + default 256 if MCUBOOT_BOOTLOADER + endif + +endmenu diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/Makefile b/Ubiquitous/XiZi_IIoT/tool/bootloader/Makefile new file mode 100644 index 000000000..3e0f3289d --- /dev/null +++ b/Ubiquitous/XiZi_IIoT/tool/bootloader/Makefile @@ -0,0 +1,4 @@ +SRC_DIR := +SRC_DIR += flash ota + +include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/Kconfig b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/Kconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/Makefile b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/Makefile new file mode 100644 index 000000000..123d7c8b0 --- /dev/null +++ b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/Makefile @@ -0,0 +1,3 @@ +SRC_FILES := flash_ops.c + +include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.c b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.c new file mode 100644 index 000000000..e69de29bb diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/bootloader_ops.h b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h similarity index 92% rename from Ubiquitous/XiZi_IIoT/tool/bootloader/bootloader_ops.h rename to Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h index e1bd9a8c3..e75abcd2e 100644 --- a/Ubiquitous/XiZi_IIoT/tool/bootloader/bootloader_ops.h +++ b/Ubiquitous/XiZi_IIoT/tool/bootloader/flash/flash_ops.h @@ -6,14 +6,14 @@ */ /** -* @file bootloader_ops.h +* @file flash_ops.h * @brief support flash function * @version 2.0 * @author AIIT XUOS Lab * @date 2023-04-03 */ -#ifndef __BOOTLOADER_OPS_H__ -#define __BOOTLOADER_OPS_H__ +#ifndef __FLASH_OPS_H__ +#define __FLASH_OPS_H__ #include diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/Kconfig b/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/Kconfig new file mode 100644 index 000000000..e69de29bb diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/Makefile b/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/Makefile new file mode 100644 index 000000000..47afc2d36 --- /dev/null +++ b/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/Makefile @@ -0,0 +1,3 @@ +SRC_FILES := ota.c + +include $(KERNEL_ROOT)/compiler.mk \ No newline at end of file diff --git a/APP_Framework/Applications/ota/ota.c b/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/ota.c similarity index 100% rename from APP_Framework/Applications/ota/ota.c rename to Ubiquitous/XiZi_IIoT/tool/bootloader/ota/ota.c diff --git a/APP_Framework/Applications/ota/ota.h b/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/ota.h similarity index 100% rename from APP_Framework/Applications/ota/ota.h rename to Ubiquitous/XiZi_IIoT/tool/bootloader/ota/ota.h diff --git a/APP_Framework/Applications/ota/server_tcp.c b/Ubiquitous/XiZi_IIoT/tool/bootloader/ota/server_tcp.c similarity index 100% rename from APP_Framework/Applications/ota/server_tcp.c rename to Ubiquitous/XiZi_IIoT/tool/bootloader/ota/server_tcp.c