title: In stm32 wifi transmission and reception
body: <pre><code>int main(void)
  {
    /* USER CODE BEGIN 1 */
  
    /* USER CODE END 1 */
  
    /* MPU Configuration--------------------------------------------------------*/
    MPU_Config();
  
    /* Enable I-Cache---------------------------------------------------------*/
    SCB_EnableICache();
  
    /* Enable D-Cache---------------------------------------------------------*/
    SCB_EnableDCache();
  
    /* MCU Configuration--------------------------------------------------------*/
  
    /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
    HAL_Init();
  
    /* USER CODE BEGIN Init */
  
    /* USER CODE END Init */
  
    /* Configure the system clock */
    SystemClock_Config();
  
    /* USER CODE BEGIN SysInit */
  
    /* USER CODE END SysInit */
  
    /* Initialize all configured peripherals */
    MX_GPIO_Init();
    MX_DMA_Init();
    MX_TIM6_Init();
    MX_UART7_Init();
    MX_USART3_UART_Init();
    MX_UART5_Init();
    MX_USART1_UART_Init();
    MX_USART6_UART_Init();
    MX_UART8_Init();
    MX_SPI2_Init();
    MX_SPI3_Init();
    MX_SPI5_Init();
    MX_I2C1_Init();
    MX_RNG_Init();
    MX_TIM3_Init();
    MX_USB_OTG_FS_PCD_Init();
    MX_RTC_Init();
    MX_FMC_Init();
    MX_TIM7_Init();
    /* USER CODE BEGIN 2 */
    HAL_UART_Receive_DMA(&amp;huart3, (uint8_t*)RX_BUFFER3, RX_BUFFER3_SIZE);
    HAL_UART_Receive_DMA(&amp;huart7, (uint8_t*)RX_BUFFER7, RX_BUFFER7_SIZE);
    
    
  #if BW16_ENABLE
    
    HAL_UART_Receive_DMA(&amp;huart5, (uint8_t*)BW_BUFFER5, BW_BUFFER5_SIZE);
    
    // BW16 RESET
     bw16_Reset();
    
    // BW16 Init
    bw16_init(&amp;huart5);
    
      RxCntUart5 = __HAL_DMA_GET_COUNTER(huart5.hdmarx);  
      if(BW_BUFFER5_SIZE != RxCntUart5)
      {
        __HAL_DMA_DISABLE(huart5.hdmarx); 
        __HAL_DMA_SET_COUNTER(huart5.hdmarx, BW_BUFFER5_SIZE);
        __HAL_DMA_ENABLE(huart5.hdmarx);       
         
      }
      
  #endif
     
    /* USER CODE END 2 */
  
    /* USER CODE BEGIN RTOS_MUTEX */
    /* add mutexes, ... */
    /* USER CODE END RTOS_MUTEX */
  
    /* USER CODE BEGIN RTOS_SEMAPHORES */
    /* add semaphores, ... */
    /* USER CODE END RTOS_SEMAPHORES */
  
    /* USER CODE BEGIN RTOS_TIMERS */
    /* start timers, add new ones, ... */
    /* USER CODE END RTOS_TIMERS */
  
    /* USER CODE BEGIN RTOS_QUEUES */
    /* add queues, ... */
    HAL_TIM_Base_Start_IT(&amp;htim6);
    HAL_TIM_Base_Start_IT(&amp;htim7);
    /* USER CODE END RTOS_QUEUES */
  
    /* Create the thread(s) */
    /* definition and creation of defaultTask */
    osThreadDef(defaultTask, StartDefaultTask, osPriorityNormal, 0, 256);
    defaultTaskHandle = osThreadCreate(osThread(defaultTask), NULL);
  
    /* definition and creation of TcpTask */
    osThreadDef(TcpTask, Tcp_Task, osPriorityIdle, 0, 256);
    TcpTaskHandle = osThreadCreate(osThread(TcpTask), NULL);
  
    /* definition and creation of Usart3Task */
    osThreadDef(Usart3Task, Usart3_Task, osPriorityIdle, 0, 256);
    Usart3TaskHandle = osThreadCreate(osThread(Usart3Task), NULL);
  
    /* definition and creation of Uart7Task */
    osThreadDef(Uart7Task, Uart7_Task, osPriorityIdle, 0, 256);
    Uart7TaskHandle = osThreadCreate(osThread(Uart7Task), NULL);
  
    /* definition and creation of BWdataTask */
    osThreadDef(BWdataTask, bwdata_Task, osPriorityIdle, 0, 256);
    BWdataTaskHandle = osThreadCreate(osThread(BWdataTask), NULL);
  
    /* USER CODE BEGIN RTOS_THREADS */
    /* add threads, ... */ 
  
    /* USER CODE END RTOS_THREADS */
  
    /* Start scheduler */
    osKernelStart();
  
    /* We should never get here as control is now taken by the scheduler */
    /* Infinite loop */
    /* USER CODE BEGIN WHILE */
    while (1)
    {
      /* USER CODE END WHILE */
  
      /* USER CODE BEGIN 3 */
    }
    /* USER CODE END 3 */
  }
  
  void bwdata_Task(void const * argument)
  {
    /* USER CODE BEGIN bwdata_Task */
    /* Infinite loop */
    for(;;)
    {
          SCB_InvalidateDCache_by_Addr ((uint32_t *)BW_BUFFER5, BW_BUFFER5_SIZE);
  
      pos2 =  __HAL_DMA_GET_COUNTER(huart5.hdmarx);
  
      pos = BW_BUFFER5_SIZE - pos2;
          
  
      if(pos != old_pos) 
          {
             
                  
          if(pos &gt; old_pos) 
                  {
              memcpy(rx_temBuffer, &amp;BW_BUFFER5[old_pos], pos - old_pos);
  
              rx_size =+ pos - old_pos;
          } 
                  else 
                  {
              memcpy(rx_temBuffer, &amp;BW_BUFFER5[old_pos], get_dma_total_size() - old_pos);
              rx_size += get_dma_total_size() - old_pos;
  
  
              if(pos &gt; 0){
                  memcpy(&amp;rx_temBuffer[get_dma_total_size() - old_pos], &amp;BW_BUFFER5[0], pos);
                  rx_size += pos;
              }
          }
  
          old_pos = pos;
                  
  
          if(rx_size &gt; 0) 
                  {
                      HAL_UART_Receive_DMA(&amp;huart5, (uint8_t*)BW_BUFFER5, BW_BUFFER5_SIZE);
                      printf(&quot;%s\n\r&quot;, (char*)&amp;BW_BUFFER5);
                    
  #if BW16_ENABLE
                    
                      bw16_send_data (&amp;huart5, rx_size, &quot;1&quot;, rx_temBuffer);
  #endif
                    
          }
                  rx_size = 0;
      }
          
      
    }
    /* USER CODE END bwdata_Task */
  }
  </code></pre>
  <p>I want to write the code above so that I can send and receive wifi, but the wifi connection is good.</p>
  <p>However, if I send a message from the server to the client (stm32), it will be printed only once, and I receive a message after that, but it doesn't printf. It says there is a problem like below, how can I solve it?</p>
  <p>An MPU or Execute Never (XN) default memory map access violation has occurred on an instruction fetch (CFSR.IACCVIOL, MMFAR).</p>
  <p>It's a reaction that comes out if you send it only once below.</p>
  <p><a href="https://i.stack.imgur.com/q1oHt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/q1oHt.png" alt="enter image description here" /></a></p>
  <p><a href="https://i.stack.imgur.com/hy3SQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/hy3SQ.png" alt="enter image description here" /></a></p>