<?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 Why would the S32 lock up after reading a GPIO PCR? in S32K</title>
    <link>https://community.nxp.com/t5/S32K/Why-would-the-S32-lock-up-after-reading-a-GPIO-PCR/m-p/728362#M1795</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently trying to debug the interaction of a boot-loader and firmware load, and having some issues that seem to be GPIO related. In both programs I'm using the NXP drivers for GPIO initialization, and in PINS_Init() there's a line that tries to read the PCR values:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;uint32_t regValue = config-&amp;gt;base-&amp;gt;PCR[config-&amp;gt;pinPortIdx];&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In assembly, there's a LDR.W instruction which is trying to pull values from the 0x4004D040 address:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;ldr.w&amp;nbsp; &amp;nbsp;r3, [r3, r2, lsl #2] ;Note that R3=0x4004D000 and R2=0x10 here&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Immediately after this instruction, the processor hangs/ goes to the reset handler at 0x450&lt;/P&gt;&lt;P&gt;Some interesting notes are that:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Both the Bootloader and Firmware are trying to reference the same&amp;nbsp;&lt;SPAN&gt;0x4004D040 address, which seems to correspond to Multiplexing Control for PORT-E.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;The first program is able to run this code fine, however the second code that tries to run through its same code fails&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've been digging through the GPIO muxing documentation in the RM, but can't find why just *reading* this register would fail after GPIO has been initialized. Any ideas here?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Fri, 27 Oct 2017 13:44:33 GMT</pubDate>
    <dc:creator>gearhead1107</dc:creator>
    <dc:date>2017-10-27T13:44:33Z</dc:date>
    <item>
      <title>Why would the S32 lock up after reading a GPIO PCR?</title>
      <link>https://community.nxp.com/t5/S32K/Why-would-the-S32-lock-up-after-reading-a-GPIO-PCR/m-p/728362#M1795</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I'm currently trying to debug the interaction of a boot-loader and firmware load, and having some issues that seem to be GPIO related. In both programs I'm using the NXP drivers for GPIO initialization, and in PINS_Init() there's a line that tries to read the PCR values:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;uint32_t regValue = config-&amp;gt;base-&amp;gt;PCR[config-&amp;gt;pinPortIdx];&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;In assembly, there's a LDR.W instruction which is trying to pull values from the 0x4004D040 address:&lt;/P&gt;&lt;BLOCKQUOTE class="jive_macro_quote jive-quote jive_text_macro"&gt;&lt;P&gt;ldr.w&amp;nbsp; &amp;nbsp;r3, [r3, r2, lsl #2] ;Note that R3=0x4004D000 and R2=0x10 here&lt;/P&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;Immediately after this instruction, the processor hangs/ goes to the reset handler at 0x450&lt;/P&gt;&lt;P&gt;Some interesting notes are that:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Both the Bootloader and Firmware are trying to reference the same&amp;nbsp;&lt;SPAN&gt;0x4004D040 address, which seems to correspond to Multiplexing Control for PORT-E.&amp;nbsp;&lt;/SPAN&gt;&lt;/LI&gt;&lt;LI&gt;&lt;SPAN&gt;The first program is able to run this code fine, however the second code that tries to run through its same code fails&lt;/SPAN&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I've been digging through the GPIO muxing documentation in the RM, but can't find why just *reading* this register would fail after GPIO has been initialized. Any ideas here?&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 27 Oct 2017 13:44:33 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Why-would-the-S32-lock-up-after-reading-a-GPIO-PCR/m-p/728362#M1795</guid>
      <dc:creator>gearhead1107</dc:creator>
      <dc:date>2017-10-27T13:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: Why would the S32 lock up after reading a GPIO PCR?</title>
      <link>https://community.nxp.com/t5/S32K/Why-would-the-S32-lock-up-after-reading-a-GPIO-PCR/m-p/728363#M1796</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello gearhead,&lt;/P&gt;&lt;P&gt;With ARM, clocks to the peripheral subsystems are normally gated OFF after reset. Accessing a peripheral that has no clock enabled will result in a hard fault, and the default startup code may make it appear near the reset handler or watchdog handler.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Please be sure to enable the clock group related to all peripherals you intend to access, in this case PORT_E.&lt;/P&gt;&lt;P&gt;See register PCC_PORTE.&lt;/P&gt;&lt;P&gt;-arw&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2017 17:23:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Why-would-the-S32-lock-up-after-reading-a-GPIO-PCR/m-p/728363#M1796</guid>
      <dc:creator>allen_willson</dc:creator>
      <dc:date>2017-10-30T17:23:23Z</dc:date>
    </item>
    <item>
      <title>Re: Why would the S32 lock up after reading a GPIO PCR?</title>
      <link>https://community.nxp.com/t5/S32K/Why-would-the-S32-lock-up-after-reading-a-GPIO-PCR/m-p/728364#M1797</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks, Allen! I've definitely run into very similar issues with the original PE that didn't gate peripherals for you. I hadn't thought about the clocks not being enabled after reset - I'll dig in to confirm but I bet you're right!&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 30 Oct 2017 17:55:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Why-would-the-S32-lock-up-after-reading-a-GPIO-PCR/m-p/728364#M1797</guid>
      <dc:creator>gearhead1107</dc:creator>
      <dc:date>2017-10-30T17:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Why would the S32 lock up after reading a GPIO PCR?</title>
      <link>https://community.nxp.com/t5/S32K/Why-would-the-S32-lock-up-after-reading-a-GPIO-PCR/m-p/728365#M1798</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thank you, this helped solve my problem. For me, I had to manually call&amp;nbsp;&lt;/P&gt;&lt;PRE class="language-c line-numbers"&gt;&lt;CODE&gt;&lt;SPAN class="token function"&gt;PCC_SetClockMode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PCC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PCC_PORTA_CLOCK&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; true&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;PCC_SetClockMode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PCC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PCC_PORTB_CLOCK&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; true&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;PCC_SetClockMode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PCC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PCC_PORTC_CLOCK&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; true&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;PCC_SetClockMode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PCC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PCC_PORTD_CLOCK&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; true&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
&lt;SPAN class="token function"&gt;PCC_SetClockMode&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;PCC&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; PCC_PORTE_CLOCK&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; true&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P class=""&gt;&lt;/P&gt;&lt;P class=""&gt;after&amp;nbsp;&lt;SPAN style="font-family: 'andale mono', monospace;"&gt;CLOCK_SYS_UpdateConfiguration&lt;/SPAN&gt; and before &lt;SPAN style="font-family: 'andale mono', monospace;"&gt;PINS_DRV_Init&lt;/SPAN&gt;, to make the program work.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 19 Aug 2018 20:50:58 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32K/Why-would-the-S32-lock-up-after-reading-a-GPIO-PCR/m-p/728365#M1798</guid>
      <dc:creator>martijnetergo</dc:creator>
      <dc:date>2018-08-19T20:50:58Z</dc:date>
    </item>
  </channel>
</rss>

