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/06 00:00] – 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/ | ||
| Line 30: | Line 30: | ||
| Remote Launch Targets Developer Resources | Remote Launch Targets Developer Resources | ||
| Terminal (Console) View Developer Resources | Terminal (Console) View Developer Resources | ||
| - | TM Terminal | ||
| </ | </ | ||
| 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 | + | |
| + | 3. Find your toolchain location and prefix and gdb executable. | ||
| + | |||
| + | Toolchain location is < | ||
| + | |||
| + | 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-> | On the main menu bar use File-> | ||
| - | Enter your toolchain location | + | 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 locally built toolchain this directory is | ||
| < | < | ||
| For the test system using the SDK toolchain this directory is | For the test system using the SDK toolchain this directory is | ||
| - | < | + | < |
| - | </ | + | |
| - | < | + | |
| - | + | ||
| - | mips-openwrt-linux-musl-</ | + | |
| 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 Tab expand the entry with your router' | + | Expand Remote Systems, select Remote Systems 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/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' | In the Enter Password dialog change the User ID to root, enter your router' | ||
| Line 77: | Line 94: | ||
| You can now browse the file system on your router in the Remote Systems tab. | You can now browse the file system on your router in the Remote Systems tab. | ||
| - | 6. Debugging on remote system | + | 7. Debugging on remote system |
| - | On the menubar Run-> | + | On the menubar |
| In the main tab: | 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 | |
| - | Enter the program name in the Remote | + | |
| - | In the debugger | + | Enter the program name in the Remote Absolute Path textbox, it must include a path (I use either /hellocpp or / |
| + | |||
| + | In the debugger | ||
| + | |||
| + | In the GDB debugger text box enter the gdb executable found in step 3 | ||
| - | In the GDB debugger text box enter the location of gdb in the toolchain location found in Step 3. | ||
| - | On the test system this is | ||
| - | / | ||
| - | |||
| Click Apply, Click Debug | 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 | + | 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 | ||