<?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: KL65 ADC Implementation Hard Fault Error in Processor Expert Software</title>
    <link>https://community.nxp.com/t5/Processor-Expert-Software/KL65-ADC-Implementation-Hard-Fault-Error/m-p/1351171#M4853</link>
    <description>&lt;P&gt;Hi did you solve it? I have the same problem with K66.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2021 13:25:18 GMT</pubDate>
    <dc:creator>msembira</dc:creator>
    <dc:date>2021-10-06T13:25:18Z</dc:date>
    <item>
      <title>KL65 ADC Implementation Hard Fault Error</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/KL65-ADC-Implementation-Hard-Fault-Error/m-p/638977#M3975</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using FreeRTOS am implementing several ADC channels using PE to generate code. &amp;nbsp;When I execute the code I hit a hard fault because it's trying to run the following line of code...&lt;/P&gt;&lt;P&gt;&lt;STRONG style="color: #51626f; background-color: #ffffff; border: 0px; font-weight: bold;"&gt;ADC1_CFG2 |= ADC_CFG2_MUXSEL_MASK;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The code tries to execute a write to a register that isn't initialized yet.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Has anyone else run into this issue and have you found a solution. &amp;nbsp;This is very frustrating.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Full code for the init_adc_pins function is as follows...&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;void init_adc_pins(uint32_t instance)&lt;BR /&gt;{&lt;BR /&gt; switch(instance) { &lt;BR /&gt; case ADC0_IDX: /* ADC0_IDX */&lt;BR /&gt; /* Affects PORTB_PCR0 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTB,0UL,kPortPinDisabled);&lt;BR /&gt; /* Affects PORTB_PCR1 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTB,1UL,kPortPinDisabled);&lt;BR /&gt; break;&lt;BR /&gt; case ADC1_IDX: /* ADC1_IDX */&lt;BR /&gt; /* Affects PORTB_PCR0 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTB,0UL,kPortPinDisabled);&lt;BR /&gt; /* Affects PORTB_PCR1 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTB,1UL,kPortPinDisabled);&lt;BR /&gt; /* Affects PORTB_PCR4 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTB,4UL,kPortPinDisabled);&lt;BR /&gt; /* Affects PORTB_PCR5 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTB,5UL,kPortPinDisabled);&lt;BR /&gt; /* Affects PORTB_PCR10 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTB,10UL,kPortPinDisabled);&lt;BR /&gt; /* Affects PORTB_PCR11 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTB,11UL,kPortPinDisabled);&lt;BR /&gt; /* ADC1_CFG2: MUXSEL=1 */&lt;BR /&gt; &lt;STRONG&gt;ADC1_CFG2 |= ADC_CFG2_MUXSEL_MASK; &amp;nbsp;&amp;lt;-----(This being my issue)&lt;/STRONG&gt;&lt;BR /&gt; /* Affects PORTC_PCR8 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTC,8UL,kPortPinDisabled);&lt;BR /&gt; /* Affects PORTC_PCR9 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTC,9UL,kPortPinDisabled);&lt;BR /&gt; /* Affects PORTC_PCR10 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTC,10UL,kPortPinDisabled);&lt;BR /&gt; /* Affects PORTC_PCR11 register */&lt;BR /&gt; PORT_HAL_SetMuxMode(PORTC,11UL,kPortPinDisabled);&lt;BR /&gt; break;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 15 Feb 2017 20:11:13 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/KL65-ADC-Implementation-Hard-Fault-Error/m-p/638977#M3975</guid>
      <dc:creator>grantcazinha</dc:creator>
      <dc:date>2017-02-15T20:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: KL65 ADC Implementation Hard Fault Error</title>
      <link>https://community.nxp.com/t5/Processor-Expert-Software/KL65-ADC-Implementation-Hard-Fault-Error/m-p/1351171#M4853</link>
      <description>&lt;P&gt;Hi did you solve it? I have the same problem with K66.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 13:25:18 GMT</pubDate>
      <guid>https://community.nxp.com/t5/Processor-Expert-Software/KL65-ADC-Implementation-Hard-Fault-Error/m-p/1351171#M4853</guid>
      <dc:creator>msembira</dc:creator>
      <dc:date>2021-10-06T13:25:18Z</dc:date>
    </item>
  </channel>
</rss>

