<?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: S32K HardFault exception in S32K</title>
    <link>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895375#M4370</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes we are calling the function OSA_EventSet which comes from&amp;nbsp;fsl_os_abstraction that we ported from the KW36 SDK.&lt;/P&gt;&lt;P&gt;This function is calling API from FreeRTOS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 22 May 2019 06:17:07 GMT</pubDate>
    <dc:creator>antoine_monmarc</dc:creator>
    <dc:date>2019-05-22T06:17:07Z</dc:date>
    <item>
      <title>S32K HardFault exception</title>
      <link>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895372#M4367</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm having an issue with FreeRTOS on S32K.&lt;/P&gt;&lt;P&gt;The issue is very similar to what is describe here:&amp;nbsp;&lt;A _jive_internal="true" href="https://community.nxp.com/thread/422337"&gt;https://community.nxp.com/thread/422337&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I am getting random HardFault issue in function uxListRemove.&lt;/P&gt;&lt;P&gt;Sometimes also "The processor has escalated a configurable-priority exception to HardFault. An instruction executed with an invalid EPSR.T or EPSR.IT field. Exception occured at: 0x0"&lt;BR /&gt;I'm using IAR compiler and IDE and it doesn't give me the callstack when the HardFault issue occurs.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My Freertos configuration is the same as in S32K SDK example:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;#define configLIBRARY_LOWEST_INTERRUPT_PRIORITY 0x0F&lt;BR /&gt;#define configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY 0x05&lt;/P&gt;&lt;P&gt;&lt;BR /&gt; #define configKERNEL_INTERRUPT_PRIORITY (configLIBRARY_LOWEST_INTERRUPT_PRIORITY &amp;lt;&amp;lt; (8-configPRIO_BITS))&lt;BR /&gt; #define configMAX_SYSCALL_INTERRUPT_PRIORITY (configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY &amp;lt;&amp;lt; (8-configPRIO_BITS))&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My project uses UART interrupts, CAN interrupts and FreeRTOS xTimer along with 4 tasks and the IDLE task.&lt;/P&gt;&lt;P&gt;CAN bus (500kbps) is receiving 8 frames every 100ms and sending 1 frame every 100ms&lt;/P&gt;&lt;P&gt;UART is sending 13Bytes every 100ms (921kbps)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I'm using a 10ms timer to poll the UART reception. When this timer is disabled, the HardFault issue doesn't occur.&lt;/P&gt;&lt;P&gt;I tried to changed the FreeRTOS default timer configuration but it doesn't give any good result.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Do you have any advice on how to find the root cause of this issue?&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2019 13:48:54 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895372#M4367</guid>
      <dc:creator>antoine_monmarc</dc:creator>
      <dc:date>2019-05-15T13:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: S32K HardFault exception</title>
      <link>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895373#M4368</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I believed I found the issue but not 100% sure.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Initially I though it was related to my timer but I enabled configASSERT option in FreeRTOS to check the interrupt configuration and found that my CAN interrupt had a priority set to 0.&lt;/P&gt;&lt;P&gt;In the CAN interrupt I'm setting FreeRTOS Event (which was configured with&amp;nbsp;configLIBRARY_MAX_SYSCALL_INTERRUPT_PRIORITY=1). So the first CAN INT received was triggering&amp;nbsp;&lt;SPAN&gt;configASSERT.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;After setting the CAN priority to 1, I'm not able to reproduce my issue.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;My UART Interrupt still as priority 0 but it doesn't use FreeRTOS call so I should be safe.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Not sure if it's the best way to fix this issue but it seems to have worked for me.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 May 2019 16:04:10 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895373#M4368</guid>
      <dc:creator>antoine_monmarc</dc:creator>
      <dc:date>2019-05-15T16:04:10Z</dc:date>
    </item>
    <item>
      <title>Re: S32K HardFault exception</title>
      <link>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895374#M4369</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class=""&gt;Hi Antoine monmarché &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Sorry for the late reply. Ok, so if your last implementation works correctly, this tells us that this is the correct implementation for this. I would recommend you verifying the CAN interrupt handler that you have implemented along with FreeRTOS, does this use something related with FreeRTOS? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Jorge Alcala&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2019 01:25:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895374#M4369</guid>
      <dc:creator>jorge_a_vazquez</dc:creator>
      <dc:date>2019-05-22T01:25:59Z</dc:date>
    </item>
    <item>
      <title>Re: S32K HardFault exception</title>
      <link>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895375#M4370</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello Jorge,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Yes we are calling the function OSA_EventSet which comes from&amp;nbsp;fsl_os_abstraction that we ported from the KW36 SDK.&lt;/P&gt;&lt;P&gt;This function is calling API from FreeRTOS.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 22 May 2019 06:17:07 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895375#M4370</guid>
      <dc:creator>antoine_monmarc</dc:creator>
      <dc:date>2019-05-22T06:17:07Z</dc:date>
    </item>
    <item>
      <title>Re: S32K HardFault exception</title>
      <link>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895376#M4371</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;SPAN class=""&gt;Hi Antoine monmarché &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;It is not recommendable using FreeRTOS APIs inside interrupt handler when you are working in a FreeRTOS environment, this is a good practice in order to have control between the tasks and the interrupt handlers.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Also, when you are working with an RTOS, your interruption priorities shouldn't be smaller than the system call of the scheduler because the scheduler needs to work only when the CPU doesn't have any other interruption to handle. Please change both CAN and UART interrupt priorities to be bigger than your syscall (which in your example is 1).&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Best regards&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;Jorge Alcala&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2019 15:49:02 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/S32K-HardFault-exception/m-p/895376#M4371</guid>
      <dc:creator>jorge_a_vazquez</dc:creator>
      <dc:date>2019-05-23T15:49:02Z</dc:date>
    </item>
  </channel>
</rss>

