<?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>Issue trying to receive on a UART with rrf52833 and lots of other compiler/IDE questions</title><link>https://devzone.nordicsemi.com/f/nordic-q-a/116178/issue-trying-to-receive-on-a-uart-with-rrf52833-and-lots-of-other-compiler-ide-questions</link><description>Folks, 
 Am running VSC 1.95.1 on Mageia Linux. 
 I have a 52833 board that I have working in that I can write to and read from custom BLE characteristics and send data out on the UART, but receiving is proving impossible. 
 Issue 1 
 The biggest issue</description><dc:language>en-US</dc:language><generator>Telligent Community 13</generator><lastBuildDate>Tue, 12 Nov 2024 14:22:46 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://devzone.nordicsemi.com/f/nordic-q-a/116178/issue-trying-to-receive-on-a-uart-with-rrf52833-and-lots-of-other-compiler-ide-questions" /><item><title>RE: Issue trying to receive on a UART with rrf52833 and lots of other compiler/IDE questions</title><link>https://devzone.nordicsemi.com/thread/510133?ContentTypeID=1</link><pubDate>Tue, 12 Nov 2024 14:22:46 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:459b0d96-b603-4e69-9cb7-5de087615525</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;I understand. Yes, unfortunately, things are a bit more complex in Zephyr, but it was a needed step to increase the number of supported devices on different platforms (nRF52, nRF53 with multicore, nRF91, nRF7002, and now nRF54.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For the old devices, such as nRF52833, it is absolutely possible to use the nRF5 SDK, but it will not get any of the new features.&amp;nbsp;&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: Issue trying to receive on a UART with rrf52833 and lots of other compiler/IDE questions</title><link>https://devzone.nordicsemi.com/thread/509967?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2024 18:11:12 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:5e708d50-653a-4c36-8362-f6cd82446dd8</guid><dc:creator>DiBosco</dc:creator><description>&lt;p&gt;I&amp;#39;ve made some progress now using a 52840 dev kit and am understanding a little bit more how this works. &lt;br /&gt;&lt;br /&gt;One of the big issues was this misuse of the Zephyr FIFO and its mallocs which s a &lt;strong&gt;BIG&lt;/strong&gt; no-no in embedded code. Was causing some real issues and making stuff so hard to read. Using message queues makes it a lot better and safer. &lt;br /&gt;&lt;br /&gt;Zephyr is horrible for little embedded systems like this, as is VSC. Will be looking for a different ecosystem altogether when it comes to the next BLE project I&amp;nbsp; have to do. Such a shame you dropped SES.&lt;br /&gt;&lt;br /&gt;Am still getting these malformed lines issues, once I&amp;#39;ve tidied up this project and made it nice and readable I&amp;#39;ll zip up the project and send it.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue trying to receive on a UART with rrf52833 and lots of other compiler/IDE questions</title><link>https://devzone.nordicsemi.com/thread/509863?ContentTypeID=1</link><pubDate>Mon, 11 Nov 2024 11:45:50 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:d3754965-455b-4d20-9fba-9fe46897acb6</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Perhaps you can upload the application that you are working on, so that I can have a look at your UART implementation?&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: Issue trying to receive on a UART with rrf52833 and lots of other compiler/IDE questions</title><link>https://devzone.nordicsemi.com/thread/509505?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2024 15:32:02 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:6fd20732-0673-4946-b9b5-db829c61e3e8</guid><dc:creator>DiBosco</dc:creator><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;Thanks for the reply. &lt;br /&gt;&lt;br /&gt;I&amp;#39;m never getting any UART info in, I can only send out. As I say I am constantly getting a call into the UART callback function with it telling me the UART is disconnected, at which point I attempt to reconnect. &lt;br /&gt;&lt;br /&gt;I got most of the code from a friend who has got the UART working on a different system. I&amp;#39;ve had a look at that sample code and it looks similarish, only he doesn&amp;#39;t have to disable the UART in the UART_RX_RDY case statement.&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t really understand the need for mallocs in that sample code. Surely you can just have arrays and write to them? And surely you don&amp;#39;t need those macro CONTAINER_OF? Again, my friend did it just by copying from the &lt;code&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;&lt;/span&gt;&lt;span style="color:rgba(0, 16, 128, 1);"&gt;evt&lt;/span&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;-&amp;gt;&lt;/span&gt;&lt;span style="color:rgba(0, 16, 128, 1);"&gt;data&lt;/span&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;.&lt;/span&gt;&lt;span style="color:rgba(0, 16, 128, 1);"&gt;rx&lt;/span&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;.&lt;/span&gt;&lt;span style="color:rgba(0, 16, 128, 1);"&gt;buf&lt;/span&gt;&lt;span style="color:rgba(0, 0, 0, 1);"&gt;&lt;/span&gt;&lt;/code&gt; into a local array, so that must be possible? &lt;br /&gt;&lt;br /&gt;I can&amp;#39;t see what might be wrong compared to that sample file, but I find your coding style incredibly difficult to read, so could be missing something I suppose. The big thing is why does it keep telling me the UART is disconnected? How do we get to the bottom of that? &lt;br /&gt;&lt;br /&gt;2. Executing task: nRF Connect: Build [pristine]: BLE_LBS/build (active) &lt;br /&gt;&lt;br /&gt;Building BLE_LBS&lt;br /&gt;west build --build-dir /home/xxxxxx/Software/someone/BLE_LBS/build /home/xxxxxx/Software/someone/BLE_LBS --pristine --board nrf52833dk/nrf52833 --sysbuild -- -DNCS_TOOLCHAIN_VERSION=NONE -DCONFIG_DEBUG_OPTIMIZATIONS=y -DCONFIG_DEBUG_THREAD_INFO=y -DBOARD_ROOT=/home/xxxxxx/ncs/v2.7.0/zephyr/samples/basic/blinky_pwm;/home/xxxxxx/Software/someone/BLE_LBS;/home/xxxxxx/Software/someone/NRF52840_LBS&lt;br /&gt;&lt;br /&gt;-- west build: generating a build system&lt;br /&gt;Loading Zephyr module(s) (Zephyr base): sysbuild_default&lt;br /&gt;-- Found Python3: /home/xxxxxx/ncs/toolchains/e9dba88316/usr/local/bin/python3.9 (found suitable version &amp;quot;3.9.18&amp;quot;, minimum required is &amp;quot;3.8&amp;quot;) found components: Interpreter &lt;br /&gt;-- Cache files will be written to: /home/xxxxxx/.cache/zephyr&lt;br /&gt;-- Found west (found suitable version &amp;quot;1.2.0&amp;quot;, minimum required is &amp;quot;0.14.0&amp;quot;)&lt;br /&gt;-- Board: nrf52833dk, qualifiers: nrf52833&lt;br /&gt;Parsing /home/xxxxxx/Software/someone/BLE_LBS/Kconfig.sysbuild&lt;br /&gt;Loaded configuration &amp;#39;/home/xxxxxx/Software/someone/BLE_LBS/build/_sysbuild/empty.conf&amp;#39;&lt;br /&gt;Merged configuration &amp;#39;/home/xxxxxx/Software/someone/BLE_LBS/build/_sysbuild/empty.conf&amp;#39;&lt;br /&gt;Configuration saved to &amp;#39;/home/xxxxxx/Software/someone/BLE_LBS/build/zephyr/.config&amp;#39;&lt;br /&gt;Kconfig header saved to &amp;#39;/home/xxxxxx/Software/someone/BLE_LBS/build/_sysbuild/autoconf.h&amp;#39;&lt;br /&gt;-- &lt;br /&gt;&amp;nbsp;&amp;nbsp; *****************************&lt;br /&gt;&amp;nbsp;&amp;nbsp; * Running CMake for BLE_LBS *&lt;br /&gt;&amp;nbsp;&amp;nbsp; *****************************&lt;br /&gt;&lt;br /&gt;Loading Zephyr default modules (Zephyr base).&lt;br /&gt;-- Application: /home/xxxxxx/Software/someone/BLE_LBS&lt;br /&gt;-- CMake version: 3.21.0&lt;br /&gt;-- Using NCS Toolchain 2.6.20240605.1004412633878 for building. (/home/xxxxxx/ncs/toolchains/e9dba88316/cmake)&lt;br /&gt;-- Found Python3: /home/xxxxxx/ncs/toolchains/e9dba88316/usr/local/bin/python3 (found suitable version &amp;quot;3.9.18&amp;quot;, minimum required is &amp;quot;3.8&amp;quot;) found components: Interpreter &lt;br /&gt;-- Cache files will be written to: /home/xxxxxx/.cache/zephyr&lt;br /&gt;-- Zephyr version: 3.6.99 (/home/xxxxxx/ncs/v2.7.0/zephyr)&lt;br /&gt;-- Found west (found suitable version &amp;quot;1.2.0&amp;quot;, minimum required is &amp;quot;0.14.0&amp;quot;)&lt;br /&gt;-- Board: nrf52833dk, qualifiers: nrf52833&lt;br /&gt;-- Found host-tools: zephyr 0.16.5 (/home/xxxxxx/ncs/toolchains/e9dba88316/opt/zephyr-sdk)&lt;br /&gt;-- Found toolchain: zephyr 0.16.5 (/home/xxxxxx/ncs/toolchains/e9dba88316/opt/zephyr-sdk)&lt;br /&gt;-- Found Dtc: /home/xxxxxx/ncs/toolchains/e9dba88316/usr/local/bin/dtc (found suitable version &amp;quot;1.5.0&amp;quot;, minimum required is &amp;quot;1.4.6&amp;quot;) &lt;br /&gt;-- Found BOARD.dts: /home/xxxxxx/ncs/v2.7.0/zephyr/boards/nordic/nrf52833dk/nrf52833dk_nrf52833.dts&lt;br /&gt;-- Found devicetree overlay: /home/xxxxxx/Software/someone/BLE_LBS/nrf52833dk_nrf52833.overlay&lt;br /&gt;-- Generated zephyr.dts: /home/xxxxxx/Software/someone/BLE_LBS/build/BLE_LBS/zephyr/zephyr.dts&lt;br /&gt;-- Generated devicetree_generated.h: /home/xxxxxx/Software/someone/BLE_LBS/build/BLE_LBS/zephyr/include/generated/devicetree_generated.h&lt;br /&gt;-- Including generated dts.cmake file: /home/xxxxxx/Software/someone/BLE_LBS/build/BLE_LBS/zephyr/dts.cmake&lt;br /&gt;Parsing /home/xxxxxx/Software/someone/BLE_LBS/Kconfig&lt;br /&gt;Loaded configuration &amp;#39;/home/xxxxxx/ncs/v2.7.0/zephyr/boards/nordic/nrf52833dk/nrf52833dk_nrf52833_defconfig&amp;#39;&lt;br /&gt;Merged configuration &amp;#39;/home/xxxxxx/Software/someone/BLE_LBS/prj.conf&amp;#39;&lt;br /&gt;Merged configuration &amp;#39;/home/xxxxxx/Software/someone/BLE_LBS/build/BLE_LBS/zephyr/misc/generated/extra_kconfig_options.conf&amp;#39;&lt;br /&gt;Merged configuration &amp;#39;/home/xxxxxx/Software/someone/BLE_LBS/build/BLE_LBS/zephyr/.config.sysbuild&amp;#39;&lt;br /&gt;Configuration saved to &amp;#39;/home/xxxxxx/Software/someone/BLE_LBS/build/BLE_LBS/zephyr/.config&amp;#39;&lt;br /&gt;Kconfig header saved to &amp;#39;/home/xxxxxx/Software/someone/BLE_LBS/build/BLE_LBS/zephyr/include/generated/autoconf.h&amp;#39;&lt;br /&gt;-- Found GnuLd: /home/xxxxxx/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/arm-zephyr-eabi/bin/ld.bfd (found version &amp;quot;2.38&amp;quot;) &lt;br /&gt;-- The C compiler identification is GNU 12.2.0&lt;br /&gt;-- The CXX compiler identification is GNU 12.2.0&lt;br /&gt;-- The ASM compiler identification is GNU&lt;br /&gt;-- Found assembler: /home/xxxxxx/ncs/toolchains/e9dba88316/opt/zephyr-sdk/arm-zephyr-eabi/bin/arm-zephyr-eabi-gcc&lt;br /&gt;-- Using ccache: /home/xxxxxx/ncs/toolchains/e9dba88316/usr/bin/ccache&lt;br /&gt;CMake Warning at /home/xxxxxx/ncs/v2.7.0/zephyr/CMakeLists.txt:2027 (message):&lt;br /&gt;&amp;nbsp; __ASSERT() statements are globally ENABLED&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;-- Configuring done&lt;br /&gt;-- Generating done&lt;br /&gt;-- Build files have been written to: /home/xxxxxx/Software/someone/BLE_LBS/build/BLE_LBS&lt;br /&gt;-- Configuring done&lt;br /&gt;-- Generating done&lt;br /&gt;-- Build files have been written to: /home/xxxxxx/Software/someone/BLE_LBS/build&lt;br /&gt;-- west build: building application&lt;br /&gt;[1/226] Preparing syscall dependency handling&lt;br /&gt;&lt;br /&gt;[7/226] Generating include/generated/version.h&lt;br /&gt;-- Zephyr version: 3.6.99 (/home/xxxxxx/ncs/v2.7.0/zephyr), build: v3.6.99-ncs2&lt;br /&gt;[226/226] Linking C executable zephyr/zephyr.elf&lt;br /&gt;Memory region&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Used Size&amp;nbsp; Region Size&amp;nbsp; %age Used&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; FLASH:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 208172 B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 504 KB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 40.34%&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; RAM:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 30048 B&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 128 KB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 22.92%&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; IDT_LIST:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0 GB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 32 KB&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 0.00%&lt;br /&gt;Generating files from /home/xxxxxx/Software/someone/BLE_LBS/build/BLE_LBS/zephyr/zephyr.elf for board: nrf52833dk&lt;br /&gt;[10/10] Generating ../merged.hex&lt;br /&gt;&amp;nbsp;*&amp;nbsp; Terminal will be reused by tasks, press any key to close it.&lt;br /&gt;&lt;br /&gt;I can&amp;#39;t really remember how I installed the SDK, I might have just unzipped it. I found it such a struggle to installed VSC and had to try so many things to get it working. &lt;br /&gt;&lt;br /&gt;3. Am trying to build/am building the peripheral_lbs from the Copy A Sample thing in VSC. &lt;br /&gt;&lt;br /&gt;4. I did it in the Edit Build Configuration tab in the combo box and selected optimise for debugging. It&amp;#39;s not stepping through BLE that is the problem, I know because you supply a binary blob you can&amp;#39;t step through that. And that doesn&amp;#39;t explain why all variables are optimised out when setting the UART up. In fact it just steps over many lines as if they are optimised out when they shouldn&amp;#39;t be.&lt;/p&gt;
&lt;p&gt;5. Yes, but is it sending the Cortex to sleep and potentialyl disconnecting the UART? I suppose I should trya for next loop to see if that helps.&lt;/p&gt;
&lt;p&gt;6 and 7. These are seen in the Problems tab. &lt;br /&gt;&lt;br /&gt;I suspect some of these so-called errors are just warnings, but I hate having any sort of warning when writing code, they can bite you in the bum.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Issue trying to receive on a UART with rrf52833 and lots of other compiler/IDE questions</title><link>https://devzone.nordicsemi.com/thread/509497?ContentTypeID=1</link><pubDate>Thu, 07 Nov 2024 15:00:59 GMT</pubDate><guid isPermaLink="false">137ad170-7792-4731-bb38-c0d22fbe4515:36309f98-de0f-48ca-9c00-3b695f624875</guid><dc:creator>Edvin</dc:creator><description>&lt;p&gt;Hello!&lt;/p&gt;
&lt;p&gt;Quite a few questions, so I will try to answer all of them. Let me know if I missed some, or if anything was unclear.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;1: Are you actually missing UART data? The way the uart works in this sample is a bit complex. At least if you got it from the ncs\nrf\samples\bluetooth\peripheral_uart sample. But it works, although it involves disabling the uart to process the incoming data, but it should be &amp;quot;automatically&amp;quot; enabled again. If that is not where you got it from, perhaps you can look into that sample, and see if you can copy the UART handling from there.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;2: I need more context here. Can you provide the entire build log? How did you install the SDK? nRF Connect for Desktop -&amp;gt; Toolchain Manager? VS Code directly?&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;3:&amp;nbsp;The same. I need more context. What are you trying to build? And what is your environment?&lt;/p&gt;
&lt;p&gt;Are you able to build with these error messages? Because you say that you can debug, so I am a bit confused. Perhaps you can zip and send the application folder that you are currently working on, and I can have a look.&lt;/p&gt;
&lt;p&gt;4: How did you set debug optimization? Can you please try to delete the build folder, and select it once more? And please note that when you are using the BLE stack, it is not possible to break and step all you want, because the Bluetooth stack will miss too many time sensitive events.&lt;/p&gt;
&lt;p&gt;5: No, that line will not mess with anything. It puts it in a state that any events that are generated will wake up the device again.&lt;/p&gt;
&lt;p&gt;6: Where and when do you see it?&amp;nbsp;&lt;/p&gt;
&lt;p&gt;7: Where do you see this?&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></channel></rss>