From c98eb30514cc449cde161bda4b0b7ad64998daf0 Mon Sep 17 00:00:00 2001 From: kyz Date: Sun, 28 Apr 2024 16:22:43 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E6=94=B9DTCM=E6=95=B0=E6=8D=AE?= =?utf8?q?=E5=B1=9E=E6=80=A7=EF=BC=8C=E7=A7=BB=E5=88=B0bss=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- user/user_adc.c | 4 ++-- user/user_ota.c | 2 +- user/user_wifi.c | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/user/user_adc.c b/user/user_adc.c index 5930c21..60a2acd 100644 --- a/user/user_adc.c +++ b/user/user_adc.c @@ -23,8 +23,8 @@ static uint16_t adc3_raw_copy[ADC3_RAW_NRS]; //__attribute__((at(0x20005000))) static uint16_t adc2_raw_copy[ADC2_RAW_NRS]; //__attribute__((at(0x20000000))) static float adc2_curr[ADC2_RAW_NRS]; -__attribute__((section(".DTCM"))) static uint16_t adc2_raw_copy[ADC2_RAW_NRS]; -__attribute__((section(".DTCM"))) static float adc2_curr[ADC2_RAW_NRS]; +__attribute__((section(".DTCM"),zero_init)) static uint16_t adc2_raw_copy[ADC2_RAW_NRS]; +__attribute__((section(".DTCM"),zero_init)) static float adc2_curr[ADC2_RAW_NRS]; extern dev_info_t g_dev; void HAL_ADC_ConvCpltCallback(ADC_HandleTypeDef* hadc) diff --git a/user/user_ota.c b/user/user_ota.c index 290ad69..014c193 100644 --- a/user/user_ota.c +++ b/user/user_ota.c @@ -70,7 +70,7 @@ static const osThreadAttr_t otaTask_attributes = { .priority = (osPriority_t) osPriorityNormal, }; -__attribute__((section(".DTCM"))) static ota_t g_ota; +__attribute__((section(".DTCM"),zero_init)) static ota_t g_ota; int32_t ota_start( uint32_t link, char * url, char *ver ) diff --git a/user/user_wifi.c b/user/user_wifi.c index 346f964..55688ae 100644 --- a/user/user_wifi.c +++ b/user/user_wifi.c @@ -21,7 +21,7 @@ extern UART_HandleTypeDef huart5; #define WIFI_RX_BUF_SIZE (512*4) #define WIFI_RX_BUF_SIZE_MASK (WIFI_RX_BUF_SIZE-1) -__attribute__((section(".DTCM"))) static char wifi_rx_buf[WIFI_RX_BUF_SIZE]; +__attribute__((section(".DTCM"),zero_init)) static char wifi_rx_buf[WIFI_RX_BUF_SIZE]; @@ -34,10 +34,10 @@ static uint8_t wifi_rx_byte = 0; static char g_wifi_ver[50]; -__attribute__((section(".DTCM"))) static uint8_t tcp_rx_buf[ 512 ]; +__attribute__((section(".DTCM"),zero_init)) static uint8_t tcp_rx_buf[ 512 ]; static uint16_t tcp_rx_n; -__attribute__((section(".DTCM"))) static uint8_t ota_rx_buf[2048]; +__attribute__((section(".DTCM"),zero_init)) static uint8_t ota_rx_buf[2048]; static uint16_t ota_rx_n; static int32_t wifi_tcp_tx( uint8_t link, uint8_t *data, uint32_t sz ); -- 2.34.1