====== Setting up Eclipse ====== This HOWTO consider developing in Eclipse IDE for [[courses:b35apo:documentation:mz_apo:start|MicroZed APO]]. Cross compiler already installed, like ''/usr/local/bin/arm-linux-gnueabihf-gcc'' in KN:E-2. ==== Add private SSH ==== For remote connection to [[courses:b35apo:documentation:mz_apo:start|MicroZed APO]], private key of user ''root'' has to be integrated into Eclipse IDE. - Select ''Preferences'' from ''Window'' menu.\\ {{:courses:b35apo:documentation:eclipse:03_window_preferences.png?200|Select ''Preferences'' from ''Window'' menu.}} - Select ''SSH2'' in ''General -> Network Connection'' left bar.\\ {{:courses:b35apo:documentation:eclipse:04_general_ssh2.png?200|Select ''SSH2'' in ''General -> Network Connection'' left bar.}} - Click to ''Add Private Key...''.\\ {{:courses:b35apo:documentation:eclipse:05_add_priv_key.png?200|Click to ''Add Private Key...''.}} - From ''File System'', find private key ''mzapo-root-key'' in ''/opt/apo/zynq/ssh-connect/'' folder.\\ {{:courses:b35apo:documentation:eclipse:07_find_key.png?200|From ''File System'', find private key ''mzapo-root-key'' in ''/opt/apo/zynq/ssh-connect/'' folder.}} - Confirm ''Preferences'' changes.\\ {{:courses:b35apo:documentation:eclipse:08_confirm_priv_key.png?200|Confirm ''Preferences'' changes.}} ==== Create project ==== - Create ''New -> Project''.\\ {{:courses:b35apo:documentation:eclipse:11_new_project.png?200|Create ''New -> Project''.}} - Select ''C Project''.\\ {{:courses:b35apo:documentation:eclipse:12_c_project.png?200|Select ''C Project''.}} - Type the ''Project name''.\\ {{:courses:b35apo:documentation:eclipse:13_project_name.png?200|Type the ''Project name''.}} - Just ''Next >'' click window.\\ {{:courses:b35apo:documentation:eclipse:14_select_config.png?200|Just ''Next >'' click window.}} - Set cross compiler prefix ''arm-linux-gnueabihf-''. Path can be left empty or set to ''/usr/local/bin/'' or ''/opt/OSELAS.Toolchain-2016.06.1/arm-cortexa8-linux-gnueabihf/gcc-5.4.0-glibc-2.23-binutils-2.26-kernel-4.6-sanitized/bin'' but that is not necessary. Then continue by ''Finish''.\\ {{:courses:b35apo:documentation:eclipse:15_cc_finish.png?200|Set cross compiler prefix ''arm-linux-gnueabihf-'' and it's path ''/usr/local/bin/'' and ''Finish''.}} - Use context menu of the project (right click) and select ''New'' - ''File''. You need to name file added to the project with appropriate extension (*.c). ==== Build project ==== Now, when the code is ready to be built and tested. - Select ''Build Project'' from ''Project'' menu.\\ {{:courses:b35apo:documentation:eclipse:21_build_project.png?200|Select ''Build Project'' from ''Project'' menu.}} - From ''Binaries'' subfolder of the project [right click] context menu select ''Run As -> Run Configurations''.\\ {{:courses:b35apo:documentation:eclipse:22_run_config.png?200|From ''Binaries'' subfolder of the project [right click] context menu select ''Run As -> Run Configurations''.}} - Select ''C/C++ Remote Application'' in left bar.\\ {{:courses:b35apo:documentation:eclipse:23_remote.png?200|From ''Binaries'' subfolder of the project [Right click] context menu select ''Run As -> Run Configurations''.}} - Click ''New...'' in ''Connection'' section.\\ {{:courses:b35apo:documentation:eclipse:24_rew_remote.png?200|Click ''New...'' in ''Connection'' section.}} Well... Now, it's the time, when **Jump and link (JAL)** instruction comes in handy. So just remember this position and focus on the different problem... ==== New connection ==== - Select ''SSH Only'' remote system type.\\ {{:courses:b35apo:documentation:eclipse:25_ssh.png?200|Select ''SSH Only'' remote system type.}} - Put ''IP ADDRESS'' of **YOUR BOARD**. There is chance less or equal to approximately 9% that it will work with the same IP address shown in the next picture. This chance drops to approximately 0.4% when DHCP server in KN:E-2 flush its DHCP binding table and to approximately 5.6 * 10^{-6} when your board is connected in local area network (LAN) different to KN:E-2.\\ {{:courses:b35apo:documentation:eclipse:26_ip.png?200|Put ''IP ADDRESS'' of **YOUR BOARD**.}} - Confirm new connection by ''Finish'' button.\\ {{:courses:b35apo:documentation:eclipse:27_finish_remote.png?200|Confirm new connection by ''Finish'' button.}} ==== jr $ra ==== This is where the [Build project] section was interrupted, now it's possible to continue. - Add //absolute path// for application, ''/tmp/project'' is recommended.\\ {{:courses:b35apo:documentation:eclipse:28_where_to_binary.png?200|Add //absolute path// for application, ''/tmp/applicationName'' is recommended.}} - Run created configuration.\\ {{:courses:b35apo:documentation:eclipse:29_run.png?200|Run created configuration.}} ==== SSH login ==== Connecting to [[courses:b35apo:documentation:mz_apo:start|MicroZed APO]] with proper username and key confirmation. - Type proper user ''root'', no password needed.\\ {{:courses:b35apo:documentation:eclipse:31_login.png?200|Type proper user ''root'', no password needed.}} - Confirm warning.\\ {{:courses:b35apo:documentation:eclipse:32_confirm_key.png?200|Confirm warning.}} - See the output in ''Console''.\\ {{:courses:b35apo:documentation:eclipse:33_finish.png?200|See the output in ''Console''.}}