Jump to content
OMRON Forums

shansen

Members
  • Posts

    186
  • Joined

  • Last visited

  • Days Won

    1

Everything posted by shansen

  1. I am using kmalloc in one of my kernel modules, so this definitely can be done. I am #include'ing to get the GFP_KERNEL flag, but I am also compiling with my own makefile outside of the IDE. All of the errors except the first are caused by the compiler failing to find linux/mmzone.h, which defines the macros that you are missing. It looks like it is grabbing the wrong linux/gfp.h. For the user servo code, you want: "\opt\eldk-4.2\debian_rootfs\usr\src\\include\linux\gfp.h" Instead, the IDE is including: "\usr\local\powerpc-405-linux-gnu\sys-include\linux\gfp.h" I don't know if there is a way to fix this other than manually editing the makefile. Perhaps someone else knows?
  2. Awesome writeup KEJR. While most installations only modify /etc, this isn't always true so I typically sync the main three mount points after installing anything. # cd /.readonly/root-tmpfs-mirror # cp –a * ../root # cd /.readonly/etc-tmpfs-mirror # cp –a * ../etc # cd /.readonly/var-tmpfs-mirror # cp –a * ../var
  3. lmckay: I'm definitely interested, and I'd bet there are others who are interested as well. Also, I'd love to know more about how Google Test works within an embedded environment like PPMAC. It is just a unit testing framework, correct?
  4. This might be an IDE issue. We don't typically use the Delta Tau IDE, so I don't know if they let you specify a non-standard root password. I just tried connecting to the FTP on one of our Power PMACs by browsing to ftp://[iP ADDRESS] in Windows explorer and everything worked correctly.
  5. Also, why is it trying to copy bzcat, gunzip, etc? Are you sure that you ran the cd /.readonly/etc-tmpfs-mirror/ command to switch directories before the cp -a * ../etc? My /.readonly/etc-tmpfs-mirror folder has the following contents: root@etc-tmpfs-mirror: ls -l total 12 -rwxr-xr-x 1 root root 283 2011-03-16 08:24 hosts -rw-r--r-- 1 root root 678 2015-05-09 06:31 mtab drwxrwxrwx 3 root root 80 2011-03-16 08:24 network -rw-r----- 1 root shadow 728 2015-05-08 15:05 shadow drwxr-xr-x 3 root root 60 2009-10-08 11:52 udev -r--r--r-- 1 root root 0 1981-08-26 17:25 .wh..wh.aufs drwx------ 2 root root 40 1981-08-26 17:25 .wh..wh.orph drwx------ 2 root root 40 1981-08-26 17:25 .wh..wh.plnk root@etc-tmpfs-mirror:
  6. Hmmm. Check the output of df -h to make sure you have free disk space. Also check df -i to make sure you haven't run out of inodes. If you have a logger writing a lot of small files you could potentially have free disk space but run out of inodes. At this point I would reboot the Power PMAC, change the password, and then sync the filesystem.
  7. See this thread: http://forums.deltatau.com/showthread.php?tid=83 Here is the short version. Mount the filesystem as read-write by issuing: mount -o remount,rw / Then use passwd to change the root password. When you are finished, sync the filesystem and remount as read-only: cd /.readonly/etc-tmpfs-mirror/ cp -a * ../etc/ cd /.readonly/root-tmpfs-mirror/ cp -a * ../root/ cd /.readonly/var-tmpfs-mirror/ cp -a * ../var/ mount -o remount,ro /
  8. Also, if you use kmalloc make sure that you aren't calling it every time the servo code executes. You will quickly use up all available memory and crash the processor. It is probably better to use the stack in this case (see previous post), or allocate memory on your first execution only. If you have to kmalloc each time the servo code runs, make sure to call "kfree()" at the end of your servo code.
  9. buaame414: User servo code runs in the kernel, so you need to use kmalloc instead of malloc to allocate memory on the heap. However, for something small like 10 doubles, you can easily allocate on the stack instead: On the stack: double doubleArray[10]; double *p = &doubleArray[0]; On the heap: double *p = kmalloc(10 * sizeof(double), GFP_KERNEL); If you want to learn more about the available flags that can be passed to kmalloc, see table 11.5 in the following link: http://www.makelinux.net/books/lkd2/ch11lev1sec4
  10. KEJR, on our systems we use a modified startup script to launch applications almost immediately after the Delta Tau code starts, and we haven't had any issues. Our script starts in run level 2. Maybe there is something that still isn't loaded after that "InitSharedMemory(1)" statement is printed? As an easy test set up a script that will write a file to disk at the end of run level 2: #! /bin/sh # save this file to /.readonly/etc/init.d/ppmacboottest # touch /var/test Then create a symlink from /.readonly/etc/rc2.d/S99test to /.readonly/etc/init.d/ppmacboottest. Now reboot the PPMAC and wait to connect until "ls /var | grep test" returns positive.
  11. KEJR: How about something like this: 1. Wait until you can get a ping response from the Power PMAC --> Linux is running 2. Over telnet check dmesg for "PPmacInit Done" message (dmesg | grep "PPmacInit Done") --> Power PMAC APIs are loaded 3. Start your background program, etc. Here is the relevant output of "dmesg" after the Power PMAC finishes booting up: initializing module rtpmaclib DetectProcessor DetectProcessor: Clock = 1000000012 DetectProcessor: CPU Model = PowerPC,460EX DetectProcessor: cores = 1 irq: irq 18 on host /interrupt-controller0 mapped to virtual irq 38 Phase IRQ= 38 irq: irq 9 on host /interrupt-controller0 mapped to virtual irq 39 CaptComp IRQ= 39 InitPhaseTimer CreateSemaphores Program buffer: 16777216 User buffer: 1048576 Table buffer: 1048576 LookAhead buffer: 16777216 InitSharedMemory(): PPmacInit PPmacInit Done rtpmac started InitSharedMemory(1): 0c65d8b8 0c661aa8
  12. To answer your 2nd question, see this thread: http://forums.deltatau.com/showthread.php?tid=1793
  13. For anyone who uses this method, it seems that the base motor address and the size of each motor has changed in later firmware versions. Here is a corrected version that should work on any firmware: unsigned int motor = (unsigned int)Mptr; unsigned int mbase = (unsigned int)&pshm->Motor[0]; unsigned int msize = (unsigned int)&pshm->Motor[1] - mbase; unsigned int mnum = (motor - mbase) / msize; // motor number
  14. smr99: For the benefit of anyone else reading this, I'll give a bit more context before answering your questions. First of all, my company has been using the Power PMAC primarily for non-motion applications. In other words, we have not been using the DT script motion programs at all. Secondly, we have written custom tools to let us download, upload, and backup our project files on the Power PMAC. For example, we are not using DT standard Cplcs, and instead have our own custom framework for creating and managing background or real-time tasks directly. We decided to use Eclipse several years ago for many reasons. Eclipse allows arbitrary project organization, it has GREAT syntax coloring, code auto-formatting, the ability to put revision information into our compiled code for revision tracking, refactoring support, etc ad infinitum. Another big problem for us is that the Delta Tau IDE only supports Windows. Eclipse lets us run on Windows, OSX, and Linux. As of 2014, most of our developers have switched to using Linux and Eclipse. This is convenient even on Windows because we can create a free Linux Virtual Machine and copy it from one computer to another (presto! instant dev workstation). Another large benefit is that there are pre-built PowerPC toolchains for Linux, so we can set up the toolchain quickly and easily. OK, now to answer your questions: 1. Normal Visual Studio offers "post-build" options. If the DT IDE supports this feature, you could write a post-build script that would automate the process of modifying the makefile and recompiling the code. If not, I don't know of any other solution within Delta Tau's IDE. I can help you get started with Eclipse, but I can only show you how to setup and compile C-code. I don't know how to deal with motion programs or script PLCs in Eclipse (although I've toyed with the idea of writing an Eclipse plugin for syntax coloring and compilation of DT script). 2. For downloading compiled code to the Power PMAC, we ended up writing our own program to do this so we can store our code in a different location on the Power PMAC, download to multiple Power PMACs at the same time, etc. 3. I am personally willing to share my Eclipse notes, but I'm guessing Delta Tau doesn't want me to publish them here (if only because they have put quite a bit of effort into their own IDE). Also it may be confusing to those who are not familiar with the DT products. I will need to do some minor editing to remove some company-specific things from my Eclipse notes, but if you are still interested in Eclipse after reading this, send me an email (via my profile) and I'll get back to you.
  15. smr99: For the benefit of anyone else reading this, I'll give a bit more context before answering your questions. First of all, my company has been using the Power PMAC primarily for non-motion applications. In other words, we have not been using the DT script motion programs at all. Secondly, we have written custom tools to let us download, upload, and backup our project files on the Power PMAC. For example, we are not using DT standard Cplcs, and instead have our own custom framework for creating and managing background or real-time tasks directly. We decided to use Eclipse several years ago for many reasons. Eclipse allows arbitrary project organization, it has GREAT syntax coloring, code auto-formatting, the ability to put revision information into our compiled code for revision tracking, refactoring support, etc ad infinitum. Another big problem for us is that the Delta Tau IDE only supports Windows. Eclipse lets us run on Windows, OSX, and Linux. As of 2014, most of our developers have switched to using Linux and Eclipse. This is convenient even on Windows because we can create a free Linux Virtual Machine and copy it from one computer to another (presto! instant dev workstation). Another large benefit is that there are pre-built PowerPC toolchains for Linux, so we can set up the toolchain quickly and easily. OK, now to answer your questions: 1. Normal Visual Studio offers "post-build" options. If the DT IDE supports this feature, you could write a post-build script that would automate the process of modifying the makefile and recompiling the code. If not, I don't know of any other solution within Delta Tau's IDE. I can help you get started with Eclipse, but I can only show you how to setup and compile C-code. I don't know how to deal with motion programs or script PLCs in Eclipse (although I've toyed with the idea of writing an Eclipse plugin for syntax coloring and compilation of DT script). 2. For downloading compiled code to the Power PMAC, we ended up writing our own program to do this so we can store our code in a different location on the Power PMAC, download to multiple Power PMACs at the same time, etc. 3. I am personally willing to share my Eclipse notes, but I'm guessing Delta Tau doesn't want me to publish them here (if only because they have put quite a bit of effort into their own IDE). Also it may be confusing to those who are not familiar with the DT products. I will need to do some minor editing to remove some company-specific things from my Eclipse notes, but if you are still interested in Eclipse after reading this, send me an email (via my profile) and I'll get back to you.
  16. piefum: I forgot that in order to use the bash shell in Cygwin, you will may need to set your Windows "Path" environment variable before opening bash.exe. Specifically, you need to add the following two paths to the PATH variable: After adding these paths, you should be able to use bash.exe.
  17. piefum: I forgot that in order to use the bash shell in Cygwin, you will may need to set your Windows "Path" environment variable before opening bash.exe. Specifically, you need to add the following two paths to the PATH variable: After adding these paths, you should be able to use bash.exe.
  18. piefum: We are definitely getting closer to a solution here! First of all, you should be using bash.exe in the powerpc-460-linux-gnu/bin directory, not cygwin.bat. The Delta Tau IDE isn't using a full Cygwin installation, instead it's a custom installation that has been modified with the correct paths. After opening bash.exe, you should be able to type "mount" and see the two mount points that Delta Tau set up for / and for /opt. If you can get this far, then try navigating to the Capp folder of your project. As far as Linux paths go, in Cygwin you should use /cygdrive/c/ to get to your computer's C drive (don't use Windows paths like C:\Program Files (x86)\...). First, use the unmodified makefile (Delta Tau standard) and issue a "make" command. This is how the IDE compiles code, so this should succeed. If it doesn't succeed, then we need to figure out why before proceeding. Secondly, modify the makefile and try to compile again. All paths must match what is on your PC, and this may be slightly different than what is on the Power PMAC! For example, /var/ftp/ppmaclibs does not exist on your PC, so you will need to use /usr/local/ppmaclibs. If you are still having problems you could try cross-compiling zmq from scratch on your PC via Cygwin, and then compile your Capp against the cross-compiled zmq binary. Again, you will need to modify your gcc/makefile flags so the paths match what is on your PC.
  19. piefum: We are definitely getting closer to a solution here! First of all, you should be using bash.exe in the powerpc-460-linux-gnu/bin directory, not cygwin.bat. The Delta Tau IDE isn't using a full Cygwin installation, instead it's a custom installation that has been modified with the correct paths. After opening bash.exe, you should be able to type "mount" and see the two mount points that Delta Tau set up for / and for /opt. If you can get this far, then try navigating to the Capp folder of your project. As far as Linux paths go, in Cygwin you should use /cygdrive/c/ to get to your computer's C drive (don't use Windows paths like C:\Program Files (x86)\...). First, use the unmodified makefile (Delta Tau standard) and issue a "make" command. This is how the IDE compiles code, so this should succeed. If it doesn't succeed, then we need to figure out why before proceeding. Secondly, modify the makefile and try to compile again. All paths must match what is on your PC, and this may be slightly different than what is on the Power PMAC! For example, /var/ftp/ppmaclibs does not exist on your PC, so you will need to use /usr/local/ppmaclibs. If you are still having problems you could try cross-compiling zmq from scratch on your PC via Cygwin, and then compile your Capp against the cross-compiled zmq binary. Again, you will need to modify your gcc/makefile flags so the paths match what is on your PC.
  20. piefum: The reason gcc can't find gplib.h is you haven't specified the header file location. To do this, use the "I" flag (e.g. "-I /opt/ppmac/libppmac -I/opt/ppmac/rtpmac"). Also, you will need to include the Delta Tau libraries and Xenomai libraries that they link against ("-lrt -lpthread -lpthread_rt -lppmac"). However, if you prefer to compile under Windows you will need to edit your Capp's makefile to include the "-L/ -lzmq". This means you will need to copy the compiled binary (libzmq) and zmq header files from the Power PMAC to your PC. On Windows, you can find the Cygwin bash shell that is installed with Delta Tau's IDE at: If my memory serves me correctly, Delta Tau has mapped the /opt directory to: I may be wrong on that, I haven't used the IDE in a while. Assuming I am correct, you could then copy the compiled zmq library binary file and the header files to: Then, edit the Capp makefile to include "-L/opt/usr/local/zmq -lzmq". Now, use the bash shell to navigate to your Capp's directory (where the makefile is) and compile it by issuing "make".
  21. piefum: The reason gcc can't find gplib.h is you haven't specified the header file location. To do this, use the "I" flag (e.g. "-I /opt/ppmac/libppmac -I/opt/ppmac/rtpmac"). Also, you will need to include the Delta Tau libraries and Xenomai libraries that they link against ("-lrt -lpthread -lpthread_rt -lppmac"). However, if you prefer to compile under Windows you will need to edit your Capp's makefile to include the "-L/ -lzmq". This means you will need to copy the compiled binary (libzmq) and zmq header files from the Power PMAC to your PC. On Windows, you can find the Cygwin bash shell that is installed with Delta Tau's IDE at: If my memory serves me correctly, Delta Tau has mapped the /opt directory to: I may be wrong on that, I haven't used the IDE in a while. Assuming I am correct, you could then copy the compiled zmq library binary file and the header files to: Then, edit the Capp makefile to include "-L/opt/usr/local/zmq -lzmq". Now, use the bash shell to navigate to your Capp's directory (where the makefile is) and compile it by issuing "make".
  22. piefum: Those errors are from the parser, and don't have anything to do with compiling. If the project compiles successfully, then everything is OK even if it is showing errors.
  23. piefum: Those errors are from the parser, and don't have anything to do with compiling. If the project compiles successfully, then everything is OK even if it is showing errors.
  24. piefum: It looks like the errors are purely aesthetic, and have nothing to do with the compilation (e.g. the compile is succeeding). I think this is because the Delta Tau IDE is using a custom C language parser and it isn't great at recognizing and mapping all of the referenced include files. However, if the application compiles, then that means everything is working properly. Have you tried to download and run the application after compiling?
  25. piefum: It looks like the errors are purely aesthetic, and have nothing to do with the compilation (e.g. the compile is succeeding). I think this is because the Delta Tau IDE is using a custom C language parser and it isn't great at recognizing and mapping all of the referenced include files. However, if the application compiles, then that means everything is working properly. Have you tried to download and run the application after compiling?
×
×
  • Create New...