0 Replies Latest reply on Jun 24, 2015 8:14 PM by xiaominx

    unaligned netx packet pool start address

    xiaominx

      Hi,

       

         When studying wiced sdk source code I find rx and tx packet pool buffer are defined as char array, which means they would not start at an address that is 32bits aligned by default. But nx_packet_pool_create requires pool_ptr should be aligned to ULONG. Would it lead to problem sometimes?

       

       

      
      
      
      static char
      tx_buffer_pool_memory [APP_TX_BUFFER_POOL_SIZE];
      
      
      static char
      rx_buffer_pool_memory [APP_RX_BUFFER_POOL_SIZE];
      
      
      
      
      \\
      
      
      
      
      
      

       

       

       

      wiced_result_t wiced_network_init( void )
      {
          /* Initialize the NetX system.  */
          WPRINT_NETWORK_INFO(("Initialising " NETX_NAME " " NetX_VERSION "\n"));
          nx_system_initialize( );
      
          ip_networking_up[0] = WICED_FALSE;
          ip_networking_up[1] = WICED_FALSE;
          ip_networking_up[2] = WICED_FALSE;
      
          /* Create packet pools for transmit and receive */
          WPRINT_NETWORK_INFO(("Creating Packet pools\n"));
          if ( nx_packet_pool_create( &wiced_packet_pools[0], (char*)"", WICED_LINK_MTU, tx_buffer_pool_memory, APP_TX_BUFFER_POOL_SIZE ) != NX_SUCCESS )
          {
              WPRINT_NETWORK_ERROR(("Couldn't create TX packet pool\n"));
              return WICED_ERROR;
          }
      
          if ( nx_packet_pool_create( &wiced_packet_pools[1], (char*)"", WICED_LINK_MTU, rx_buffer_pool_memory, APP_RX_BUFFER_POOL_SIZE ) != NX_SUCCESS )
          {
              WPRINT_NETWORK_ERROR(("Couldn't create RX packet pool\n"));
              return WICED_ERROR;
          }