修改DTCM数据属性,移到bss中
authorkyz <kongyuzhong@google.com>
Sun, 28 Apr 2024 08:22:43 +0000 (16:22 +0800)
committerkyz <kongyuzhong@google.com>
Sun, 28 Apr 2024 08:22:43 +0000 (16:22 +0800)
user/user_adc.c
user/user_ota.c
user/user_wifi.c

index 5930c21f843c72fdf988346c95a395a6a623d15f..60a2acdd6f697e5397955fe69ff25852cf20a078 100644 (file)
@@ -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)
index 290ad69529bb4f25c11367317d2c72d0627b4772..014c1937deee796d388592154003f4fd37876a62 100644 (file)
@@ -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 )
index 346f9646bddaa060e9b334b23c33992b916a71a0..55688ae5fe5c6aaaef9fc3dad6134e69c47d6415 100644 (file)
@@ -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 );