Hi Andrzej, > On Jan 20, 2017, at 2:19 PM, Andrzej Kaczmarek > <[email protected]> wrote: > > Hi all, > > I managed to find some time to write down a short tutorial (with pictures! > ;-) ) on how to use Eclipse as IDE for Mynewt. This is based on my own
Thanks! This is a huge help. We will point to it in the documentation as well. > experience and on what we use in our company with some "upgrades" after > reading through Chris' and Chew's posts. You can find tutorial here: > http://www.codecoup.pl/blog/hacking-mynewt-in-eclipse/ - it covers > configuration of indexer, builder and debugger. > > *IMPORTANT* > I use this setup on develop branch since this is what I work with. In > theory, it should also work on master but there are at least two known > problems: > 1. for some reason newt@master hangs when run from within Eclipse (stuck at > 100% CPU usage) and this basically makes it useless; the newt@develop works > just fine... > 2. compiler command line generated by newt@master includes only file name > of compiled file and this probably will confuse build output parser, but I > was not able to check it due to problem above; the newt@develop generates > nice command line with full path names > > BTW: would be really nice if newt has some option to print only executed > commands during build - this could be then used instead of '-l debug' which > produces huge amount of logs; I'd actually add this, but my go skills are > less than basic ;-) > I think that’s a useful addition - so I filed https://issues.apache.org/jira/browse/MYNEWT-553 <https://issues.apache.org/jira/browse/MYNEWT-553> thanks, aditi > BR, > Andrzej > > > On Thu, Jan 19, 2017 at 12:12 AM, Christopher Collins <[email protected]> > wrote: > >> Here are some of my notes for getting Mynewt to work with eclipse. I >> wrote these a while back, so there may be a few inaccuracies. Also, >> these notes assume you are building bletiny for the nRF52dk BSP, so you >> may need to adjust accordingly. >> >> Thanks, >> Chris >> >> *** Setup >> >> 1. Download Eclipse Neon (https://www.eclipse.org/downloads/). >> >> 2. Start Eclipse. >> >> 3. Eclipse -> Preferences -> C/C++ -> Environment; Add a "PATH" Variable >> with the value "/usr/local/bin" (or wherever arm-none-eabi-gdb is >> located on your machine). >> >> 4. In your newt project directory, overwrite >> repos/apache-mynewt-core/hw/bsp/nrf52dk/nrf52dk_debug.sh with the >> attached version. >> >> *** New project >> >> 5. File -> New -> New Project -> C/C++ -> C Project -> >> Makefile project -> Empty Project >> >> 6. Select "-- Other Toolchain --" in the Toolchains panel. >> >> 7. Type your project's name in the "Project name" field. >> >> 8. Select your newt project directory in the "Location" field. >> >> (see "new-project.png"). >> >> 9. Click Finish. >> >> *** Debug configuration >> >> 10. Right-click your project and select "Debug As..." -> >> "Debug Configurations". >> >> 11. Double click "C/C++ Remote Application" to create a new debug >> configuration. The new configuration should now be selected. >> >> 12. At the bottom of the window, you should see: "Using GDB (DSF) >> Automatic Remote Debugging Launcher - Select other...". Click the >> "Select other..." link. >> >> 13. Check "Use configuration specific settings" >> >> 14. Select "GDB (DSF) Manual Remote Debugging Launcher" >> >> (see "select-launcher.png"). >> >> 15. Click OK. >> >> 16. (Main tab) In the "C/C++ Application" field, select the .elf file >> corresponding to your newt target. >> >> 17. (Main tab) Check "Disable auto build" >> >> (see "debug-main.png"). >> >> 18. (Debugger, Main tab) In the "GDB debugger" field, type: >> arm-none-eabi-gdb >> >> (see "debug-debugger-main.png"). >> >> 19. (Debugger, Connection tab) In the "Port number" field, type: 3333 >> >> (see "debug-debugger-connection.png"). >> >> 20. Click Apply and Close. >> >> *** Debugging >> >> 21. In a shell, run "newt run <target-name> 0". JLinkGDBServer should >> start up and listen for a connection from gdb. >> >> 21. Select your project in the Project Explorer. >> >> 22. Click the icon with a picture of a bug. The debugger should start. >> >> 23. The board will be in a bad state and requires a reset. Type >> "monitor reset" in the Console pane >> >> (see "monitor-reset.png") >> >> 24. Click the Resume button (play button with a yellow rectangle on its >> left). The program should now halt at the start of main(). >>
