This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

AWR2944EVM: 传感器论坛

Part Number: AWR2944EVM
Other Parts Discussed in Thread: AWR2944

工程师,你好,

最近在使用awr2944的OOB,我想要通过网口或串口打印出雷达输出的点云信息(X/Y/Z等),发现输出的Z坐标一直是0,我去看了mmwave_mcuplus_sdk_user_guide,里面有一张表格如下图所示,我将channelCfg的第二位

txChannelEn配置为15,将chirpCfg的最后一位配置为15,但是Z坐标的输出还是0。有注意到,X/Y/Z的坐标使用方位角和俯仰角估算的,其中进行3DFFT,需要使能elevation Tx antenna,请问具体需要这么做呢,有文档可供参考吗?

谢谢

  • 你好,

    能否运行TDM demo,并使用profile_3d_3Azim_1ElevTx.cfg配置尝试一下?

  • 你好,非常感谢你的回复。我在使用profile_3d_3Azim_1ElevTx.cfg配置文件后,已经可以正常读出Z坐标了。

    现在想通过UDP把坐标信息发送到PC上

    下面是我的代码,在我给2944EVM上电之后,在完成CFG文件配置后,失去响应。请问有UDP相关的例程吗,或者我的UDP配置有什么问题,使用的发送函数是udp_send(struct udp_pcb *pcb, struct pbuf *p),已经对第二个结构体参数完成了赋值。

    谢谢

    struct netconn *conn;
      err_t err;
      LWIP_UNUSED_ARG(arg);
      //volatile uint32_t remoteIp[4] = {172,168,4,195};
    
      /* Create a new connection identifier. */
      /* Bind connection to well known port number 7. */
    #if LWIP_IPV6
      conn = netconn_new(NETCONN_TCP_IPV6);
      netconn_bind(conn, IP6_ADDR_ANY, 7);
    #else /* LWIP_IPV6 */
      conn = netconn_new(NETCONN_UDP);
      netconn_bind(conn, IP_ADDR_ANY, 7);
      if_localIp_set = true;
    #endif /* LWIP_IPV6 */
      LWIP_ERROR("tcpecho: invalid conn", (conn != NULL), return;);
      SemaphoreP_pend(&gMmwMssMCB.enetCfg.EnetCfgDoneSemHandle, SystemP_WAIT_FOREVER);
      printf("Enet Semaphore Posted !!\n");
      const ip_addr_t test_local_ip = gMmwMssMCB.enetCfg.remoteIp; 
      err = netconn_connect(conn, &test_local_ip ,7);
      if (err != ERR_OK){
        printf("netconn connect has failed !!\n");
      }
      if (err == ERR_OK) {
          while(1){
            SemaphoreP_pend (&objDataSemaphoreHandle, SystemP_WAIT_FOREVER);
            struct pbuf my_udp_pbuf;
            my_udp_pbuf.flags=0;
            my_udp_pbuf.if_idx=0;
            my_udp_pbuf.ref=0;
            my_udp_pbuf.next=NULL;
            my_udp_pbuf.type_internal = 0x80;
           if(is_first_packet==true)
           {
            my_udp_pbuf.tot_len=68+num_of_point*24;
            my_udp_pbuf.len = my_udp_pbuf.tot_len;
            my_udp_pbuf.payload = first_udp_packet;
           }
           else
           {
            my_udp_pbuf.tot_len=32+num_of_point*24;
            my_udp_pbuf.len = my_udp_pbuf.tot_len;
            my_udp_pbuf.payload = common_udp_packet;
           }
            err = udp_send(conn->pcb.udp,&my_udp_pbuf);
            if(err==0)                           
            if_udp_bag_has_been_send = true;
          }
      }

  • 你好,

    网络相关代码,建议看看驱动例程里是否有可以参考的。

    C:\ti\mcu_plus_sdk_awr294x_08_00_02_02\examples\networking

    LWIP也是个开源的驱动,你也可以在网上搜索一下。

  • 你好

    请问如果要改变AWR2944的localIP,需要怎么做呢?我在test_netif_init()函数中看到先执行DHCP后执行autoIP,但是当我想改变remoteIP使与交换机分配的IP不在同一个子网下,是不是就不能使用DHCP呢?在不使用DHCP和autoIP的情况下,我能否自己使用函数netif_set_addr()直接给localIP赋值呢?或者有别的解决方案吗?

    谢谢

  • 你好

    我在网上看了一些关于lwip udp实现通信的例子。他们通过netcoon_new(NETCONN_UDP),创建一个udp接口,然后通过udp_bind()绑定本地IP和port,再使用udp_connect()绑定remoteIP,接下来就可以使用udp_send()向PC发送udp数据,但是我按照如上配置后,还是会失去响应,其中netconn_connect()的返回值err=ERR_OK。使用wireshark无法抓到udp发的包,在cmd命令行也无法ping通,通过打印LOG的方式可以确定LocalIP和remoteIp均无误。代码如下

    tcpclient_thread(void *arg)
    {
      struct netconn *conn;
      err_t err;
      LWIP_UNUSED_ARG(arg);
    #if LWIP_IPV6
      conn = netconn_new(NETCONN_TCP_IPV6);
      netconn_bind(conn, IP6_ADDR_ANY, 9509);
    #else /* LWIP_IPV6 */
      conn = netconn_new(NETCONN_UDP);
      netconn_bind(conn, IP_ADDR_ANY, 7);
      if_localIp_set = true;
    #endif /* LWIP_IPV6 */
      LWIP_ERROR("tcpecho: invalid conn", (conn != NULL), return;);
      CLI_write("tcpclient_thread\r\n");
      ClockP_usleep(2000000);
      SemaphoreP_pend(&gMmwMssMCB.enetCfg.EnetCfgDoneSemHandle, SystemP_WAIT_FOREVER);
      CLI_write("Enet Semaphore Posted !!\r\n");
      printf("Enet Semaphore Posted !!\n");
      const ip_addr_t test_local_ip = gMmwMssMCB.enetCfg.remoteIp;     //remoteIP
      CLI_write("test local ip set\r\n");
      err = netconn_connect(conn, &test_local_ip ,7);
      CLI_write("err=%d\r\n",err);
      CLI_write ("Local IP is: %s\n", ip4addr_ntoa((const ip4_addr_t *)&gMmwMssMCB.enetCfg.localIp));
      CLI_write("Remote IP Address is %s\n", ip4addr_ntoa(&gMmwMssMCB.enetCfg.remoteIp));
      if (err == ERR_OK) {
          while(1){
            /* Pending on the semaphore: Waiting for events to be received */
            SemaphoreP_pend (&objDataSemaphoreHandle, SystemP_WAIT_FOREVER);
            struct pbuf *my_udp_pbuf;
            if(is_first_packet==true)       {
            my_udp_pbuf = pbuf_alloc(PBUF_TRANSPORT,68+num_of_point*24,PBUF_ROM);
            my_udp_pbuf->payload = first_udp_packet;  
           }
           else
           {
            my_udp_pbuf = pbuf_alloc(PBUF_TRANSPORT,32+num_of_point*24,PBUF_ROM);
            my_udp_pbuf->payload = common_udp_packet;
           }
            CLI_write("begin send my udp_packet\r\n");
            err = udp_send(conn->pcb.udp,my_udp_pbuf);
            pbuf_free(my_udp_pbuf);
            if(err==0)                           //只有当成功发送后才置位 
            if_udp_bag_has_been_send = true;
          }
      }
    }
    
    //
    #ifdef ENET_STREAM
        if(gMmwMssMCB.enetCfg.streamEnable){
        SemaphoreP_post(&objDataSemaphoreHandle);
        }
        #endif 
        while(!if_udp_bag_has_been_send)   //在以太网完成发送之前,等待
          {
          }
          CLI_write("wait for udp done\r\n");
          CLI_write("send is done\r\n");
          if(first_packet!=NULL)
          free(first_packet);           //释放动态分配的内存
          if(common_packet!=NULL)
          free(common_packet);           //释放动态分配的内存
          if_udp_bag_has_been_send = false;   //置为false,等待下一次udp send
          packet_count++;
          CLI_write("packet have send = %d\r\n",packet_count);
          CLI_write("udp done\r\n");

    使用串口打印的LOG如下

    在打印"wait for udp done"时,只打印出”wait“就失去了响应。

    还请工程师帮忙看看问题出在什么地方

    谢谢

  • 你好

    我在注释掉udp_send()函数后,可以正常ping通板子,板子也不会失去响应,请问可能的错误有哪些?在使用

     my_udp_pbuf = pbuf_alloc(PBUF_TRANSPORT,20,PBUF_RAM);时,把我自定义的20个字节的数组数据,使用
    memcpy(my_udp_pbuf->payload,my_udp_testbuf,20);拷贝到payload指向的地址也还是会出现板子无响应,ping不通的情况。
    谢谢
  • 你好,

    建议驱动编译为debug模式,单步调试一下。或者到LWIP相关论坛询问。