Difference between revisions of "Install the toolchain"

From IridiaWiki
Jump to navigationJump to search
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
  +
There is an already compiled toolchain for the e-puck in the repositories.
I was able to compile the pic30-gcc version 3.20 on my pc following these instructions:
 
  +
In the svn you will find ''e-puck_toolchain_i686-20110909.tar.bz2''. Untar this file in your root dir. That's it! All the libs and includes will be in /usr/local/
[http://www.electricrock.co.nz/blog/2010/01/building-c30-v32/ How to compile the pic30-gcc v3.20]
 
   
  +
Up to now we only have a 32bit toolchain that works under ubuntu and slackware (tested). We are still in the process of making a 64bit version.
However I wasn't able to succesfully compile the epuckaseba.c file into a .hex.
 
   
  +
On Ubuntu you need to add the files to the path. The best way to do this is to add these lines in your .bashrc
I had the following error:
 
   
  +
export PATH=/usr/local/pic30-elf/bin:$PATH
jump_table(.handle+0x10): In function `.handle':
 
  +
export COMPILER_PATH=/usr/bin
: undefined reference to `_AsebaNative_vecadd'
 
jump_table(.handle+0x12): In function `.handle':
 
: undefined reference to `_AsebaNative_vecadd'
 
jump_table(.handle+0x14): In function `.handle':
 
: undefined reference to `_AsebaNative_vecsub'
 
jump_table(.handle+0x16): In function `.handle':
 
: undefined reference to `_AsebaNative_vecsub'
 
jump_table(.handle+0x4): In function `.handle':
 
: undefined reference to `_AsebaNative_vecstat'
 
jump_table(.handle+0x6): In function `.handle':
 
: undefined reference to `_AsebaNative_vecstat'
 
jump_table(.handle+0x0): In function `.handle':
 
: undefined reference to `_AsebaNative_vecdot'
 
jump_table(.handle+0x2): In function `.handle':
 
: undefined reference to `_AsebaNative_vecdot'
 
jump_table(.handle+0x8): In function `.handle':
 
: undefined reference to `_AsebaNative_vecfill'
 
jump_table(.handle+0xa): In function `.handle':
 
: undefined reference to `_AsebaNative_vecfill'
 
jump_table(.handle+0x28): In function `.handle':
 
: undefined reference to `_AsebaNative_mathsin'
 
jump_table(.handle+0x2a): In function `.handle':
 
: undefined reference to `_AsebaNative_mathsin'
 
jump_table(.handle+0x20): In function `.handle':
 
: undefined reference to `_AsebaNative_mathmuldiv'
 
jump_table(.handle+0x22): In function `.handle':
 
: undefined reference to `_AsebaNative_mathmuldiv'
 
jump_table(.handle+0x18): In function `.handle':
 
: undefined reference to `_AsebaNative_vecmin'
 
jump_table(.handle+0x1a): In function `.handle':
 
: undefined reference to `_AsebaNative_vecmin'
 
jump_table(.handle+0x24): In function `.handle':
 
: undefined reference to `_AsebaNative_mathatan2'
 
jump_table(.handle+0x26): In function `.handle':
 
: undefined reference to `_AsebaNative_mathatan2'
 
jump_table(.handle+0x1c): In function `.handle':
 
: undefined reference to `_AsebaNative_vecmax'
 
jump_table(.handle+0x1e): In function `.handle':
 
: undefined reference to `_AsebaNative_vecmax'
 
jump_table(.handle+0x2c): In function `.handle':
 
: undefined reference to `_AsebaNative_mathcos'
 
jump_table(.handle+0x2e): In function `.handle':
 
: undefined reference to `_AsebaNative_mathcos'
 
jump_table(.handle+0xc): In function `.handle':
 
: undefined reference to `_AsebaNative_veccopy'
 
jump_table(.handle+0xe): In function `.handle':
 
: undefined reference to `_AsebaNative_veccopy'
 
epuckaseba.o(.text+0x230): In function `.L63':
 
: undefined reference to `_e_randb_get_if_received'
 
epuckaseba.o(.text+0x238): In function `.L63':
 
: undefined reference to `_e_randb_get_data'
 
epuckaseba.o(.text+0x246): In function `.L63':
 
: undefined reference to `_e_randb_get_bearing'
 
epuckaseba.o(.text+0x262): In function `.L63':
 
: undefined reference to `_e_randb_get_range'
 
epuckaseba.o(.text+0x2c4): In function `.L69':
 
: undefined reference to `_e_randb_send_all_data'
 
epuckaseba.o(.text+0x2dc): In function `_initRobot':
 
: undefined reference to `_e_init_randb'
 
epuckaseba.o(.text+0x33a): In function `_initAseba':
 
: undefined reference to `_AsebaVMInit'
 
epuckaseba.o(.text+0x378): In function `.L91':
 
: undefined reference to `_e_randb_set_range'
 
epuckaseba.o(.text+0x37c): In function `.L91':
 
: undefined reference to `_e_randb_set_calculation'
 
epuckaseba.o(.text+0x37e): In function `.L91':
 
: undefined reference to `_e_randb_store_light_conditions'
 
epuckaseba.o(.text+0x384): In function `.L91':
 
: undefined reference to `_AsebaVMSetupEvent'
 
epuckaseba.o(.text+0x38a): In function `.L94':
 
: undefined reference to `_AsebaProcessIncomingEvents'
 
epuckaseba.o(.text+0x392): In function `.L94':
 
: undefined reference to `_AsebaVMRun'
 
epuckaseba.o(.text+0x3d0): In function `.L95':
 
: undefined reference to `_AsebaVMSetupEvent'
 
epuckaseba.o(.ndata+0x86): undefined reference to `_AsebaNativeDescription_vecdot'
 
epuckaseba.o(.ndata+0x88): undefined reference to `_AsebaNativeDescription_vecstat'
 
epuckaseba.o(.ndata+0x8a): undefined reference to `_AsebaNativeDescription_vecfill'
 
epuckaseba.o(.ndata+0x8c): undefined reference to `_AsebaNativeDescription_veccopy'
 
epuckaseba.o(.ndata+0x8e): undefined reference to `_AsebaNativeDescription_vecadd'
 
epuckaseba.o(.ndata+0x90): undefined reference to `_AsebaNativeDescription_vecsub'
 
epuckaseba.o(.ndata+0x92): undefined reference to `_AsebaNativeDescription_vecmin'
 
epuckaseba.o(.ndata+0x94): undefined reference to `_AsebaNativeDescription_vecmax'
 
epuckaseba.o(.ndata+0x96): undefined reference to `_AsebaNativeDescription_mathmuldiv'
 
epuckaseba.o(.ndata+0x98): undefined reference to `_AsebaNativeDescription_mathatan2'
 
epuckaseba.o(.ndata+0x9a): undefined reference to `_AsebaNativeDescription_mathsin'
 
epuckaseba.o(.ndata+0x9c): undefined reference to `_AsebaNativeDescription_mathcos'
 
epuckaseba.o(.ndata+0xa0): undefined reference to `_AsebaNative_vecdot'
 
epuckaseba.o(.ndata+0xa2): undefined reference to `_AsebaNative_vecstat'
 
epuckaseba.o(.ndata+0xa4): undefined reference to `_AsebaNative_vecfill'
 
epuckaseba.o(.ndata+0xa6): undefined reference to `_AsebaNative_veccopy'
 
epuckaseba.o(.ndata+0xa8): undefined reference to `_AsebaNative_vecadd'
 
epuckaseba.o(.ndata+0xaa): undefined reference to `_AsebaNative_vecsub'
 
epuckaseba.o(.ndata+0xac): undefined reference to `_AsebaNative_vecmin'
 
epuckaseba.o(.ndata+0xae): undefined reference to `_AsebaNative_vecmax'
 
epuckaseba.o(.ndata+0xb0): undefined reference to `_AsebaNative_mathmuldiv'
 
epuckaseba.o(.ndata+0xb2): undefined reference to `_AsebaNative_mathatan2'
 
epuckaseba.o(.ndata+0xb4): undefined reference to `_AsebaNative_mathsin'
 
epuckaseba.o(.ndata+0xb6): undefined reference to `_AsebaNative_mathcos'
 
make: *** [epuckaseba.elf] Error 1
 
   
  +
maybe this could help: http://www.microchip.com/forums/tm.aspx?m=467676&mpage=1
 
  +
Note that GioReina worked with the e-pucks under mac os. Check out his directory in the examples file.
  +
  +
===== Testing =====
  +
  +
In the file ''e-puck_various_and_examples.tar.gz'' you will find a directory called ''testing''. In this directory there is a very simple program called ''testing.c'', basically a while(1). If you manage to compile this you should be good to go.
  +
  +
cd testing
  +
mkdir build
  +
cd build
  +
cmake ..
  +
  +
everything should be fine and created
  +
  +
make
  +
pic30-elf-bin2hex testing
  +
  +
if everything goes fine you should have a ''testing'' that is the compiled binary (obtained by doing ''make'', not usable by the e-puck) and a ''testing.hex'' (obtained with the ''pic30-elf-bin2hex'') that can be uploaded on the e-puck.
  +
  +
  +
===== Examples =====
  +
  +
In the svn you will find also a file called ''e-puck_various_and_examples.tar.gz''. This files contains all the examples, original libraries and software that I found around. Many things have never been tested, many are old, many are undocumented. Still it's full of useful examples that you can use for your programs. Have a look.
  +
  +
  +
  +
  +
===== More technical information =====
  +
  +
[http://www.electricrock.co.nz/blog/2010/01/building-c30-v32/ How to compile the pic30-gcc v3.20]

Latest revision as of 09:23, 20 October 2011

There is an already compiled toolchain for the e-puck in the repositories. In the svn you will find e-puck_toolchain_i686-20110909.tar.bz2. Untar this file in your root dir. That's it! All the libs and includes will be in /usr/local/

Up to now we only have a 32bit toolchain that works under ubuntu and slackware (tested). We are still in the process of making a 64bit version.

On Ubuntu you need to add the files to the path. The best way to do this is to add these lines in your .bashrc

export PATH=/usr/local/pic30-elf/bin:$PATH
export COMPILER_PATH=/usr/bin


Note that GioReina worked with the e-pucks under mac os. Check out his directory in the examples file.

Testing

In the file e-puck_various_and_examples.tar.gz you will find a directory called testing. In this directory there is a very simple program called testing.c, basically a while(1). If you manage to compile this you should be good to go.

cd testing
mkdir build
cd build
cmake ..

everything should be fine and created

make 
pic30-elf-bin2hex testing

if everything goes fine you should have a testing that is the compiled binary (obtained by doing make, not usable by the e-puck) and a testing.hex (obtained with the pic30-elf-bin2hex) that can be uploaded on the e-puck.


Examples

In the svn you will find also a file called e-puck_various_and_examples.tar.gz. This files contains all the examples, original libraries and software that I found around. Many things have never been tested, many are old, many are undocumented. Still it's full of useful examples that you can use for your programs. Have a look.



More technical information

How to compile the pic30-gcc v3.20