From: kyz Date: Sun, 28 Apr 2024 08:22:43 +0000 (+0800) Subject: 修改DTCM数据属性,移到bss中 X-Git-Url: http://kyz.pub/gitweb/?a=commitdiff_plain;h=c98eb30514cc449cde161bda4b0b7ad64998daf0;p=yn%2Fweldingcontroller.git 修改DTCM数据属性,移到bss中 --- 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 );