6368 views|1 replies

68

Posts

0

Resources
The OP
 

【XMC4800 Relax EtherCAT Kit Review】+Build a new project and experience the powerful DAVE [Copy link]

This post was last edited by tdatd on 2019-1-14 15:34 All previous experiments were directly imported from Infineon's demo. I have a preliminary understanding of the power of Dave and the advanced process of IDE code generation. The era of using registers to write microcontroller registers seems to be gone, just like using st's cube to directly generate stm32 library files, and the bottom layer basically does not need to be written. Through this experiment, I also realized the powerful functions of Dave, directly configuring the hardware and automatically generating code. As an engineer, I always feel that I can be solid if I master it from scratch. Sometimes when I encounter problems that cannot be solved, I often suggest a new project to test it. I think I can generate the basic functions of FreRTOS through IDE, enable 2 tasks and drive LED1 LED2 respectively. Start Dave, which is based on the eclipse interface. Note that the directory of the workspace cannot have Chinese characters, spaces, etc. Then create a new Dave project. If it is not a Dave project, many integrated advanced configuration functions are probably not easy to use. Enter the project name. The arm-gcc application created selects dave ceproject Select the corresponding main cpu device. An empty project is created. Now use help, install dave app libray to add the inherited app and library: Then through the dave menu, click add new app, you can add the corresponding function, there are rich configuration modules, basically covering the commonly used peripheral functions, I noticed that there is also a motor libray, which integrates the control library of PMSM motors. It is estimated that using a single chip xmc4800 to directly develop ethercat servo drives is also a good solution. At present, many servo drive solutions on the market use a single dsp to control the PMSM motor, and then use a CPU to realize the ethercat slave. This will make the cost much higher. I wonder if Infineon has provided this evaluation plan. It should be very competitive. Also, I hope the price of this single chip xmc4800 is not too expensive. If the price of a single chip exceeds that of two stm32s, it will make people want to say that it is not easy to love you. Add digital io as gpio driver led I also added the freeRTOS component first. Thinking back to the CPU in the past, I had to port everything myself. Now the ide management is so powerful that the underlying library and the upper operating system can be fully configured with just a few clicks of the mouse. This efficiency improvement is really huge. The efficiency improvement brought by the technology upgrade is really ahead of the times. Configure DIGITAL-IO to output mode Use menu dave, manual pin allocator to configure LED1 and LED2 drivers on the development board I used the default configuration of free rtos, ticker is 1000 times per second, and other stacks are all default configurations. Then click dave menu to generate code Build and test first. Find DIGITAL_IO_ToggleOutput function, select the function, right click or press F3 to jump to the definition. The official code also integrates basic test usage, just copy it directly to main. Attach the code: int main(void) { DAVE_STATUS_t status; uint32_t delay_count;; status = DAVE_Init(); /* Initialization of DAVE APPs */ if(status != DAVE_STATUS_SUCCESS) { /* Placeholder for error handler code. The while loop below can be replaced with an user error handler. */ XMC_DEBUG("DAVE APPs initialization failed\n"); while(1U) { } } DIGITAL_IO_ToggleOutput(&LED2); while(1U) { #if 1 DIGITAL_IO_ToggleOutput(&DIGITAL_IO_1); //toggles : 1 -> 0 (if initial output level is logic 1) //Add application code here for(delay_count = 0;delay_count<0xfffff;delay_count++); DIGITAL_IO_ToggleOutput(&DIGITAL_IO_1); //toggles : 0 -> 1 //Add application code here for(delay_count = 0;delay_count<0xfffff;delay_count++); #endif } } Compiled ok, ready to download to hardware, the newly created project needs to configure the debugger, right click on the project name, click debug as, select debug configuration In the pop-up menu, double click GDB SEGGER J-Link Debugging to generate the debug configuration of the project, the default configuration does not need to be changed. Enter main You can also switch between the IDE editing, pin assignment, and debug mode windows using the three buttons in the upper right corner of the IDE. If you don't need debug, just right-click on the project name and select run as dave c/c++ application to download it to the xmc4800 chip flash. You can see that the led1 light is flashing. After restarting, it still falsh led. In this step, freeRTOS was added, but it hasn't run yet. It's been many years since I last used freeRTOS.The next step is to get familiar with freeRTOS and schedule two tasks. I have to say that the current development is really advanced. The entry threshold of new hardware and new platforms is getting lower and lower. It allows developers to focus more on development rather than building platforms, and completely get rid of the most tedious register configuration. It's great.



addio.png (52.7 KB, downloads: 0)

addio.png

Latest reply

It's really powerful, cross-platform is good.  Details Published on 2019-1-15 09:44
 

7422

Posts

2

Resources
2
 
It's really powerful, cross-platform is good.
Personal signature

默认摸鱼,再摸鱼。2022、9、28

 
 

Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list