<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://devzone.nordicsemi.com/cfs-file/__key/system/syndication/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/62446/getting-started-with-a-custom-nrf9160-board-and-eclipse-ide-instead-of-segger</link><description>We just received a batch of custom boards containing the nRF9160. I would like to test them and start developing our actual application. 
 So far I have switched SW11 to match the DK voltage with our board voltage, and connected the P22 Debug Out to our</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 15 Jun 2020 08:54:21 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/62446/getting-started-with-a-custom-nrf9160-board-and-eclipse-ide-instead-of-segger" /><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254920?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 08:54:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9e9d944f-b291-4176-81c3-5c183a0ced87</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="MaikASB"]Currently I am still getting errors saying that it can&amp;#39;t find types / functions declared in those header files, but if I open the header file, they are there. Any tips on this?[/quote]
&lt;p&gt;That sounds like a indexing problem within eclipse. I&amp;#39;m not that familiar with eclipse, but have to regenerated the index after adding files?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="MaikASB"]Also, any thoughts on how I can flash and debug from within Eclipse?[/quote]
&lt;p&gt;This is where it will be a bit complicated, and we do not have a guide on this, unfortunately.&lt;/p&gt;
&lt;p&gt;Did you look into the zephyr plugin? It seems to have a section on hardware debugging:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/eclipse-plugin#debugging-on-hardware"&gt;https://github.com/zephyrproject-rtos/eclipse-plugin#debugging-on-hardware&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can start the debugger via &amp;quot;west debug&amp;quot;, or command line:&lt;/p&gt;
&lt;p&gt;JLinkGDBServer -if swd -device nrf9160_xxaa&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Your .gdbinit should autoconnect if you add these commands:&lt;/p&gt;
&lt;p&gt;target remote localhost:2331&lt;/p&gt;
&lt;p&gt;load&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;But; note that if you have a multi-image build, like all project for nrf9160 are, you should first load the merged.hex file, to get SPM and other multi-build images (mcuboot for instance) loaded to flash.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254911?ContentTypeID=1</link><pubDate>Mon, 15 Jun 2020 08:26:04 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fff18c12-ac5f-493e-a77e-0933a15c0d8f</guid><dc:creator>newUser</dc:creator><description>&lt;p&gt;Hi H&amp;aring;kon, hope you had a good weekend,&lt;/p&gt;
&lt;p&gt;So far I can build via Eclipse, after adding the west build commands to it.&lt;br /&gt;I got some errors about include files it couldn&amp;#39;t find, so I added those paths to the include paths.&lt;/p&gt;
&lt;p&gt;Currently I am still getting errors saying that it can&amp;#39;t find types / functions declared in those header files, but if I open the header file, they are there. Any tips on this?&lt;/p&gt;
&lt;p&gt;Also, any thoughts on how I can flash and debug from within Eclipse?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254716?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2020 12:05:33 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:c4703b79-9e2d-4ccb-93ae-7f2104671b56</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>[quote user="MaikASB"]Awesome, thank you. I will go through the steps and let you know if I got it working![/quote]
&lt;p&gt;Just let me know if anything&amp;nbsp;pops up!&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not very familiar with eclipse, but I think most of the things related to building and so-forth should be quite OK to setup. Debug setup might be a bit more challenging.&lt;/p&gt;
&lt;p&gt;I see there is a helper plugin (I personally haven&amp;#39;t tested) that might be beneficial to look at&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/zephyrproject-rtos/eclipse-plugin"&gt;https://github.com/zephyrproject-rtos/eclipse-plugin&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&lt;/p&gt;
[quote user="MaikASB"]By the way, I must say that I&amp;#39;m quite happy with the support you are offering, phenomenal response times.[/quote]
&lt;p&gt;I&amp;#39;m glad to hear.&lt;/p&gt;
&lt;p&gt;We usually respond within 24 hours, but&amp;nbsp;we tend to&amp;nbsp;respond&amp;nbsp;quicker&amp;nbsp;when the time zones align.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254699?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2020 11:33:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e57d706f-9b81-4b03-9160-7df6f8883b7b</guid><dc:creator>newUser</dc:creator><description>&lt;p&gt;Awesome, thank you. I will go through the steps and let you know if I got it working!&lt;/p&gt;
&lt;p&gt;By the way, I must say that I&amp;#39;m quite happy with the support you are offering, phenomenal response times.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254697?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2020 11:29:14 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2090e4d6-416c-494e-b67b-0e71e0b47dfd</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Yes, that is correct, this should then create a workspace for eclipse cdt.&lt;/p&gt;
&lt;p&gt;&amp;quot;ninja flash&amp;quot; from the build directory will flash the device, so you can setup that as a custom command to flash from eclipse cdt if you want.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254691?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2020 11:19:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:18971a54-7048-4d14-a15b-3a27d92b87b1</guid><dc:creator>newUser</dc:creator><description>&lt;p&gt;Hi H&amp;aring;kon,&lt;/p&gt;
&lt;p&gt;If I understand correctly, to use Eclipse, I should:&lt;br /&gt;- Follow the &amp;quot;Installing the nRF Connect SDK manually&amp;quot; page to get all the necessary tools and settings (I already have the Desktop app and SES)&lt;br /&gt;- Install Eclipse&lt;br /&gt;- Get Eclipse CDT&lt;br /&gt;- Import a project in Eclipse, and edit it for example&lt;br /&gt;- Build with the cmake + eclipse CDT command you provided&lt;br /&gt;- Flash from command line, as explained in the nRF Connect SDK guide&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254624?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2020 08:31:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c8064ab-c7b9-4ff1-9443-6c7051d7eadf</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;I&amp;#39;m glad to hear. Hope you have a nice weekend!&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheers,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254618?ContentTypeID=1</link><pubDate>Fri, 12 Jun 2020 08:00:07 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:e49ce1d6-1235-4d4a-84f3-8efcd36924b8</guid><dc:creator>newUser</dc:creator><description>&lt;p&gt;Thank you H&amp;aring;kon, this helped me grow my understanding a lot. Currently I have several GPIOs working, some with callbacks.&lt;/p&gt;
&lt;p&gt;So this part of my thread is solved!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254545?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 14:56:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6262e90e-8401-4816-9177-07dc45b326e9</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="MaikASB"]What is the difference between doing this, versus using an overlay?[/quote]
&lt;p&gt;Its two ways of doing the same thing.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Doing your own board means patching (in this case, adding) &amp;quot;ncs/nrf/boards/&amp;quot; folder, or &amp;quot;ncs/zephyr/boards&amp;quot; with a new board, &amp;quot;nrf9160_myboard&amp;quot; for instance.&lt;/p&gt;
&lt;p&gt;This is a change outside of the scope of the application itself.&lt;/p&gt;
&lt;p&gt;Doing an overlay on nrf9160_pca10090 (or nrf9160dk_nrf9160, as of ncs v1.3.0) on a specific application is then contained to that application. So if you want to share this with a colleague or someone else, the pin re-definition is already in that specific example.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;However; if you are&amp;nbsp;planning on doing multiple applications, then its likely easier just to create the board, as it isn&amp;#39;t always fun to copy overlay files into each project you&amp;#39;re running.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Cheerse,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254539?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 14:41:23 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4631c859-5744-4f81-8e40-3da49577efec</guid><dc:creator>newUser</dc:creator><description>&lt;p&gt;Thank you for your answer. Though, our system is a little more complex than just LED blinking. It would probably be better to use an RTOS.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254537?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 14:40:34 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:77258d1d-04a7-4d3b-8b71-fa1f79c18421</guid><dc:creator>newUser</dc:creator><description>&lt;p&gt;Thank you H&amp;aring;kon, for your great response time and thorough answer!&lt;/p&gt;
&lt;p&gt;So far I got the LEDs working. Indeed, I experience problems with re-mapping the UART, which is probably due to what you described. Currently I am trying to adapt the Device Tree. What is the difference between doing this, versus using an overlay?&lt;/p&gt;
&lt;p&gt;I will look at your answer about Eclipse later this week.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254481?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 12:15:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6058a2d2-86f3-4c29-af0c-9d8fce709aae</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;If you like bare metal led blinking and use eclipse, try the IOsoanta library. &amp;nbsp;&lt;a href="https://github.com/IOsonata/IOsonata"&gt;https://github.com/IOsonata/IOsonata&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;It has ready made Eclipse native project for LED blinking and drivers for UART, SPI, I2C as well. &amp;nbsp;No Zephyr in your legs, no board to define. Just give it the pins numbers you want to use. &amp;nbsp;Complete board independent and rtos independent.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;The nRF91 target is in ARM/Nordic/nRF91&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Getting started with a custom nRF9160 board and Eclipse IDE instead of SEGGER</title><link>https://devzone.nordicsemi.com/thread/254421?ContentTypeID=1</link><pubDate>Thu, 11 Jun 2020 09:47:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:1fdf6867-6838-4655-98fa-6cafd522a025</guid><dc:creator>H&amp;#229;kon Alseth</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]- &lt;strong&gt;Can I use Eclipse instead of SEGGER?&lt;/strong&gt;[/quote]
&lt;p&gt;Yes, but not as a managed project (ie: eclipse building natively).&lt;/p&gt;
&lt;p&gt;These are the generators that cmake v3.16.3 supports:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;Generators
* Unix Makefiles               = Generates standard UNIX makefiles.
  Green Hills MULTI            = Generates Green Hills MULTI files
                                 (experimental, work-in-progress).
  Ninja                        = Generates build.ninja files.
  Watcom WMake                 = Generates Watcom WMake makefiles.
  CodeBlocks - Ninja           = Generates CodeBlocks project files.
  CodeBlocks - Unix Makefiles  = Generates CodeBlocks project files.
  CodeLite - Ninja             = Generates CodeLite project files.
  CodeLite - Unix Makefiles    = Generates CodeLite project files.
  Sublime Text 2 - Ninja       = Generates Sublime Text 2 project files.
  Sublime Text 2 - Unix Makefiles
                               = Generates Sublime Text 2 project files.
  Kate - Ninja                 = Generates Kate project files.
  Kate - Unix Makefiles        = Generates Kate project files.
  Eclipse CDT4 - Ninja         = Generates Eclipse CDT 4.0 project files.
  Eclipse CDT4 - Unix Makefiles= Generates Eclipse CDT 4.0 project files.
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;You can generate a build with eclipse cdt4 project files using cmake:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;cd samples/nrf9160/my_project/
mkdir build &amp;amp;&amp;amp; cd build
cmake .. -DBOARD=my_board -G&amp;quot;Eclipse CDT4 - Ninja&amp;quot;&lt;/pre&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user=""]- &lt;strong&gt;How to define our custom board so I can e.g. blink its LEDs?&lt;/strong&gt;[/quote]
&lt;p&gt;Unfortunately, we do not have a guide on creating your own board yet, or any easier way to modify peripheral configuration.&lt;/p&gt;
&lt;p&gt;There is a board porting guideline in zephyr:&amp;nbsp;&lt;a href="https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/porting/board_porting.html#board-porting-guide"&gt;https://developer.nordicsemi.com/nRF_Connect_SDK/doc/latest/zephyr/guides/porting/board_porting.html#board-porting-guide&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To configure and control a GPIO using the zephyr gpio driver, you do not really need to setup the LED in DTS. You can change the define to any unused GPIO that you have available, for instance by changing the define LED to 10 here:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-zephyr/blob/v2.1.99-ncs1/samples/basic/blinky/src/main.c#L12"&gt;https://github.com/nrfconnect/sdk-zephyr/blob/v2.1.99-ncs1/samples/basic/blinky/src/main.c#L12&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you need to do some more advance things, like changing the uart pinout, enabling more peripherals or similar, I would recommend overlaying based on the board you&amp;#39;re using:&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;To override the default pin configuration for board nrf9160_pca10090ns (or nrf9160dk_nrf9160ns as its been renamed to now in ncs v1.3.0), it requires changing both the CMakelist.txt file for the specific project (due to multi-image building, spm/mcuboot/application in one), as well as providing a $(board).overlay file.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;If you in your CMakeLists.txt file, just below the &amp;quot;cmake_minimum_required()&amp;quot; line, add this:&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/spm.conf&amp;quot;)
  set(spm_CONF_FILE
    prj.conf
    ${CMAKE_CURRENT_LIST_DIR}/spm.conf
  )
endif()

 

if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/mcuboot.conf&amp;quot;)
  set(mcuboot_CONF_FILE
    prj.conf
    ${CMAKE_CURRENT_LIST_DIR}/mcuboot.conf
  )
endif()

 

if (EXISTS &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/${BOARD}.overlay&amp;quot;)
  set(mcuboot_DTC_OVERLAY_FILE &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/${BOARD}.overlay&amp;quot;)
  set(spm_DTC_OVERLAY_FILE &amp;quot;${CMAKE_CURRENT_SOURCE_DIR}/${BOARD}.overlay&amp;quot;)
endif()&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;This will allow you to override mcuboot and spm configurations by inputting these in &amp;quot;my_application/mcuboot.conf&amp;quot; file and &amp;quot;my_application/spm.conf&amp;quot;.&lt;/p&gt;
&lt;p&gt;An overlay file, describing the pin information and status of a peripheral, can be done like this in the application overlay file, where uart2 is used, and chosen as the bluetooth hci uart:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://github.com/nrfconnect/sdk-nrf/blob/master/samples/nrf9160/lte_ble_gateway/nrf9160dk_nrf9160ns.overlay"&gt;https://github.com/nrfconnect/sdk-nrf/blob/master/samples/nrf9160/lte_ble_gateway/nrf9160dk_nrf9160ns.overlay&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;You can also copy certain things, like the LED definition from the nrf9160_pca10090 main dts definition, into this file and modify accordingly.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Kind regards,&lt;/p&gt;
&lt;p&gt;Håkon&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>