查看: 1057|回复: 0

[原创] 英飞凌Position2Go开发套件评测5-编译并写入开发板内存

[复制链接]

该用户从未签到

发表于 2019-8-12 13:27:43 | 显示全部楼层 |阅读模式
分享到:
1、在上一帖中,导入开发范例程序后,就可以用DAVE开发并编写程序了。编译范例程序,
1.PNG
然后选择编译器J-LINK,创建一个新的编译
2.PNG
这样就可以写入程序了.
2.另外一个编译的方法是直接用XMC Flasher,这个是直接写入.启动程序,
3.PNG
选择XMC-4700-2048,然后连接开发板,按照手册的提示,需要两个USB口都连接好,一个是调试接口,另一个emulator也是需要廉洁的.
然后点击program,就可以写入程序了.
4.PNG
显示写入成功.
5.PNG
3 继续测试各项指标和功能.
在空中直立并面对障碍物移动开发板的,同时在显示屏上显示初开发板的各项读数.
bms.gif
可以看到移动的障碍物.
程序读写和编译成功.
4 对应于需要继续开发的项目,可以看到范例程序其实提供了一个基本的框架,可以方便的定制个性化的程序.
这个框架使用了Application和radar的一些API,可以直接调用读取的数据,避免了自由读写所带来的解析和数据分析工作,提高了开发效率.
在main.c中的主要代码如下,user code也可以在显示的位置添加.
  1. int main(void)
  2. {
  3.   DAVE_STATUS_t status;
  4.   
  5.   /* Initialize DAVE APPs */
  6.   status = DAVE_Init();
  7.   
  8.   if(status != DAVE_STATUS_SUCCESS)
  9.   {
  10.     /* Placeholder for error handler code.
  11.      * The while loop below can be replaced with an user error handler. */
  12.     XMC_DEBUG("DAVE APPs initialization failed\n");
  13.     while(1U);
  14.   }
  15.   
  16.   /* Register algorithm processing function:
  17.    * Set the algorithm processing function pointer, it will
  18.    * be used by the application for algorithm data processing */
  19.   app_register_algo_process(NULL);
  20.   
  21.   /* Initialize the application */
  22.   app_init();
  23.   
  24.   /* Infinite loop */
  25.   while(1U)
  26.   {
  27.     /* Main application process */
  28.     app_process();
  29.   }
  30. }

  31. /*
  32. ==============================================================================
  33.    3. USER CALLBACK FUNCTIONS
  34. ==============================================================================
  35. */

  36. void acq_completed_cb(void)
  37. {
  38. /*
  39.   * The following code shows an example of how to access raw data buffer.
  40.   */

  41.   /*
  42.   acq_buf_obj *p_acq_buf         = ds_get_active_acq_buf();
  43.   uint8_t *raw_data                 = p_acq_buf->p_acq_buf;
  44.   uint32_t raw_data_size         = p_acq_buf->used_size_of_acq_buffer;
  45.   
  46.   -- Add your code here --
  47.   
  48.   */
  49. }

  50. void algo_completed_cb(void)
  51. {
  52. /*
  53.   * The following sample code could be seen as a small example,
  54.   * how to get the information from the algorithm and use it accordingly.
  55.   */
  56.   
  57.   /*
  58.   static float s_max_level = 0;
  59.   static uint32_t countFrames = 0;
  60.   static uint32_t s_max_num_targets = 0;
  61.   
  62.   extern Radar_Handle_t h_radar_device;
  63.   
  64.   Target_Info_t target_info[MAX_NUM_OF_TARGETS];
  65.   
  66.   uint8_t num_targets;
  67.   
  68.   if(radar_get_target_info(h_radar_device, target_info, &num_targets) == RADAR_ERR_OK)
  69.   {
  70.     float max_level = 0;
  71.     for(int i= 0; i< num_targets; i++)
  72.     {
  73.       if(target_info[i].level > max_level)
  74.       {
  75.         s_max_level = target_info[i].level;
  76.       }
  77.     }
  78.     countFrames += 1;
  79.    
  80.     if(num_targets > s_max_num_targets)
  81.     {
  82.       s_max_num_targets = num_targets;
  83.     }
  84.    
  85.   }
  86.   */
  87. }
复制代码



回复

使用道具 举报

您需要登录后才可以回帖 注册/登录

本版积分规则

关闭

站长推荐上一条 /2 下一条

手机版|小黑屋|与非网

GMT+8, 2024-4-27 00:33 , Processed in 0.109799 second(s), 16 queries , MemCache On.

ICP经营许可证 苏B2-20140176  苏ICP备14012660号-2   苏州灵动帧格网络科技有限公司 版权所有.

苏公网安备 32059002001037号

Powered by Discuz! X3.4

Copyright © 2001-2024, Tencent Cloud.