From c5aa020398c9d8d0920dcb455e0fbf0b2482e337 Mon Sep 17 00:00:00 2001 From: songyanguang <345810377@qq.com> Date: Thu, 19 Jun 2025 20:15:38 +0800 Subject: [PATCH] Modify printf --- .../Framework/connection/4g/ec801e/ec801e.c | 2 -- APP_Framework/Framework/connection/adapter.c | 2 +- APP_Framework/lib/mqtt/platform_mqtt.c | 11 ++------ .../XiZi_IIoT/arch/risc-v/ch32v208rbt6/boot.S | 6 ++-- .../XiZi_IIoT/board/ch32v208rbt6/board.c | 5 +--- .../ch32v208rbt6/third_party_driver/Kconfig | 2 +- Ubiquitous/XiZi_IIoT/tool/bootloader/Kconfig | 28 +++++++++---------- 7 files changed, 21 insertions(+), 35 deletions(-) diff --git a/APP_Framework/Framework/connection/4g/ec801e/ec801e.c b/APP_Framework/Framework/connection/4g/ec801e/ec801e.c index c777d3ce4..b9b17bd73 100644 --- a/APP_Framework/Framework/connection/4g/ec801e/ec801e.c +++ b/APP_Framework/Framework/connection/4g/ec801e/ec801e.c @@ -200,8 +200,6 @@ static int Ec801eConnect(struct Adapter *adapter, enum NetRoleType net_role, con int try = 0; uint8_t ec801e_cmd[64]; - printf("%s enter\n", __func__); - AtSetReplyEndChar(adapter->agent, 0x4F, 0x4B); /*step1: serial write "+++", quit transparent mode*/ diff --git a/APP_Framework/Framework/connection/adapter.c b/APP_Framework/Framework/connection/adapter.c index c49a5ce5e..8b4d9ad59 100644 --- a/APP_Framework/Framework/connection/adapter.c +++ b/APP_Framework/Framework/connection/adapter.c @@ -407,7 +407,7 @@ int AdapterDeviceConnect(struct Adapter *adapter, enum NetRoleType net_role, con if (NULL == ip_done->connect) return -1; - printf("AdapterDeviceConnect to connect ip=%s port=%s\n", ip, port); + return ip_done->connect(adapter, net_role, ip, port, ip_type); } else { printf("AdapterDeviceConnect net_protocol %d not support\n", adapter->net_protocol); diff --git a/APP_Framework/lib/mqtt/platform_mqtt.c b/APP_Framework/lib/mqtt/platform_mqtt.c index c3fcfcbf5..7c2368358 100644 --- a/APP_Framework/lib/mqtt/platform_mqtt.c +++ b/APP_Framework/lib/mqtt/platform_mqtt.c @@ -46,8 +46,6 @@ int AdapterNetActive(void) { int ret = 0; uint32_t baud_rate = BAUD_RATE_115200; - - KPrintf("%s enter\n", __func__); adapter = AdapterDeviceFindByName(ADAPTER_4G_NAME); adapter->socket.socket_id = 0; @@ -68,13 +66,11 @@ int AdapterNetActive(void) { goto out; } - KPrintf("%s success\n", __func__); out: if (ret < 0) { AdapterDeviceClose(adapter); - KPrintf("%s fail\n", __func__); } return ret; @@ -116,8 +112,6 @@ bool MQTT_Connect(void) { uint8_t TryConnect_time = 10; //尝试登录次数 - KPrintf("%s enter\n", __func__); - memset(&Platform_mqtt,0,sizeof(Platform_mqtt)); #ifdef XIUOS_PLATFORM sprintf(Platform_mqtt.ClientID,"%s",CLIENTID); //客户端ID存入缓冲区 @@ -184,7 +178,8 @@ bool MQTT_Connect(void) MQTT_Send(Platform_mqtt.Pack_buff,Platform_mqtt.Fixed_len + Platform_mqtt.Variable_len + Platform_mqtt.Payload_len); MdelayKTask(50); MQTT_Recv(mqtt_rxbuf, 4); - if(mqtt_rxbuf[0] == parket_connetAck[0] && mqtt_rxbuf[1] == parket_connetAck[1] && mqtt_rxbuf[2] == parket_connetAck[2] && mqtt_rxbuf[3] == parket_connetAck[3]) //连接成功 + if(mqtt_rxbuf[0] == parket_connetAck[0] && mqtt_rxbuf[1] == parket_connetAck[1] + && mqtt_rxbuf[2] == parket_connetAck[2] && mqtt_rxbuf[3] == parket_connetAck[3]) //连接成功 { return true; } @@ -216,8 +211,6 @@ bool MQTT_SubscribeTopic(uint8_t *topic_name) { uint8_t TrySub_time = 10; //尝试订阅次数 - KPrintf("%s topic_name=%s\n", __func__, topic_name); - Platform_mqtt.Fixed_len = 1; //SUBSCRIBE报文,固定报头长度暂定为1 Platform_mqtt.Variable_len = 2;//SUBSCRIBE报文,可变报头长度=2,2为字节报文标识符 Platform_mqtt.Payload_len = 0; //SUBSCRIBE报文,负载数据长度暂定为0 diff --git a/Ubiquitous/XiZi_IIoT/arch/risc-v/ch32v208rbt6/boot.S b/Ubiquitous/XiZi_IIoT/arch/risc-v/ch32v208rbt6/boot.S index 871086a72..f6cec39f0 100644 --- a/Ubiquitous/XiZi_IIoT/arch/risc-v/ch32v208rbt6/boot.S +++ b/Ubiquitous/XiZi_IIoT/arch/risc-v/ch32v208rbt6/boot.S @@ -268,11 +268,11 @@ handle_reset: csrw mtvec, t0 jal SystemInit -#ifdef __BOOTLOADER /* BOOT */ +#ifdef __BOOTLOADER la t0, ota_entry -#else /* APP */ +#else la t0, entry -#endif /* BOOT */ +#endif csrw mepc, t0 mret diff --git a/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/board.c b/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/board.c index dc69f4824..eb23113e1 100644 --- a/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/board.c +++ b/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/board.c @@ -72,16 +72,13 @@ void readRomConfiguration(void) { extern pmodule_cfg CFG; // 指向配置信息的指针 /* 从EEPROM中读取网络配置信息 */ - KPrintf("%s PAGE_READ_START_ADDR=%08x\n", __func__, PAGE_WRITE_START_ADDR); CFG_READ(PAGE_WRITE_START_ADDR, Configbuf, MODULE_CFG_LEN); /* 如果存储在EEPROM中的网络配置信息无效,或者WCHNET还没有被主机配置过,通过默认配置信息初始化WCHNET */ if ((CFG->cfgFlag[0] != checkcode1) || (CFG->cfgFlag[1] != checkcode2)) { - KPrintf("%s PAGE_ERASE_START_ADDR=%08x\n", __func__, PAGE_WRITE_START_ADDR); CFG_ERASE(PAGE_WRITE_START_ADDR, FLASH_PAGE_SIZE); - KPrintf("%s PAGE_WRITE_START_ADDR=%08x\n", __func__, PAGE_WRITE_START_ADDR); CFG_WRITE(PAGE_WRITE_START_ADDR, (u8 *)&defaultConfiguration, MODULE_CFG_LEN); - KPrintf("%s NVIC_SystemReset\n\n", __func__); + KPrintf("%s NVIC_SystemReset\n", __func__); NVIC_SystemReset(); // 复位ch32v208 } diff --git a/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/third_party_driver/Kconfig b/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/third_party_driver/Kconfig index b81a76455..5e66b2e60 100644 --- a/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/third_party_driver/Kconfig +++ b/Ubiquitous/XiZi_IIoT/board/ch32v208rbt6/third_party_driver/Kconfig @@ -111,6 +111,6 @@ menuconfig BSP_USING_LTE default "lte_dev1" config LTE_TEST bool "Enable lte test" - default y + default n endif \ No newline at end of file diff --git a/Ubiquitous/XiZi_IIoT/tool/bootloader/Kconfig b/Ubiquitous/XiZi_IIoT/tool/bootloader/Kconfig index 45fe943b6..14464502f 100644 --- a/Ubiquitous/XiZi_IIoT/tool/bootloader/Kconfig +++ b/Ubiquitous/XiZi_IIoT/tool/bootloader/Kconfig @@ -16,24 +16,22 @@ menu "OTA function" bool "Config as application." endchoice - #if MCUBOOT_APPLICATION - choice - prompt "The way of OTA firmware upgrade." - default OTA_BY_PLATFORM + choice + prompt "The way of OTA firmware upgrade." + default OTA_BY_PLATFORM - config OTA_BY_PLATFORM - bool "Through IoT management platform." - select LIB_USING_MQTT + config OTA_BY_PLATFORM + bool "Through IoT management platform." + select LIB_USING_MQTT - config OTA_BY_TCPSERVER - bool "Through the public network TCP server." - select SUPPORT_CONNECTION_FRAMEWORK - select CONNECTION_ADAPTER_4G + config OTA_BY_TCPSERVER + bool "Through the public network TCP server." + select SUPPORT_CONNECTION_FRAMEWORK + select CONNECTION_ADAPTER_4G - config OTA_BY_NONE - bool "Not download firmware." - endchoice - #endif + config OTA_BY_NONE + bool "Not download firmware." + endchoice menu "Flash area address and size configuration." config CHIP_FLAH_BASE