<?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>Arduino Nano 33 BLE (nRF52840) seems not to run on max. clock speed</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/60565/arduino-nano-33-ble-nrf52840-seems-not-to-run-on-max-clock-speed</link><description>We&amp;#39;re porting over some software to the Arduino Nano 33 BLE Sense. This board comes with an nRF52840 clocked at a max. of 64MHz. However, the same code runs about 2x slower on this board than on the ST L475VG platform, which also spans a Cortex-M4F (running</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Mon, 27 Apr 2020 10:28:26 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/60565/arduino-nano-33-ble-nrf52840-seems-not-to-run-on-max-clock-speed" /><item><title>RE: Arduino Nano 33 BLE (nRF52840) seems not to run on max. clock speed</title><link>https://devzone.nordicsemi.com/thread/246758?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 10:28:26 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:fdb2de9a-59b3-4451-837f-913603867e9d</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;I found this ticket:&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/45241/nrf52-fpu-single-precision-floating-point---gcc-compiler-flags"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/45241/nrf52-fpu-single-precision-floating-point---gcc-compiler-flags&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;So you could try to experiment with the mentioned compiler flags.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Could you also try to run the matrix code from flash with the cache enabled,&amp;nbsp;&lt;a href="https://devzone.nordicsemi.com/f/nordic-q-a/14420/nrf52-cache"&gt;https://devzone.nordicsemi.com/f/nordic-q-a/14420/nrf52-cache&lt;/a&gt;.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Arduino Nano 33 BLE (nRF52840) seems not to run on max. clock speed</title><link>https://devzone.nordicsemi.com/thread/246693?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 08:00:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:230c82de-611e-4ac4-aeae-f33e3629d37f</guid><dc:creator>janjongboom</dc:creator><description>&lt;p&gt;Thanks Bjorn, Arduino was pointing me in the direction of the ART as well. I&amp;#39;ve ordered a nRF52-DK and will do some experiments on that with the Nordic SDK in the next few days.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Arduino Nano 33 BLE (nRF52840) seems not to run on max. clock speed</title><link>https://devzone.nordicsemi.com/thread/246669?ContentTypeID=1</link><pubDate>Mon, 27 Apr 2020 06:33:39 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:febfa532-0ae5-4d2f-b895-9410db88b0b9</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hmm, coremark-wise the&amp;nbsp;STM32L475xx (3.42 CoreMark/MHz @ 80 MHz)&amp;nbsp;&amp;nbsp;is faster than the nRF52840 (&lt;span&gt;3.3&amp;nbsp;&lt;/span&gt;&lt;span&gt;CoreMark per MHz, running CoreMark from flash, cache enabled), which is expected given that it runs at 80MHz vs the 64MHz on the nRF52, but 2 times slower execution on the nRF52840 seems much.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;I was thinking that it could be that the cache wasnt enabled, but if you are running the code from RAM then it cant be that.&amp;nbsp; I see that the&amp;nbsp;STM32L475xx has an&amp;nbsp;Adaptive real-time memory accelerator (ART Accelerator), which may improve the execution time on the ST compared to the nRF52840.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Arduino Nano 33 BLE (nRF52840) seems not to run on max. clock speed</title><link>https://devzone.nordicsemi.com/thread/246646?ContentTypeID=1</link><pubDate>Sun, 26 Apr 2020 14:10:21 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5ab7042e-7149-46ff-a36c-fb8f38093b6d</guid><dc:creator>janjongboom</dc:creator><description>&lt;p&gt;Hi Bjorn, thanks a lot for your reply. I indeed realized that `&lt;em&gt;-mfpu=fpv4-sp-d16` was not declared in the compile options for my project (I assumed this would have been set automatically, but apparently not), and this significantly speeded up the compilation. With GCC9, `-O3` `mfloat-abi=hard` (over softfp which I&amp;nbsp;had before) and&amp;nbsp;by placing the functions in RAM this yields execution time of&amp;nbsp;786 ms. Still significantly higher than on the ST target unfortunately.&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Arduino Nano 33 BLE (nRF52840) seems not to run on max. clock speed</title><link>https://devzone.nordicsemi.com/thread/246228?ContentTypeID=1</link><pubDate>Thu, 23 Apr 2020 11:14:29 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:28915f86-628a-4f27-90a1-2daadad3d4c0</guid><dc:creator>bjorn-spockeli</dc:creator><description>&lt;p&gt;Hi Jan,&amp;nbsp;&lt;/p&gt;
&lt;p&gt;the CPU frequency of the nRF52840 is not configurable so there must be another explanation for the slower execution. Could it be that the FPU on the nRF52840 isnt enabled in the compilation settings?How are you compiling the source code? GCC?&lt;/p&gt;
&lt;p&gt;I copy pasted this from another DevZone case:&lt;/p&gt;
&lt;p&gt;Y&lt;em&gt;ou can enable the FPU in your compiler setting.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;For Keil and IAR, you can find the &amp;quot;hardware floating point&amp;quot; option in the project settings, while in GCC you set this in the makefile:&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;CFLAGS += -mfloat-abi=hard -mfpu=fpv4-sp-d16&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;LDFLAGS +=&amp;nbsp;-mfloat-abi=hard -mfpu=fpv4-sp-d16&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;All the above methods will define __FPU_USED, which will enable the FPU in system_nrf52.c:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;/* Enable the FPU if the compiler used floating point unit instructions.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;* __FPU_USED is a MACRO defined by the&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;* compiler. Since the FPU consumes energy, remember to disable FPU use in the&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;* compiler if floating point unit&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;* operations are not used in your code. */&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;#if (__FPU_USED == 1)&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;SCB-&amp;gt;CPACR |= (3UL &amp;lt;&amp;lt; 20) | (3UL &amp;lt;&amp;lt; 22);&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;__DSB();&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;__ISB();&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;#endif&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&amp;nbsp;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;__DSB and __ISB are intrinsics, which are C-wrapped assembly-calls.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;Their function is to provide &amp;quot;Data synchronization barrier&amp;quot; and &amp;quot;Instruction synchronization barrier&amp;quot;, to ensure that the write of the memory/instruction is performed before moving along in the execution of code.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;The ARM infocenter website didn&amp;#39;t want to load at my end, but I found this stackoverflow thread that explains the functionality:&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;em&gt;&lt;a href="http://stackoverflow.com/questions/15491751/real-life-use-cases-of-barriers-dsb-dmb-isb-in-arm" rel="noopener noreferrer" target="_blank"&gt;http://stackoverflow.com/questions/15491751/real-life-use-cases-of-barriers-dsb-dmb-isb-in-arm&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>