<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: When I change a floating-point value to an integer inside a function, the program doesn't execut in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2025321#M12955</link>
    <description>&lt;P&gt;Do you mean the “Disassembly&lt;SPAN&gt;”？&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="defaultISRProblem1.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/318865i369FB853C7398F42/image-size/large?v=v2&amp;amp;px=999" role="button" title="defaultISRProblem1.png" alt="defaultISRProblem1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jan 2025 01:38:11 GMT</pubDate>
    <dc:creator>TanTianLong</dc:creator>
    <dc:date>2025-01-10T01:38:11Z</dc:date>
    <item>
      <title>When I change a floating-point value to an integer inside a function, the program doesn't execute</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2015658#M12868</link>
      <description>&lt;DIV&gt;When I used S32DS.ARM.2.2 software to compile the project, I had a problem. When I changed an integer value to a floating-point type inside a function, such as 20 to 20.0, the compiled map file had some more link content, and the program ran normally, but when I changed 20.0 to 20, it did not run normally. The program did not enter initialization.&lt;/DIV&gt;&lt;DIV&gt;Products:FS32K144HAT0MLLT&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="When I changed 20 to 20.0, the program ran normally, but the program could not enter the initialization with the value 20, and the app would stop at DefaultISR (in debug mode) after jumping from bootloader to this app" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/316374iBC333CF0B6BC8FE3/image-size/large?v=v2&amp;amp;px=999" role="button" title="question1.png" alt="When I changed 20 to 20.0, the program ran normally, but the program could not enter the initialization with the value 20, and the app would stop at DefaultISR (in debug mode) after jumping from bootloader to this app" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;When I changed 20 to 20.0, the program ran normally, but the program could not enter the initialization with the value 20, and the app would stop at DefaultISR (in debug mode) after jumping from bootloader to this app&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="When I change 20 to 20.0, the map file has a few more library links" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/316373i9E7D7306558CB25B/image-size/large?v=v2&amp;amp;px=999" role="button" title="question2.png" alt="When I change 20 to 20.0, the map file has a few more library links" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;When I change 20 to 20.0, the map file has a few more library links&lt;/span&gt;&lt;/span&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="bootloader jumps to app and enters DefaultISR" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/316375iD122F73DEE170BBA/image-size/large?v=v2&amp;amp;px=999" role="button" title="question3.png" alt="bootloader jumps to app and enters DefaultISR" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;bootloader jumps to app and enters DefaultISR&lt;/span&gt;&lt;/span&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 18 Dec 2024 01:37:20 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2015658#M12868</guid>
      <dc:creator>TanTianLong</dc:creator>
      <dc:date>2024-12-18T01:37:20Z</dc:date>
    </item>
    <item>
      <title>回复： When I change a floating-point value to an integer inside a function, the program doesn't execut</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2021183#M12903</link>
      <description>&lt;P&gt;&lt;SPAN&gt;The problem I've found so far is the 64-bit arithmetic. I defined 64-bit local variables inside a function and did all the arithmetic, including division. When I changed the variable to 32 bits, the program worked. This is where another problem I found earlier is to comment out the 64-bit arithmetic inside the function. So far, the accuracy of the algorithm has dropped, but the program is working. But I don't know why that decimal point makes this 64-bit operation work.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="defaultISRProblem1.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/317847iF3C22B7DD4A31E1B/image-size/large?v=v2&amp;amp;px=999" role="button" title="defaultISRProblem1.png" alt="defaultISRProblem1.png" /&gt;&lt;/span&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I targeted this 64-bit operation because: I mentioned in the previous diagram that the program doesn't run, it stops at DefaultISR, WDOG_EWM_IRQHandler is displayed, and on the next line is __aeabi_uldivmod, which is a function (presumably added by the compiler) that performs division and modulo on long unsigned integers, with only one place in the program where 64-bit arithmetic is used. So I've targeted the problem here. In practice, this action does have an effect on the program. I couldn't find a good explanation for the effect of floating-point on 64-bit operations&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 09:00:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2021183#M12903</guid>
      <dc:creator>TanTianLong</dc:creator>
      <dc:date>2025-01-02T09:00:36Z</dc:date>
    </item>
    <item>
      <title>Re: When I change a floating-point value to an integer inside a function, the program doesn't execut</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2021236#M12904</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;which types are bat1 and bat3? They are float? If So, it is nonsense use abs function. abs() accepts integers and return integer as well. Also is nonsense compare floats like if (bat1 == 0) - if bat1 is float.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 10:00:32 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2021236#M12904</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2025-01-02T10:00:32Z</dc:date>
    </item>
    <item>
      <title>Re: When I change a floating-point value to an integer inside a function, the program doesn't execut</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2021265#M12905</link>
      <description>No,they are uint16_t</description>
      <pubDate>Thu, 02 Jan 2025 10:43:31 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2021265#M12905</guid>
      <dc:creator>TanTianLong</dc:creator>
      <dc:date>2025-01-02T10:43:31Z</dc:date>
    </item>
    <item>
      <title>Re: When I change a floating-point value to an integer inside a function, the program doesn't execut</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2024434#M12951</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="https://community.nxp.com/t5/user/viewprofilepage/user-id/159987"&gt;@jiri_kral&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="TanTianLong_0-1736391670119.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/318700i18229B8601E1AD91/image-size/medium?v=v2&amp;amp;px=400" role="button" title="TanTianLong_0-1736391670119.png" alt="TanTianLong_0-1736391670119.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Did you see my response?&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 03:07:06 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2024434#M12951</guid>
      <dc:creator>TanTianLong</dc:creator>
      <dc:date>2025-01-09T03:07:06Z</dc:date>
    </item>
    <item>
      <title>Re: When I change a floating-point value to an integer inside a function, the program doesn't execut</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2024655#M12952</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I tried reproduce it on my side, but no success. Do you know which exact instruction in disassembly invoke the exception? Because it doesn't make sense at all.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm suspecting that if you put float instead of int, the comparison between int and float makes that the function return 0 (I'm not sure if the return 0 is the correct or return 1 is the correct. Typically return 0 means no error.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also implement fault handler to figure out what exactly happens -&amp;nbsp;&lt;A href="https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447" target="_blank"&gt;https://community.nxp.com/t5/S32K-Knowledge-Base/Fault-handling-on-S32K14x/ta-p/1114447&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2025 08:44:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2024655#M12952</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2025-01-09T08:44:47Z</dc:date>
    </item>
    <item>
      <title>Re: When I change a floating-point value to an integer inside a function, the program doesn't execut</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2025321#M12955</link>
      <description>&lt;P&gt;Do you mean the “Disassembly&lt;SPAN&gt;”？&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="defaultISRProblem1.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/318865i369FB853C7398F42/image-size/large?v=v2&amp;amp;px=999" role="button" title="defaultISRProblem1.png" alt="defaultISRProblem1.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 01:38:11 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2025321#M12955</guid>
      <dc:creator>TanTianLong</dc:creator>
      <dc:date>2025-01-10T01:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: When I change a floating-point value to an integer inside a function, the program doesn't execut</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2025807#M12962</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;in Debug session you can switch into single instruction mode&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jiri_kral_0-1736512480660.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/318982iEDE0910481450CF4/image-size/large?v=v2&amp;amp;px=999" role="button" title="jiri_kral_0-1736512480660.png" alt="jiri_kral_0-1736512480660.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;and you can step by one instruction in disassembly window (the window appears when single instruction step is enabled) to find out which exact instruction invoke the exception:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="jiri_kral_1-1736512559106.png" style="width: 999px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/318983i7D3EDF6AC56A6BB5/image-size/large?v=v2&amp;amp;px=999" role="button" title="jiri_kral_1-1736512559106.png" alt="jiri_kral_1-1736512559106.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 12:36:36 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2025807#M12962</guid>
      <dc:creator>jiri_kral</dc:creator>
      <dc:date>2025-01-10T12:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: When I change a floating-point value to an integer inside a function, the program doesn't execut</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2026233#M12970</link>
      <description>&lt;P&gt;The failed program cannot be debugged single-step, and once you enter the program, you enter DefaultISR&lt;/P&gt;</description>
      <pubDate>Mon, 13 Jan 2025 01:20:47 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/When-I-change-a-floating-point-value-to-an-integer-inside-a/m-p/2026233#M12970</guid>
      <dc:creator>TanTianLong</dc:creator>
      <dc:date>2025-01-13T01:20:47Z</dc:date>
    </item>
  </channel>
</rss>

