<?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>Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/66301/bluetooth-bare-metal-implementation-without-binary-blob</link><description>Hello,

I have a question regarding the nRF5340 microcontroller or similar. Usually, when programming UART, I2C or SPI bare metal, one is using interrupts, register and buffers in RAM. Even more complex transmission channels such as ETH with the TCPIP</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 29 Sep 2020 08:52:52 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/66301/bluetooth-bare-metal-implementation-without-binary-blob" /><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271991?ContentTypeID=1</link><pubDate>Tue, 29 Sep 2020 08:52:52 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:40842e45-80f7-4230-bd9f-f073fa200e06</guid><dc:creator>Waldi1</dc:creator><description>&lt;p&gt;That&amp;#39;s the point with bare metal development. We do not want it simple way.&lt;/p&gt;
&lt;p&gt;&lt;span lang="en"&gt;We need a detailed description of the registers and how to initialize the module. That means which peripheral clock, which GPIOs in which order etc. &lt;/span&gt;&lt;span lang="en"&gt;Which interrupts are triggered when, how do you initialize DMA for the module.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="en"&gt;Understanding how the data flow is designed is also very important. &lt;/span&gt;&lt;span lang="en"&gt;You actually always understand this in the process when you read the register &lt;/span&gt;&lt;span lang="en"&gt;descriptions and examples, but it already existed before, when the developers &lt;/span&gt;&lt;span lang="en"&gt;wrote VHDL / Verilog, they had an idea of ​​how the module should work and how &lt;/span&gt;&lt;span lang="en"&gt;the interaction between PHY, registers, interrupts, DMA and memory is. Why not &lt;/span&gt;&lt;span lang="en"&gt;write it down?&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span lang="en"&gt;&lt;/span&gt;&lt;span lang="en"&gt;That&amp;#39;s what bare metal is about.&lt;/span&gt;&lt;span lang="en"&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271674?ContentTypeID=1</link><pubDate>Mon, 28 Sep 2020 07:42:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:3b909db8-32a7-4124-95b0-4455c5c6e063</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;@&lt;a href="https://devzone.nordicsemi.com/members/waldi1"&gt;Waldi1&lt;span&gt;&amp;nbsp;&lt;/span&gt;&lt;/a&gt;:&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You can check out the ble_app_uart example. It&amp;#39;s the quickest/easiest way to stream data over BLE.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271591?ContentTypeID=1</link><pubDate>Fri, 25 Sep 2020 18:10:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:b72809a7-64d4-4ce9-a1f1-b2082cf025f4</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;This where &lt;a href="https://github.com/IOsonata/IOsonata"&gt;IOsonata&lt;/a&gt;&amp;nbsp;library&amp;nbsp;comes into play. &amp;nbsp;It encapsulate the difficulties of the SDK to provide a simple way to write Bluetooth firmware. &amp;nbsp;Here is an example of how much code you need to write to advertise an incremental number every second. &amp;nbsp;The whole firmware code you need to write is 4 function calls and a configuration data. &amp;nbsp;More details on this &lt;a href="https://embeddedsoftdev.blogspot.com/2017/"&gt;blog page&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;pre class="ui-code" data-mode="c_cpp"&gt;/**-------------------------------------------------------------------------
@example	BleAdvertiser.cpp

@brief	BLE non-connectable advertiser

This demo show how to advertise an incremental counter in the manufacturer
specific data.  The counter increments every second.

@author	Hoang Nguyen Hoan
@date	Dec. 19, 2017

@license

MIT License

Copyright (c) 2017, I-SYST inc., all rights reserved

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the &amp;quot;Software&amp;quot;), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED &amp;quot;AS IS&amp;quot;, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

----------------------------------------------------------------------------*/
#include &amp;lt;string.h&amp;gt;

#include &amp;quot;app_util.h&amp;quot;

#include &amp;quot;istddef.h&amp;quot;
#include &amp;quot;ble_app.h&amp;quot;
#include &amp;quot;iopinctrl.h&amp;quot;

#define DEVICE_NAME                     &amp;quot;Advertiser&amp;quot;

#define APP_ADV_INTERVAL                MSEC_TO_UNITS(100, UNIT_0_625_MS)
#define APP_ADV_TIMEOUT_IN_SECONDS      MSEC_TO_UNITS(1000, UNIT_10_MS)

uint32_t g_AdvCnt = 0;

const BLEAPP_CFG s_BleAppCfg = {
	{ // Clock config nrf_clock_lf_cfg_t
#ifdef IMM_NRF51822
		NRF_CLOCK_LF_SRC_RC,	// Source RC
		1, 1, 0
#else
		NRF_CLOCK_LF_SRC_XTAL,	// Source 32KHz XTAL
		//NRF_CLOCK_LF_SRC_RC,
#ifdef NRF51
		0, 0, NRF_CLOCK_LF_XTAL_ACCURACY_20_PPM
#else
		0, 0, NRF_CLOCK_LF_ACCURACY_20_PPM
#endif
#endif
	},
	0,						// Number of central link
	1,						// Number of peripheral link
	BLEAPP_MODE_NOCONNECT,	// Connectionless beacon type
	DEVICE_NAME,			// Device name
	ISYST_BLUETOOTH_ID,		// PnP Bluetooth/USB vendor id
	1,                      // PnP Product ID
	0,						// Pnp prod version
	false,					// Enable device information service (DIS)
	NULL,					// Pointer device info descriptor
	(uint8_t*)&amp;amp;g_AdvCnt,   	// Manufacture specific data to advertise
	sizeof(g_AdvCnt),      	// Length of manufacture specific data
	NULL,
	0,
	BLEAPP_SECTYPE_NONE,    // Secure connection type
	BLEAPP_SECEXCHG_NONE,   // Security key exchange
	NULL,      				// Service uuids to advertise
	0, 						// Total number of uuids
	APP_ADV_INTERVAL,       	// Advertising interval in msec
	APP_ADV_TIMEOUT_IN_SECONDS,	// Advertising timeout in sec
	0,							// Slow advertising interval, if &amp;gt; 0, fallback to
								// slow interval on adv timeout and advertise until connected
	0,		// Min. connection interval
	0,		// Max. connection interval
	-1,		// Led port nuber
	-1,		// Led pin number
	0,
	0,		// Tx power
	NULL	// RTOS Softdevice handler
};

void BlePeriphEvtUserHandler(ble_evt_t * p_ble_evt)
{
}

void BleAppAdvTimeoutHandler()
{
	g_AdvCnt++;

	BleAppAdvManDataSet((uint8_t*)&amp;amp;g_AdvCnt, sizeof(g_AdvCnt), NULL, 0);
	BleAppAdvStart(BLEAPP_ADVMODE_FAST);
}

int main()
{
    BleAppInit((const BLEAPP_CFG *)&amp;amp;s_BleAppCfg, true);

    BleAppRun();

	return 0;
}
&lt;/pre&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271587?ContentTypeID=1</link><pubDate>Fri, 25 Sep 2020 17:50:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:7138079b-6cbc-4912-b2bd-e700c42118bd</guid><dc:creator>Andres</dc:creator><description>&lt;p&gt;For those of us that prefer bare metal, Nordic has provided the &amp;quot;nrfx&amp;quot; modules. These headers and source files help a lot to get code up and running with minimal bloat. I wish the same concept can be applied when writing a Bluetooth application. In the case of a Bluetooth application you want to start with one of the Nordic examples and pair it&amp;nbsp; down to the essentials. Unfortunately, this is extremely difficult since the examples are really tied to almost every part of the SDK. The file dependencies get out of hand quickly and then you spend days just to get the basic example running in your code base.&lt;/p&gt;
&lt;p&gt;In my view the SDK and its examples are good to get you started with nice looking demos but when you really try to do production code ... well good luck.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271307?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 11:33:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:969196ad-281a-4dce-af75-2ac663cecfe6</guid><dc:creator>haakonsh</dc:creator><description>[quote user="Waldi1"] Is it due to hardware errors that are fixed within Blops?[/quote]
&lt;p&gt;That is often the case, but there&amp;#39;s also the fact that silicon vendors have implemented proprietary [read secret] features that would be exposed by an open source stack.&amp;nbsp;&lt;br /&gt;A BLE stack also has to be&amp;nbsp;tested and qualified. Each release of our SoftDevice has gone through extensive integration, regression, and conformance testing, to the point that you&amp;#39;d need a prohibitive amount of resources to even come close to the code quality. It&amp;#39;s also already optimized for speed and size, again, to the point where it really makes no sense to re-do it.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;You can ofc use the Zephyr BLE controller, that way you have full control, but at the cost of code quality.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;With the nRF53 you have the option of running the BLE controller and host on the network core. If you can accept a binary blob in the BLE controller on the network core, you have the whole application core to yourself. You don&amp;#39;t need to run zephyr on it, you&amp;#39;d only need to implement the application side of the &lt;a href="https://infocenter.nordicsemi.com/topic/ps_nrf5340/ipc.html?cp=3_0_0_6_15"&gt;IPC — Interprocessor communication&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271287?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 10:16:15 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:ddccb081-68fd-4547-8068-255a97cd2ee3</guid><dc:creator>Waldi1</dc:creator><description>&lt;p&gt;Because until now I wrote SENT, SPI, UART, I2C, USB and ETH bare metal. I would like to keep it that way, if possible, to have full control of size and speed of a firmware, even by inserting ASM code. &lt;br /&gt;I don&amp;#39;t understand why the vendor locks the hardware interface that way (not NordSemi, it looks promising, but until now I found all other vendors have only binary blobs, especially for WiFi). Is it due to hardware errors that are fixed within Blops?&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271274?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 09:40:18 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:8bc1bb26-0d55-4136-a8aa-327060589876</guid><dc:creator>haakonsh</dc:creator><description>&lt;p&gt;Why can&amp;#39;t you use nordic&amp;#39;s BLE controller &amp;#39;blob&amp;#39;?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;Do you insight into the inner workings of the stack, if so, why?&lt;br /&gt;&lt;br /&gt;Is it size limitations?&amp;nbsp;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271256?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 08:42:30 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:26166d3a-4855-44fc-99ed-a67a372163bb</guid><dc:creator>Waldi1</dc:creator><description>&lt;pre class="tw-data-text tw-text-large XcVN5d tw-ta" id="tw-target-text" dir="ltr"&gt;&lt;span lang="en"&gt;Thank you for the answers. &lt;br /&gt;Building a bluetooth stack is not a primary goal, you recognized that correctly. &lt;br /&gt;I have a climatic chamber and a rotation rate table on which sensors are to be tested. &lt;br /&gt;The idea was to avoid the slip rings and transfer the data wirelessly. &lt;br /&gt;Maybe the bluetooth stack is more complicated than TCPIP (I&amp;#39;ve implemented a simple one here, too). &lt;br /&gt;The idea of ​​simply taking RADIO and implementing your own transmission is great. &lt;br /&gt;Disadvantage: you can no longer visualize the data on a cell phone.&lt;/span&gt;&lt;/pre&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271241?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 07:44:24 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:46bd9246-d9d4-401d-b8c6-bdd2af53b08c</guid><dc:creator>Hugo Habicht</dc:creator><description>&lt;p&gt;Hi&amp;nbsp;Nguyen,&lt;span class="user-name"&gt; &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;thank you very much for the link, we were not aware that alternatives to that nordic sdk exists! Will certainly look into that.&lt;/p&gt;
&lt;p&gt;And thank you for the hint with the nRF53 software, we will stay well clear of those devices in the future. I think the nRF52 is a nightmare already, totally bloated and simple things made complicated. The hoops you have to jump through to get a simple I2C sensor connected is unbelievable. To quote Donald Knuth: &amp;quot;They could have done better&amp;quot;.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271229?ContentTypeID=1</link><pubDate>Thu, 24 Sep 2020 07:12:20 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:4bf7285d-b886-40d3-b7cc-08f83240bc85</guid><dc:creator>haakonsh</dc:creator><description>[quote user=""]However, I would really like to recreate the Bluetooth stack with interrupts and registers. [/quote]
&lt;p&gt;I strongly advice you not to attempt to create your own bluetooth stack. It requires a lot of engineering resources to create a proper one.&amp;nbsp;&lt;br /&gt;&lt;br /&gt;If however you&amp;#39;re interested in creating a proprietary protocol using the 2.4GHz RADIO peripheral you&amp;#39;re looking at a much easier goal. You can study the sample in NCS/nrf/samples/peripheral/radio_test.&lt;br /&gt;&lt;br /&gt;-edit:&lt;br /&gt;You can take a look at zephyr&amp;#39;s BLE controller, it&amp;#39;s open source, but lacks optimizations for the nRF series RADIO. Also the SoftDevice contains radio optimizations that are not available to the public.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271194?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2020 20:36:42 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6f6abbad-6a08-4787-af0e-dae9847821b9</guid><dc:creator>Nguyen Hoan Hoang</dc:creator><description>&lt;p&gt;Yes, it is possible. &amp;nbsp;The &lt;a href="https://github.com/IOsonata/IOsonata"&gt;IOsonata&lt;/a&gt; library did implement bare metal drivers more performance and simple to use than the SDK without all precompile hard coded defines jungle. &amp;nbsp;It can be used with or without softdevice. &amp;nbsp;The radio part however is not documented but you can have a look at the ESB and Gazell code in the SDK. It is recommended to use softdevice for the Bluetooth stack because it is certified. You can bypass the SDK completely and talk directly to the softdevice instead. &amp;nbsp;It gets worst when comes to the nRF53 series which forced you to use nRFConnect SDK Zephyr which is a nightmare. &amp;nbsp;Not only you got those defines jungle, there are also toolchain jungle and scripts jungle too.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Bluetooth bare metal implementation without binary blob</title><link>https://devzone.nordicsemi.com/thread/271188?ContentTypeID=1</link><pubDate>Wed, 23 Sep 2020 18:53:27 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:2f49973e-49d1-46b1-8cbd-d8e1586045ab</guid><dc:creator>Hugo Habicht</dc:creator><description>&lt;p&gt;Hi Waldil.&lt;/p&gt;
&lt;p&gt;I often think the same way when I see this Microsoft style SDK bloatware with thousands of functions, structures, parameters, constants (and not to forget all those lovely and totally useless, confusing and C-code obfuscating macros) that nobody needs where you can spend a day trying to get something working that you could write yourself in much less than 1..2 hours...&lt;/p&gt;
&lt;p&gt;But I think what you are trying to do is not possible. As far as I understand the radio portion of the ICs is a hardware black box with another software black box called &amp;quot;softdevice&amp;quot; to interface with it. That is Nordic IP that they don&amp;#39;t publish. I am not aware that radio register documentation is available. Maybe there is a low level access possible to the softdevice (read softdevice documentation) where you can implement the bluetooth protocol yourself. Not sure though why you&amp;#39;d want to do that apart from educational exercise.&lt;/p&gt;
&lt;p&gt;Regards,&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>