<?xml version="1.0" encoding="UTF-8" ?>
<?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/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Forum - Recent Threads</title><link>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum</link><description /><dc:language>en-US</dc:language><generator>Telligent Community 12</generator><lastBuildDate>Mon, 07 Nov 2022 20:07:22 GMT</lastBuildDate><atom:link rel="self" type="application/rss+xml" href="https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum" /><item><title>Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/51836?ContentTypeID=0</link><pubDate>Sun, 09 Oct 2022 15:18:55 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:adc0391f-00cb-4ee1-a8c2-3ba6142b78c5</guid><dc:creator>rsjawale24</dc:creator><slash:comments>89</slash:comments><comments>https://community.element14.com/thread/51836?ContentTypeID=0</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;The MAX25405EVKIT comes with a MAX32620FTHR board which is preprogrammed with custom binary file for the gesture recognition. The application note at&amp;nbsp;&lt;a href="https://www.maximintegrated.com/en/design/technical-documents/app-notes/7/7422.html"&gt;Maxim Gesture Sensor EVKit Serial API (maximintegrated.com)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;mentions &amp;quot;The serial interface can be implemented over the Universal Serial Bus (USB) virtual serial port or over a Universal Asynchronous Receiver-Transmitter (UART). The EV kit is shipped configured to use the USB serial port to work with the EV kit PC Graphical user Interface (GUI). If a UART serial interface is desired, custom firmware in binary format is available.&amp;quot;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Upon researching more, I found the firmware_framework code that contains the code for gesture recognition compiled using mbed compiler.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The readme file says that a file called interface.h and interface.c define the communication protocol. When I open the interface.c file, I can see a comment in the code that says&amp;nbsp;Option to implement serial API over UART instead of USB but there is only a MACRO set as #define macro_name 0&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;I tried to change the 0 to 1 and compile the code, however, it does not compile successfully. The USBDevice library shows some error while compiling.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;Did anyone try to change the serial API over UART instead of USB? Was it&amp;nbsp;successful?&amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;EDIT: I have successfully compiled the code for UART. However, I&amp;#39;ll do some&amp;nbsp;experiments and write introductory blogs before I re-program the MAX32620FTHR board with my firmware.&amp;nbsp;&lt;/span&gt;&lt;/p&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/202030?ContentTypeID=1</link><pubDate>Mon, 07 Nov 2022 20:07:22 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e0185baf-08ac-4ec8-9f94-749c011a5444</guid><dc:creator>misaz</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/202030?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;If someone is interested, today I published blog with detials about debugging: &amp;nbsp;&lt;a href="https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/b/challenge-blog/posts/blog-7-debugging-maxim-s-firmware-framework-crash"&gt;Blog #7: Debugging Maxim’s Firmware Framework Crash&lt;/a&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201816?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 23:42:26 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:61c7e888-cf21-4a96-a706-a779d74dda57</guid><dc:creator>dougw</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/201816?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;great work digging out the root cause&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201785?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 13:10:44 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:def461e1-bcf5-4c5e-a10f-149abaa9227b</guid><dc:creator>BigG</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/201785?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;Yes that&amp;#39;s correct. So at least the crash has been sorted but some way to go to now get real answers.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201784?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 13:09:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:bad2eb43-4486-423e-ba5c-90f8a99cf2ed</guid><dc:creator>rsjawale24</dc:creator><slash:comments>1</slash:comments><comments>https://community.element14.com/thread/201784?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;The poll command was returning all 0&amp;#39;z and then crashing. It seems now it won&amp;#39;t crash but the result will still be 0&amp;#39;s if there is logic problem.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201783?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 13:08:53 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:fd73733b-b51c-4ffd-b1cb-a7a37274ebf6</guid><dc:creator>BigG</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/201783?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;As far as I can work out I think it requires a major piece of work to get the MCU to recognise different gestures.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201781?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 13:06:36 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:86d1e36a-9d6f-4553-8c15-d06c5f50739c</guid><dc:creator>misaz</dc:creator><slash:comments>1</slash:comments><comments>https://community.element14.com/thread/201781?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;As far I did not fix any code logic. I just ensured that code do not crash.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201780?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 13:03:50 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2cbd23bb-bcc6-4a6e-889d-5408729d640d</guid><dc:creator>BigG</dc:creator><slash:comments>2</slash:comments><comments>https://community.element14.com/thread/201780?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;Wow, great spot (re Add &lt;span style="color:#af00db;"&gt;return&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;CMD_ACK&lt;/span&gt;&lt;span style="color:#000000;"&gt;; &lt;/span&gt;)&lt;/p&gt;
&lt;p&gt;It&amp;#39;s worth noting that the poll command is lacking the actual gesture result, as you see in the default demo binary.&lt;/p&gt;
&lt;p&gt;In the poll command all it provides is a placeholder (gesResult.int_placeholder,)&lt;/p&gt;
&lt;p&gt;Also, if you look in gesture_lib.h you will see the gestureEvent enum only provides a template:&lt;/p&gt;
&lt;p&gt;&lt;code&gt;/*&lt;/code&gt;&lt;br /&gt;&lt;code&gt;* Enumerate gesture events here&lt;/code&gt;&lt;br /&gt;&lt;code&gt;*/&lt;/code&gt;&lt;br /&gt;&lt;code&gt;typedef enum {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;GEST_NONE,&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;GEST_PLACEHOLDER&lt;/code&gt;&lt;br /&gt;&lt;code&gt;} GestureEvent;&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;No doubt there is a bunch of code in that demo binary to adds in all the gestures.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201779?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 13:01:40 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:05d51902-73c8-4740-8f29-1852c9679955</guid><dc:creator>rsjawale24</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/201779?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;Then just adding return 0 should also work!! &lt;/p&gt;
&lt;p&gt;I&amp;#39;ll try it and will post her&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201778?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 12:55:24 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d567b011-d915-44b3-83f0-de5bc2c27092</guid><dc:creator>misaz</dc:creator><slash:comments>1</slash:comments><comments>https://community.element14.com/thread/201778?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;This function should return 0 allways.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201777?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 12:54:05 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b1537754-496e-442a-93e7-076afb36882c</guid><dc:creator>rsjawale24</dc:creator><slash:comments>1</slash:comments><comments>https://community.element14.com/thread/201777?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;I was getting error that function is not void so it should return something. I just put return 0 there and it compiled successfully. However return 0 will only return 0 after successful execution. How come I didn&amp;#39;t think of this!! &lt;/p&gt;
&lt;p&gt;Thanks for the help. I&amp;#39;ll try it asap&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201776?ContentTypeID=1</link><pubDate>Wed, 02 Nov 2022 12:26:57 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:6bb886a8-c1d3-424b-996b-2b6962bac056</guid><dc:creator>misaz</dc:creator><slash:comments>4</slash:comments><comments>https://community.element14.com/thread/201776?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;Today I found root cause of the issue. Issue is caused by invalid assembly code generated by modern ARM compiler. With older GCC compiler it works because it handle undefined behaviour used in code differently. I will write (long) blog with more details describing what exactly happended on Cortex-M4 core including all details about my analysis, listings of faulty assembly code and (lot of) details about debugging procedure which I applied to finding root cause of issue.&lt;/p&gt;
&lt;p&gt;TLDR solution for our problem is following.&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open cmd.cpp&lt;/li&gt;
&lt;li&gt;Go to function cmd_poll at line 269&lt;/li&gt;
&lt;li&gt;Add &lt;span style="color:#af00db;"&gt;return&lt;/span&gt;&lt;span style="color:#000000;"&gt; &lt;/span&gt;&lt;span style="color:#0000ff;"&gt;CMD_ACK&lt;/span&gt;&lt;span style="color:#000000;"&gt;; to the end of the function&lt;/span&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style="color:#000000;"&gt;Recompile, enter bootloader, drag and drop new firmware and MCU will not crash after poll command anymore.&lt;/span&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;&lt;span style="color:#000000;"&gt;The missing return statement cost me about 7 hours of debugging....&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201769?ContentTypeID=1</link><pubDate>Tue, 01 Nov 2022 21:27:16 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:2756828e-77f0-471d-a40d-b3224f5f947c</guid><dc:creator>misaz</dc:creator><slash:comments>1</slash:comments><comments>https://community.element14.com/thread/201769?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;I am getting near... Here is stack trace of location in which our firmware stuck after executing poll command. mbed_halt_system has infinite loop in which program stuck. Stuck is consequence of some hard fault.&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;" src="https://community.element14.com/resized-image/__size/1280x720/__key/communityserver-discussions-components-files/375/pastedimage1667335229039v1.png"  /&gt;&lt;/p&gt;
&lt;p&gt;I found quick (but not reliable answer): Change compiler. If you use gcc bundled in Debian instead ARM compiler which I recommended, then It generates more compact image which works &lt;span class="emoticon" data-url="https://community.element14.com/cfs-file/__key/system/emoji/1f603.svg" title="Smiley"&gt;&amp;#x1f603;&lt;/span&gt; But I will still dig into it and try find solution working with any compiler if possible.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>Trying to understand this center of mass methodology?</title><link>https://community.element14.com/thread/51927?ContentTypeID=0</link><pubDate>Mon, 31 Oct 2022 11:37:27 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:d395f72c-f6fc-401a-b99f-16e60e8c5551</guid><dc:creator>BigG</dc:creator><slash:comments>3</slash:comments><comments>https://community.element14.com/thread/51927?ContentTypeID=0</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51927/trying-to-understand-this-center-of-mass-methodology/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;I am working through the Firmware Framework code and I came across this routine for center of mass calculation, which did not make sense at first glance.&lt;/p&gt;
&lt;p&gt;I can&amp;#39;t find anything online to confirm that this is the correct or maybe best approach. I did find this on stackoverflow but it&amp;#39;s not really helpful in confirming if code methodology correct: &lt;a href="https://stackoverflow.com/questions/66175912/center-of-mass-algorithm"&gt;https://stackoverflow.com/questions/66175912/center-of-mass-algorithm&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;void calcCenterOfMass(const int pixels[], const unsigned int 
xres, const unsigned int yres, float *cmx, float *cmy, int *totalmass)&lt;/code&gt;&lt;br /&gt;&lt;code&gt;{&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; int cmx_numer=0, cmy_numer=0;&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; for (unsigned int i = 0; i &amp;lt; xres*yres; i++) {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmx_numer += (i%xres)*pixels[i];&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; cmy_numer += (i/xres)*pixels[i];&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *totalmass += pixels[i];&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; if (*totalmass == 0) {&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; *totalmass = 1; // avoid NaN&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; }&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; *cmx = (float)cmx_numer/(float)(*totalmass);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;&amp;nbsp; *cmy = (float)cmy_numer/(float)(*totalmass);&lt;/code&gt;&lt;br /&gt;&lt;code&gt;}&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;br /&gt;For example, when calculating cmx_numer and cmy_numer, one uses modulus of xres and the other divides by xres. Struggling to work out if correct.&lt;/p&gt;
&lt;p&gt;I&amp;#39;m also wondering about the &amp;quot;for&amp;quot; routine too.&lt;/p&gt;
&lt;p&gt;So I am seeking feedback.&lt;/p&gt;</description></item><item><title>RE: Trying to understand this center of mass methodology?</title><link>https://community.element14.com/thread/201755?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 17:30:34 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:874bb263-88d7-4d7b-8f41-8369846c169c</guid><dc:creator>BigG</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/201755?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51927/trying-to-understand-this-center-of-mass-methodology/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;Thanks &lt;a href="https://community.element14.com/members/dougw"&gt;dougw&lt;/a&gt; and &lt;a href="https://community.element14.com/members/misaz"&gt;misaz&lt;/a&gt; your explanations have really helped.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand this center of mass methodology?</title><link>https://community.element14.com/thread/201753?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 16:53:28 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:11b830b0-5ecd-4b20-8082-b42872272c93</guid><dc:creator>misaz</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/201753?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51927/trying-to-understand-this-center-of-mass-methodology/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;It makes sense. They flattened two-dimensional array of 10*6 pixels to one single-dimension 60 pixel wide array. For example, pixel at location (x=6, y=3) is at index 36. Pixels are mapped to signle dimensional array as foolows:&lt;/p&gt;
&lt;p&gt;&lt;img alt="image" style="max-height:360px;max-width:640px;" src="https://community.element14.com/resized-image/__size/1280x720/__key/communityserver-discussions-components-files/375/pastedimage1667235161056v1.png"  /&gt;&lt;/p&gt;
&lt;p&gt;Division and modulus are techniques for revers computing pixel x and y location from array index. For example, imagine you want to get coordinates of 47&lt;sup&gt;th&lt;/sup&gt; pixel from array. If you pass 47 % 10 you get 7. If you divide 47 / 10 you get 4 and as you can see 7 and 4 are coordinates of pixel (X=7, Y=4). In their code:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;i is index in flat single-dimensional array (for example 47)&lt;/li&gt;
&lt;li&gt;cmx_numer is X coordinates of canter of mass. It is weighed multiplication of pixel coordinates&lt;/li&gt;
&lt;li&gt;cmy_number is the same but for Y coordinate.&lt;/li&gt;
&lt;li&gt;totalmass is sum of all&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Imagine simple row with three pixels and suppose that data from sensor are (10, 20, 30) from left to right. i iterates over 0, 1 and 2. In first iteration you add to cmx_nummer 0 * 10 = 0, in second you add 1 * 20 = 20 and in third you add 2 * 30 = 60. cmx_numer will be 0 + 20 + 60 = 80. Total is 10+20+30 = 60 and you compute X axis of center of mass as 80 / 60 = 1.33 and it makes sense if you take in account that values are accumulated more at right side, you center of mass between 2nd (1st when counted from zero) and 3rd pixels (2nd when counted from zero).&lt;/p&gt;
&lt;p&gt;Code is almost correct, I think. The only issue I see that it does not compute first row and column because they are indexed by 0 hence the value is always multiplied by 0. I think they should add + 1 to both coordinates when computing and then subtract 1 from computed coordinates. But this has minor impact on algorithm in overall.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Trying to understand this center of mass methodology?</title><link>https://community.element14.com/thread/201752?ContentTypeID=1</link><pubDate>Mon, 31 Oct 2022 16:25:36 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:c9b9908f-0f7d-4e7a-8b33-b20d2479b63c</guid><dc:creator>dougw</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/201752?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51927/trying-to-understand-this-center-of-mass-methodology/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m not sure what center of mass you are calculating so I don&amp;#39;t know if this is relevant, but...&lt;/p&gt;
&lt;p&gt;The way I understand it, to calculate the centroid coordinates of a 2d black and white image:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;the x coordinate of the centroid is the sum of all the x coordinates of each white pixel in the image divided by the number of lines in the image to obtain the average x value.&lt;/li&gt;
&lt;li&gt;&lt;span&gt;the y coordinate of the centroid is the sum of all the y coordinates of each white pixel in the image divided by the number of columns in the image to obtain the average y value.&lt;/span&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;span&gt;I&amp;#39;m not sure how they get the coordinates of each pixel, but they seem to be dividing by the total number of pixels, which would give a normalized value (between 0 and 1).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201578?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 19:57:58 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5fbabb51-4298-4519-8a1b-5fad09fa70f1</guid><dc:creator>BigG</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/201578?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;Don&amp;#39;t let the quantity of code put you off. The algorithms are actually fairly straightforward. It&amp;#39;s just a little messy that&amp;#39;s all, probably because the code has not been worked on and refined.&lt;/p&gt;
&lt;p&gt;So, basically the code captures an array of data from the sensor (using either SPI or I2C), then it averages things out for you using a sort of moving average (as in averages out 3 data arrays) and then it does some filtering of the data to extract out background noise using another 2 data arrays and a min and max value, so that it can detect the gesture.&lt;/p&gt;
&lt;p&gt;It then has some code that determines if it detects movement in progress or the movement has stopped (I haven&amp;#39;t figured out how it does this part). It also prints out the data.&lt;/p&gt;
&lt;p&gt;The user command part is just for the windows GUI software.&lt;/p&gt;
&lt;p&gt;As such, regardless of algorithm &amp;amp; user command, you are still left with 6 rows of data containing 10 values each. You will still have to use that data to determine the gesture.&lt;/p&gt;
&lt;p&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201577?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 19:42:34 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:e93b49db-7c3d-46f4-b201-1dbc2a3ce6ec</guid><dc:creator>rsjawale24</dc:creator><slash:comments>2</slash:comments><comments>https://community.element14.com/thread/201577?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;I&amp;#39;m not very good at coding..all I can do is write simple programs and understand codes. But when it comes to writing codes for such complex devices, I&amp;#39;m not very good at that. I will try debugging..I have ordered a Maxim Pico and I should recieve it soon. However, I don&amp;#39;t know how to debug.&lt;/p&gt;
&lt;p&gt;Also while compiling the code, I noticed there were tons of warnings being generated. Maybe some of the warnings are critical and are affecting the firmware working.&lt;/p&gt;
&lt;p&gt;Its really great that you&amp;#39;re working on your own code!&lt;/p&gt;
&lt;p&gt;Also another thing to note which I just remembered the maxim firmware only locks up when you send the poll command, it does not lock up for other commands no matter how many times you send them.&lt;/p&gt;
&lt;p&gt;So this could be some kind of data overloading not sure. Let&amp;#39;s try debugging. I&amp;#39;ll need some help with that though&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201576?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 19:36:20 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:9449feab-9867-499f-8eb9-37c1adfea817</guid><dc:creator>misaz</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/201576?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;I understand. I am not good in english so maybe I misunderstand your previous post.&lt;/p&gt;
&lt;p&gt;Repacking and simplifing project is good idea, but I will still try to debug code rather. My theory is that it crashes to some HardFault handler so it should not be so hard to debug. But who knows? I did not try it yet.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201574?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 19:32:53 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a0ae52ac-1d9a-465f-bf69-67ff4596017c</guid><dc:creator>BigG</dc:creator><slash:comments>2</slash:comments><comments>https://community.element14.com/thread/201574?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;&lt;a href="https://community.element14.com/members/misaz"&gt;misaz&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.element14.com/members/rsjawale24"&gt;rsjawale24&lt;/a&gt;&amp;nbsp;Oops maybe a poor choice of words used... I meant glitching in the broadest sense (dictionary def:&amp;nbsp;&lt;span&gt;suffer a sudden malfunction or fault) and took it as software/firmware related. &lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;In my experience you need a debugger to catch these errors and when you&amp;#39;re not the author of the code it becomes rather difficult to work out the problem. As such, I have found my personal preference, as it works for me, is to recreate or repack the code function by function to fathom out what&amp;#39;s going on.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span&gt;The code is certainly a little messy for my liking. Now that I&amp;#39;ve spent a bit of time on this, I have determined (so far) that there are at least 6 pixel arrays (each size 60 of integer or float data type) which are storing pixel data plus the different data structures. So yes it uses a fair bit of memory.&lt;/span&gt;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201561?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 16:05:55 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:5f2dc570-f9b6-4366-913e-250e5f8b1fd6</guid><dc:creator>rsjawale24</dc:creator><slash:comments>0</slash:comments><comments>https://community.element14.com/thread/201561?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;Yes, the issue is not with the hardware so it should not lock up the program while reading. The problem lies in the firmware code provided by Maxim. Which currently, I&amp;#39;m unable to determine.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201559?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 15:58:37 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:3d501895-2498-4a3c-bb77-c1ed410a5b7c</guid><dc:creator>misaz</dc:creator><slash:comments>1</slash:comments><comments>https://community.element14.com/thread/201559?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;Almost everything can be done without glitching on MCU clocked at 96 MHz (96 000 000 clock cylces per second) with 256 KiB (&lt;span id="cwos" class="qv3Wpe"&gt;262 144 bytes&lt;/span&gt;) RAM. There is some more significant issue with the firmware. I think it is easier to fix Maxim firmware in this case. I packed up MAX32620FTHR this weak but I forgot to pack up PICO board for debugging, so I will debug it later this weekend.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201557?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 15:29:29 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:a5ceffc5-3aee-402c-9204-0e034ce6ec63</guid><dc:creator>BigG</dc:creator><slash:comments>2</slash:comments><comments>https://community.element14.com/thread/201557?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;Yep, it is quite complex but I&amp;#39;m trying to simplify the code so that it is easier to understand, and also hopefully, to make sure it does not lock up. At least for now, I know that the sensor can be read and the raw values can be printed without glitching.&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item><item><title>RE: Establishing serial communication over UART instead of USB in MAX25405 EVKIT</title><link>https://community.element14.com/thread/201554?ContentTypeID=1</link><pubDate>Tue, 25 Oct 2022 14:30:26 GMT</pubDate><guid isPermaLink="false">93d5dcb4-84c2-446f-b2cb-99731719e767:b31f3f65-a80c-47df-9244-f39ca0c17a76</guid><dc:creator>rsjawale24</dc:creator><slash:comments>1</slash:comments><comments>https://community.element14.com/thread/201554?ContentTypeID=1</comments><wfw:commentRss>https://community.element14.com/challenges-projects/design-challenges/experimenting-with-gesture-sensors/f/forum/51836/establishing-serial-communication-over-uart-instead-of-usb-in-max25405-evkit/rss?ContentTypeId=0</wfw:commentRss><description>&lt;p&gt;Thanks, I&amp;#39;ll check this. But the gesture algorithm is quite complex, I guess. Here from the raw pixel data it would be difficult to identify the gestures, or maybe a simple gesture sensing algorithm can be devised by reading the raw sensor data.&amp;nbsp;&lt;/p&gt;&lt;div style="clear:both;"&gt;&lt;/div&gt;</description></item></channel></rss>