<?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>Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/48702/raytac-mdbt50q-rx-dongle-nrf52840-led-problem</link><description>Hello! 
 I managed to flash my Raytac dongle with debugging going using the SWD on a nrf52 DK. I am mainly working with SEGGER Embedded Studio and nRF Connect on Mac. However, it seems any function from simple_hal simply won&amp;#39;t work... 
 I created a new</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 27 Jun 2019 08:12:27 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/48702/raytac-mdbt50q-rx-dongle-nrf52840-led-problem" /><item><title>RE: Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/thread/195044?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 08:12:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:f0da0854-02d7-425f-ad1e-039040b862e4</guid><dc:creator>Thierry</dc:creator><description>&lt;p&gt;yes. nrf5SDKforMeshv310src/examples/common/src/simple_hal.c&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/thread/195042?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 08:08:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fb2d0246-194f-4ab9-a34f-b0d58e86ae36</guid><dc:creator>awneil</dc:creator><description>[quote userid="79049" url="~/f/nordic-q-a/48702/raytac-mdbt50q-rx-dongle-nrf52840-led-problem/195029"]&lt;em&gt;simple_hal.c&lt;/em&gt; [/quote]
&lt;p&gt;Is that a Nordic SDK thing?&lt;/p&gt;
&lt;p&gt;EDIT&lt;/p&gt;
&lt;p&gt;Oh - it&amp;#39;s a &lt;em&gt;Mesh&lt;/em&gt; SDK thing.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/thread/195029?ContentTypeID=1</link><pubDate>Thu, 27 Jun 2019 07:53:05 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:302a6a8e-2602-46b2-84b8-c31802faaa58</guid><dc:creator>Thierry</dc:creator><description>&lt;p&gt;As I was saying, the&amp;nbsp;current &lt;em&gt;simple_hal.c&lt;/em&gt; is&amp;nbsp;incompatible with&amp;nbsp;the LED pins on the PCA10059.&lt;/p&gt;
&lt;pre&gt;#define LED1_G         NRF_GPIO_PIN_MAP(0,6)
#define LED2_R         NRF_GPIO_PIN_MAP(0,8)
#define LED2_G         NRF_GPIO_PIN_MAP(1,9)
#define LED2_B         NRF_GPIO_PIN_MAP(0,12)&lt;/pre&gt;
&lt;pre&gt;#define LED_1          LED1_G&lt;br /&gt;#define LED_2          LED2_R&lt;br /&gt;#define LED_3          LED2_G&lt;br /&gt;#define LED_4          LED2_B&lt;/pre&gt;
&lt;pre&gt;#define LED_START      LED_1
#define LED_STOP       LED_4&lt;/pre&gt;
&lt;p&gt;More exactly, the 3rd one won&amp;#39;t work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/thread/194210?ContentTypeID=1</link><pubDate>Mon, 24 Jun 2019 05:09:47 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ef77827b-bde7-407d-aaed-40075df3be1a</guid><dc:creator>Thierry</dc:creator><description>&lt;p&gt;Hello Vidar !&lt;/p&gt;
&lt;p&gt;I&amp;#39;m fully aware of that. That was a simple workaround not a solution.&lt;br /&gt;I ended up discarding that workaround&amp;#39;s changes and instead changing the code in simple_hal.c. Everywhere it had&amp;nbsp;NRF_GPIO, I changed it to something like:&lt;/p&gt;
&lt;pre&gt;#if LED_1&amp;lt;=32&lt;br /&gt;  NRF_GPIO-&amp;gt;OUT ^= m_blink_mask;&lt;br /&gt;#else&lt;br /&gt;  NRF_P1-&amp;gt;OUT ^= m_blink_mask;&lt;br /&gt;#endif&lt;/pre&gt;
&lt;p&gt;and readjust the pin in functions like the hal_leds_init function to:&lt;/p&gt;
&lt;pre&gt;for (uint32_t i = LED_START; i &amp;lt;= LED_STOP; ++i)
{
  #if LED_1&amp;lt;=32
    NRF_GPIO-&amp;gt;PIN_CNF[i] = LED_PIN_CONFIG;
    NRF_GPIO-&amp;gt;OUTSET = 1UL &amp;lt;&amp;lt; i;
  #else
    NRF_P1-&amp;gt;PIN_CNF[i-32] = LED_PIN_CONFIG;
    NRF_P1-&amp;gt;OUTSET = 1UL &amp;lt;&amp;lt; i-32;
  #endif
}&lt;/pre&gt;
&lt;p&gt;It is not perfect but, I believe, more appropriate. (It would cause problems again if we had a LED on&amp;nbsp;each port, the init function also seem to take for granted that the ports are not apart but one after the other...)&lt;br /&gt;and then boards.h functions like LEDS_OFF(BSP_LED_0_MASK); or LEDS_ON(BSP_LED_0_MASK); still use NRF_GPIO and won&amp;#39;t work. Although applying the same treatment should solve this too.&lt;/p&gt;
&lt;p&gt;I&amp;nbsp;feel like there is still something to be done to make this better, now that I&amp;#39;m looking at boards.h&amp;#39;s&lt;/p&gt;
&lt;pre&gt;#define PIN_MASK(_pin) (1u &amp;lt;&amp;lt; (uint32_t)((_pin) &amp;amp; (~P0_PIN_NUM)))&lt;/pre&gt;
&lt;p&gt;where&amp;nbsp;(uint32_t)((_pin) &amp;amp; (~P0_PIN_NUM)) returns 13 for the pin 45 (1,13). Basically what I was doing with the -32. I still don&amp;#39;t fully grasp the masks..&lt;/p&gt;
&lt;p&gt;I will keep looking at this when I have the time but for now this solved my problem.&lt;/p&gt;
&lt;p&gt;Thank you for your support!&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/thread/194002?ContentTypeID=1</link><pubDate>Fri, 21 Jun 2019 07:21:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:87230751-701d-45a4-812b-c4407667ec5d</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;This workaround may be problematic if you want to use port 0. I would&amp;nbsp;suggest to go over the project setup and compare it to a 52840 SDK project to find out why&amp;nbsp;the wrong header files are being included.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/thread/193769?ContentTypeID=1</link><pubDate>Thu, 20 Jun 2019 01:54:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2a085781-32b8-44ca-a278-cd7080766388</guid><dc:creator>Thierry</dc:creator><description>&lt;p&gt;My application is derived from a bunch of them. Mainly the light switch.&lt;br /&gt;&lt;br /&gt;I have found a little work around.&lt;br /&gt;In SDK_15.3.0/modules/mdk/nrf51_to_nrf52840.h line 144 :&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;/* GPIO */
/* GPIO port was renamed to P0. */
#ifndef NRF_GPIO
    #define NRF_GPIO        NRF_P0
#endif
#ifndef NRF_GPIO_BASE
    #define NRF_GPIO_BASE   NRF_P0_BASE
#endif&lt;/pre&gt;
&lt;p&gt;If I change p0 to p1,&lt;br /&gt;and also change my pin definition&amp;nbsp;(1,13) to&amp;nbsp;&lt;/p&gt;
&lt;pre&gt;NRF_GPIO_PIN_MAP(0,13)&lt;/pre&gt;
&lt;p&gt;Everything seems to work.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/thread/193664?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2019 12:22:56 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7e626a21-1e0c-49f5-9deb-94e425f99199</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Yes, seems like the project is not set up correctly for the 52840 which has 2&amp;nbsp;GPIO ports. The bit should have been written to NRF_P1, not NRF_GPIO. Are you testing this with a SDK example?&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/thread/193608?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2019 09:52:06 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:979d3a35-1595-4d6d-8092-e404e7783622</guid><dc:creator>Thierry</dc:creator><description>&lt;p&gt;So&amp;nbsp;we have&amp;nbsp;the pin (1,13) for this LED, which with the function&amp;nbsp;NRF_GPIO_PIN_MAP(1,13) translates to 45.&lt;/p&gt;
&lt;p&gt;Then,&amp;nbsp;in simple_hal.c in the function hal_leds_init :&lt;/p&gt;
&lt;pre&gt;NRF_GPIO-&amp;gt;OUTSET = 1UL &amp;lt;&amp;lt; i;&lt;/pre&gt;
&lt;p&gt;Which becomes&amp;nbsp;&lt;code&gt;&lt;span class="lit"&gt;00000000000000000000000000000001 &amp;lt;&amp;lt; 45;&lt;br /&gt;This&amp;nbsp;would&amp;nbsp;exceed the capacity and become&amp;nbsp;0. Am I right?&lt;br /&gt;&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;&lt;span class="lit"&gt;So the LED is never &amp;quot;initialized&amp;quot;?&lt;/span&gt;&lt;/code&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/thread/193597?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2019 09:03:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a31c010d-4152-4658-99f8-da0305e77c11</guid><dc:creator>Thierry</dc:creator><description>&lt;p&gt;Hello, thank you for your time.&lt;br /&gt;The hex file is working!&lt;/p&gt;
&lt;p&gt;However,&amp;nbsp;bsp_board_led_on() does not seem to be called. &lt;br /&gt;boards.c wasn&amp;#39;t even in my project nor the other mesh example projects...&lt;/p&gt;
&lt;p&gt;Calling the function in main, I actually found out that&lt;/p&gt;
&lt;pre&gt;bsp_board_led_off(LED_1);&lt;/pre&gt;
&lt;p&gt;turns the led on, and&lt;/p&gt;
&lt;pre&gt;bsp_board_led_on(LED_1);&lt;/pre&gt;
&lt;p&gt;turns the led off...&lt;/p&gt;
&lt;p&gt;Once again after&lt;/p&gt;
&lt;pre&gt;nrf_gpio_cfg_output(LED_1);&lt;/pre&gt;
&lt;p&gt;I am still looking into it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Raytac MDBT50Q-RX Dongle (nRF52840) LED problem</title><link>https://devzone.nordicsemi.com/thread/193582?ContentTypeID=1</link><pubDate>Wed, 19 Jun 2019 08:27:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:9c2b7c21-d851-4548-96d8-df6a809fb8a3</guid><dc:creator>Vidar Berg</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m not sure why it&amp;#39;s not working. The pin assignment seems to be correct since nrf_gpio_pin_write() works. Can you try to debug the app and&amp;nbsp;check whether&amp;nbsp;bsp_board_led_on() calls&amp;nbsp;nrf_gpio_pin_write() with the correct parameters? Also, try to program hex file attached below to see if it works. It&amp;#39;s using BSP to toggle the LED @ 1 s intervals.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/cfs-file/__key/support-attachments/beef5d1b77644c448dabff31668f3a47-c25bbd70e67a48deb8a05c833ee8649f/bsp_5F00_pca10056.hex"&gt;devzone.nordicsemi.com/.../bsp_5F00_pca10056.hex&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>