Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision Next revisionBoth sides next revision | ||
| inbox:eclipse [2020/04/05 19:01] – noblepepper | inbox:eclipse [2021/10/15 08:21] – ↷ Links adapted because of a move operation bobafetthotmail | ||
|---|---|---|---|
| Line 3: | Line 3: | ||
| When you develop a new program or adapt an existing program for use on OpenWrt a graphical ide like [[https:// | When you develop a new program or adapt an existing program for use on OpenWrt a graphical ide like [[https:// | ||
| - | This howto was was developed and tested on a fresh install of Debian 10 in VirtualBox, Eclipse Version: 2020-03 (4.15.0) and a Buffalo WZR-600DHP running OpenWrt 19.07.2 | + | This howto was was developed and tested on a fresh install of Debian 10 in VirtualBox, Eclipse Version: 2020-03 (4.15.0) and a Buffalo WZR-600DHP running OpenWrt 19.07.2. Minor changes may be needed to adapt it to your preferred systems. |
| The directory layout used was | The directory layout used was | ||
| Line 17: | Line 17: | ||
| 1. Get a functioning build system. | 1. Get a functioning build system. | ||
| - | You can use the [[docs/ | + | You can use the [[docs/ |
| and [[docs/ | and [[docs/ | ||
| 2. Install Eclipse | 2. Install Eclipse | ||
| - | Eclipse itself is simple to install, just download the installer from [[https:// | + | Eclipse itself is simple to install, just download the installer from [[https:// |
| - | + | ||
| You need to install some eclipse plugins, this is done through the Install New Software... entry on the Help menu. In the Available Software dialog, select --All Available Sites-- in the Work with dropbox and enter remote in the filter textbox. Now find and check | You need to install some eclipse plugins, this is done through the Install New Software... entry on the Help menu. In the Available Software dialog, select --All Available Sites-- in the Work with dropbox and enter remote in the filter textbox. Now find and check | ||
| < | < | ||
| Line 33: | Line 33: | ||
| Click Next twice, accept license terms and then click Finish. Allow eclipse to restart itself. | Click Next twice, accept license terms and then click Finish. Allow eclipse to restart itself. | ||
| - | 3. Cross compile hello world | ||
| - | On the main menu bar use File-> | + | 3. Find your toolchain location |
| - | Enter your toolchain | + | Toolchain |
| - | For the test system using the locally built toolchain this directory | + | |
| - | <code>/ | + | |
| - | <code>/ | + | |
| - | mips-openwrt-linux-musl-</ | + | Toolchain prefix is the part of the filenames in the toolchain directory before the tool name. For example, if you see a file named mips-openwrt-linux-musl-gcc, |
| + | |||
| + | The gdb executable is in the toolchain location. | ||
| + | |||
| + | You can find these by using these commands from the buildsystem root: | ||
| + | |||
| + | Toolchain location: | ||
| + | < | ||
| + | find $(pwd)/ | ||
| + | </ | ||
| + | Toolchain prefix: | ||
| + | < | ||
| + | find $(pwd)/ | ||
| + | </ | ||
| + | gdb executable: | ||
| + | < | ||
| + | find $(pwd)/ | ||
| + | 4. Cross compile hello world | ||
| + | |||
| + | On the main menu bar use File-> | ||
| + | |||
| + | Enter your toolchain location in the Cross compiler path textbox. | ||
| + | For the test system using the locally built toolchain this directory is | ||
| + | < | ||
| + | For the test system using the SDK toolchain this directory is | ||
| + | < | ||
| If you are still on the Welcome Screen, click the Workbench icon in the upper right. Select the project you just created and on the main menubar use Project-> | If you are still on the Welcome Screen, click the Workbench icon in the upper right. Select the project you just created and on the main menubar use Project-> | ||
| - | 4. Set up remote | + | 5. Set up remote |
| - | Select Window->Perspective->Open Perspective-> | + | Select Window->Show View->Others |
| - | + | ||
| - | Select Remote System Explorer from the dialog and click open. | + | |
| - | + | ||
| - | Select File-> | + | |
| - | + | ||
| - | Expand Remote System Explorer in the dialog, select Connection and click Next | + | |
| - | + | ||
| - | Select Linux and click next | + | |
| - | + | ||
| - | Enter your routers ipaddress in the Host name text box, click Next, | + | |
| - | + | ||
| - | Check the ssh.files checkbox, select SSH Connector Service, click Next, | + | |
| - | + | ||
| - | Check the processes.shell.linux checkbox, select Shell Process Service, click Next, | + | |
| - | + | ||
| - | Check the ssh.shells checkbox, select SSH Connector Service, and finally click Finish | + | |
| - | + | ||
| - | 5. Access files on remote system | + | |
| - | In the Remote Systems | + | Expand |
| - | In the Enter Password dialog change the User ID to root, enter your router' | + | Select File-> |
| + | Expand Remote System Explorer in the dialog, select Connection and click Next | ||
| + | Select Linux and click next | ||
| + | |||
| + | Enter your routers ipaddress in the Host name text box, click Next, | ||
| + | |||
| + | Check the ssh.files checkbox, select Ssh/Sftp File Service, click Next, | ||
| + | |||
| + | Check the processes.shell.linux checkbox, click Next, | ||
| + | |||
| + | Check the ssh.shells checkbox, and finally click Finish | ||
| + | |||
| + | 6. Access files on remote system | ||
| + | |||
| + | In the Remote Systems Tab expand the entry with your router' | ||
| + | |||
| + | In the Enter Password dialog change the User ID to root, enter your router' | ||
| + | |||
| + | You can now browse the file system on your router in the Remote Systems tab. | ||
| 7. Debugging on remote system | 7. Debugging on remote system | ||
| + | On the menubar use Run-> | ||
| + | |||
| + | In the main tab: | ||
| + | |||
| + | Click the New button next to the Connection Dropdown, use the dropdown to select ssh, Click OK | ||
| + | Enter your router' | ||
| + | Check password based checkbox, enter password in Password text box. Click Finish. | ||
| + | Select Remote Host in Connection Dropdown | ||
| + | |||
| + | Enter the program name in the Remote Absolute Path textbox, it must include a path (I use either /hellocpp or / | ||
| + | |||
| + | In the debugger tab: | ||
| + | |||
| + | In the GDB debugger text box enter the gdb executable found in step 3 | ||
| + | |||
| + | Click Apply, Click Debug | ||
| + | |||
| + | Allow the IDE to switch to the Debug perspective. The program will launch on the router and stop at the first line in main, you can step, continue, etc with the icons on the toolbar, the ide will follow in the source file tab and output will be shown in the Console tab. | ||
| + | | ||
| 8. Using existing makefile programs | 8. Using existing makefile programs | ||
| Line 80: | Line 120: | ||
| 10. Credits | 10. Credits | ||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| + | |||
| {{tag> | {{tag> | ||