<?xml-stylesheet type="text/xsl" href="https://community.element14.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/"><channel><title>C++ library for ST Teseo GPS - pt. 2: Dynamic GPS configuration (and some other things)</title><link>/technologies/embedded/b/blog/posts/c-library-for-st-teseo-gps---pt-2-dynamic-gps-configuration-and-some-other-things</link><description>The Teseo-LIV3 GPS module (as used in shabaz &amp;#39; GPS / Galileo / BeiDou / GLONASS receiver ) talks UART and I2C. I&amp;#39;m writing an OO driver for it, for embedded systems. In this blog, I configure the Teseo IC at runtime. And write...</description><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><item><title>RE: C++ library for ST Teseo GPS - pt. 2: Dynamic GPS configuration (and some other things)</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/c-library-for-st-teseo-gps---pt-2-dynamic-gps-configuration-and-some-other-things</link><pubDate>Mon, 15 Jul 2024 14:49:32 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:f7775479-3fac-44cd-9bde-6c5baee5607a</guid><dc:creator>shabaz</dc:creator><slash:comments>0</slash:comments><description>&lt;p&gt;I once worked on a system that was real-time but running on a large box that was essentially internally a server with storage, etc, rather than a microcontroller, and customers could switch on a logging mode (in the same production release, i.e. not a separate build) but were advised never to do that in their production systems&amp;nbsp;(many of those customers kept a separate testbed to try things out). I can&amp;#39;t recall now, but I think for a long time we only released builds built with debug, i.e. we took the performance hit, but eventually changed the build flags once we had more confidence.&lt;/p&gt;
&lt;p&gt;Some ran the systems (as advised with logging switched off) like racing cars and to save costs&amp;nbsp;wouldn&amp;#39;t have purchased many of the systems&amp;nbsp;to run in parallel, and if there was ever a crash, if they couldn&amp;#39;t replicate on their testbed, then it was of course a nightmare to troubleshoot. And, of course, since it was such a severe thing, almost all of our other work would stop apart from focussing on the crash problem, trying to replicate it ourselves, and getting it solved.&lt;/p&gt;
&lt;p&gt;One trick we ended up doing for a particular build for one customer was to give them a &amp;#39;special&amp;#39; release that logged a minimal amount (events and the first dozen or so bytes of any messages) but instead of to disk which was slow, we decided to store into a circular RAM buffer of the last 1000 or 10000 events or whatever. That way, whenever there was a crash, there was a good chance that the RAM was not significantly corrupted, and we could read the contents and figure out what might have happened. That was not too difficult because the underlying OS would create the crash dump containing all the RAM contents, so we&amp;#39;d simply get the customer to ship across the&amp;nbsp;(usually huge, many Gbytes) file (if it didn&amp;#39;t contain anything they considered confidential), otherwise we would send them software to pull out what we needed. The RAM was easy to search since the buffer started with a magic sequence.&lt;/p&gt;
&lt;p&gt;Over time we managed to weed out all the race conditions and improve reliability loads, but it was a stressful time since it&amp;#39;s the worst customer experience when things crash. We improved guidelines (we created an online or Excel file calculator for the customer and salespeople to easily figure out how many of the systems each customer would require so as to not be running with massive amounts of events per sec), and improved performance testing (developing ways to hammer the system to simulate peak times, artificially loading up the CPU, etc), and then as it got more mature, it was a nice result that when the customer trends changed, it was possible to quickly port the code, and even virtualize it, without too many hiccups.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=28156&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: C++ library for ST Teseo GPS - pt. 2: Dynamic GPS configuration (and some other things)</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/c-library-for-st-teseo-gps---pt-2-dynamic-gps-configuration-and-some-other-things</link><pubDate>Mon, 15 Jul 2024 09:13:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:f7775479-3fac-44cd-9bde-6c5baee5607a</guid><dc:creator>michaelkellett</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;Here&amp;#39;s a thought, mainly applicable to high reliability hard real time systems,&lt;/p&gt;
&lt;p&gt;I like the ideas, which were very prevalent in an aerospace project on which I worked:&lt;/p&gt;
&lt;p&gt;1) if it executes ever it executes always&lt;/p&gt;
&lt;p&gt;2) what you test is what you ship&lt;/p&gt;
&lt;p&gt;To amplify a little:&lt;/p&gt;
&lt;p&gt;rule 1 implies that if a stream of debug information is sent to serial port X the it should ideally be emitted at a constant rate. This is to avoid bugs of the kind where the extra processing load of debug printfs slows things down enough to avoid a fatal race condition elsewhere.&lt;/p&gt;
&lt;p&gt;rule 2 implies that release code and test code are the same code&lt;/p&gt;
&lt;p&gt;Compliance with these rules can be very hard to achieve - on some code I&amp;#39;m working on now a particular function runs in 20us with maximum optimisation, but debugging only works correctly at a much lesser optimisation setting, when the function takes 47us to run.&amp;nbsp; So I must test the code with more less no debugging operating. My answer to that is to build instrumentation into the code (which is always there and will always execute according to rule 1).&lt;/p&gt;
&lt;p&gt;I don&amp;#39;t use asserts but if I did I think I would need to add an assert handler so I could leave them in the code.&lt;/p&gt;
&lt;p&gt;One of the questions I have for the next code review is &amp;quot;what shall the code do when the scheduler detects that a task returned without error but took too long to do so&amp;quot;. (Too long in this case is defined as greater than the maximum time set in the task definition&amp;nbsp; - doesn&amp;#39;t necessarily mean that anything bad happens if enough of the other tasks did better !).&lt;/p&gt;
&lt;p&gt;MK&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=28156&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: C++ library for ST Teseo GPS - pt. 2: Dynamic GPS configuration (and some other things)</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/c-library-for-st-teseo-gps---pt-2-dynamic-gps-configuration-and-some-other-things</link><pubDate>Sun, 14 Jul 2024 09:10:44 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:f7775479-3fac-44cd-9bde-6c5baee5607a</guid><dc:creator>Jan Cumps</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I&amp;#39;ve added DoxyGen comments. A typical html doc page looks like this:&lt;/p&gt;
&lt;p&gt;&lt;img src="/resized-image/__size/1280x720/__key/commentfiles/f7d226abd59f475c9d224a79e3f0ec07-f7775479-3fac-44cd-9bde-6c5baee5607a/pastedimage1720948200226v1.png" alt=" " /&gt;&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=28156&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item><item><title>RE: C++ library for ST Teseo GPS - pt. 2: Dynamic GPS configuration (and some other things)</title><link>https://community.element14.com/technologies/embedded/b/blog/posts/c-library-for-st-teseo-gps---pt-2-dynamic-gps-configuration-and-some-other-things</link><pubDate>Sat, 13 Jul 2024 16:48:34 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:f7775479-3fac-44cd-9bde-6c5baee5607a</guid><dc:creator>genebren</dc:creator><slash:comments>1</slash:comments><description>&lt;p&gt;I do agree with your &amp;#39;hurt&amp;#39; classifications and your use of asserts.&amp;nbsp; I find with a lot of the embedded coding that I do, with a high degree of time sensitivity, that I don&amp;#39;t often use a debugger during development and testing, so I rely on printf statements to provide me with some insight as to how the program is functioning or &amp;#39;not&amp;#39; functioning.&lt;/p&gt;&lt;img src="https://community.element14.com/aggbug?PostID=28156&amp;AppID=7&amp;AppType=Weblog&amp;ContentType=0" width="1" height="1"&gt;</description></item></channel></rss>