<?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>Programming MDBT42-Q (nRF52832) to use BLE</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/53067/programming-mdbt42-q-nrf52832-to-use-ble</link><description>Hi everyone, I have been using for a while the Adafruit nRF52 Feather board, programming BLE related apps using the Arduino IDE using the Bluefruit library for BLE. 
 I wanted to implement the same kind of solutions in a custom board, using the same module</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Thu, 10 Oct 2019 13:36:39 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/53067/programming-mdbt42-q-nrf52832-to-use-ble" /><item><title>RE: Programming MDBT42-Q (nRF52832) to use BLE</title><link>https://devzone.nordicsemi.com/thread/214398?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 13:36:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2ad23023-ec34-40a2-bea9-2d97261fa8fa</guid><dc:creator>googx</dc:creator><description>&lt;p&gt;Thank you Edvin, you have been great. All the best,&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Gu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming MDBT42-Q (nRF52832) to use BLE</title><link>https://devzone.nordicsemi.com/thread/214397?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 13:33:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b7e0806f-24d7-4ed1-be05-e7dab31c1892</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;That is at least the common way for non-arduino compatible board.&lt;/p&gt;
&lt;p&gt;I am not familiar with the arduino libraries. They do not come from us, so again, I believe you have to ask in an Arduino forum if you have questions regarding these libraries.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;If you are interrested in using the SDK, there are some tutorials on how to get started. I can recommend these:&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-advertising-a-beginners-tutorial" rel="noopener noreferrer" target="_blank"&gt;Getting started with BLE: Advertising&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-services-a-beginners-tutorial"&gt;&lt;span&gt;Getting started with BLE: Services&lt;/span&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;a href="https://devzone.nordicsemi.com/nordic/short-range-guides/b/bluetooth-low-energy/posts/ble-characteristics-a-beginners-tutorial" rel="noopener noreferrer" target="_blank"&gt;Getting started with BLE:&amp;nbsp;Characteristics&lt;/a&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;(in that order).&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming MDBT42-Q (nRF52832) to use BLE</title><link>https://devzone.nordicsemi.com/thread/214390?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 13:25:09 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:30bac234-82d7-4621-9aa3-0351f84f07e2</guid><dc:creator>googx</dc:creator><description>&lt;p&gt;Thank you Edvin. So Adafruit has this board (Adafruit Feather nRF52) that embed the module MDBT42-Q and now I understand the key-matter, thank you for the explanation. The soft device is the S132, the same that is in the adafuit board according to what I found. When I run the BLE code I don&amp;#39;t get any messages, but the code get stuck in the setup function, in the line &amp;quot;ledPeripheral.begin();&amp;quot;, setting up the device. I think the best thing to do would then be using the Nordic SDK to program this module am I correct?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Thank you in advance, best,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Gu&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming MDBT42-Q (nRF52832) to use BLE</title><link>https://devzone.nordicsemi.com/thread/214384?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 13:17:44 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b0288665-3491-4eb0-af6e-500bc2f43e69</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I don&amp;#39;t know if the bootloader that the Arduino IDE uses is the same that is found in our SDK. What bootloader did you upload by the way? The bootloaders (at least from the SDK versions the last 2-3 years) are signed bootloaders, meaning they will only accept DFU files that are signed with the correct key. I don&amp;#39;t know, but I suspect that the Arduino IDE has it&amp;#39;s own private keys, if they at all use the bootloader from our SDK.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
[quote user="googx"] but if I try to use the library BLEPeripheral it doesn&amp;#39;t work, i.e.&amp;nbsp;[/quote]
&lt;p&gt;&amp;nbsp;Can you please describe what you mean by &amp;quot;doesn&amp;#39;t work&amp;quot;? When you compile it, what sort of file do you get? An &amp;quot;.ino&amp;quot; file? And how do you program that to the custom board? Through the Arduino IDE?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;To be honest, I think it will be difficult to program an application written in the adruino language to a non-arduino compatible board. If so, you will need to ask Arduino (the people providing the IDE) how they upload the files to their boards. I don&amp;#39;t think they have a debugger on board, so I believe they use some kind of bootloader, but which one, I don&amp;#39;t know.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Edvin&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming MDBT42-Q (nRF52832) to use BLE</title><link>https://devzone.nordicsemi.com/thread/214355?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 12:10:45 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:11dfc754-ebce-495f-9eb2-135532651e60</guid><dc:creator>googx</dc:creator><description>&lt;p&gt;Hi Edvin, I imagined this could have been the problem. But if I upload the code:&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;void setup() {
  Serial.begin(115200);
  pinMode(19, OUTPUT); // Led 
}

void loop() {
  digitalWrite(19, HIGH);   
  delay(100);                       
  digitalWrite(19, LOW);   
  delay(100);                       
}&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;Using the Arduino IDE I can actually see the led blinking, but if I try to use the library BLEPeripheral it doesn&amp;#39;t work, i.e.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="text"&gt;#include &amp;lt;Arduino.h&amp;gt;
#include &amp;lt;SPI.h&amp;gt;
#include &amp;lt;BLEPeripheral.h&amp;gt;

BLEPeripheral ledPeripheral = BLEPeripheral();

BLEService ledService = BLEService(&amp;quot;19b10000e8f2537e4f6cd104768a1214&amp;quot;);
BLECharCharacteristic ledCharacteristic = BLECharCharacteristic(&amp;quot;19b10001e8f2537e4f6cd104768a1214&amp;quot;, BLERead | BLEWrite);

void setup()
{
  pinMode(19, OUTPUT);
  digitalWrite(19, LOW);
  ledPeripheral.setAdvertisedServiceUuid(ledService.uuid());
  ledPeripheral.addAttribute(ledService);
  ledPeripheral.addAttribute(ledCharacteristic);
  ledPeripheral.setLocalName(&amp;quot;Nordic NRF52 DK&amp;quot;);
  ledPeripheral.begin();
}

void loop()
{
  digitalWrite(19, HIGH);
  BLECentral central = ledPeripheral.central();
  &lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;BTW Bootloader and soft device are installed on the module through the nRF52 DK. What would you suggest if this is not actually supported to program the module to read and write on characteristic using BLE?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you in advance Edvin. Best,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Gu&lt;/p&gt;
&lt;p style="padding-left:30px;"&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Programming MDBT42-Q (nRF52832) to use BLE</title><link>https://devzone.nordicsemi.com/thread/214340?ContentTypeID=1</link><pubDate>Thu, 10 Oct 2019 11:15:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:a4933c14-b84c-417a-907d-2d36589a63c9</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello Gu,&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t think you can use Arduino IDE on our chips by default. If you want to know how it works, you will have to ask Arduino, as far as I know.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;What files did you try to upload using nRFgo Studio?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;I believe that when you program the Feather board using the Arduino IDE, it uses a custom bootloader, which we don&amp;#39;t have access to.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>