<?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 Hard fault initialising GPIO port in S32 Design Studio</title>
    <link>https://community.nxp.com/t5/S32-Design-Studio/Hard-fault-initialising-GPIO-port/m-p/1779450#M11617</link>
    <description>&lt;P&gt;Every time I create a new S32K144 project I fall into the same trap and I can never remember how to get out of it &lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;I am using a FS32K144 48-pin device to provide simple digital I/O and a UART. I am using the internal fast 48MHz clock. I have setup all my clocks and all my digital I/O ports and built the project. I am initialising the hardware as follows:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//
// Setup clocks.
//
// CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
// CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);
CLOCK_DRV_Init(&amp;amp;clockMan1_InitConfig0);

//
// Setup Digital I/O.
//
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);

//
// LPUART (430600, n, 8, 1)
//
LPUART_DRV_Init(lpUartInstance, lpUartState, lpUartInitConfig);
LPUART_DRV_InstallRxCallback(lpUartInstance, rxCallback, NULL);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;When I debug the code I get the following:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Initializing.
Target has been RESET and is active.
BusFault: A precise (synchronous) data access error has occurred.
Possible BusFault location: 0x40049000.
HardFault: A fault has been escalated to a hard fault.
&lt;/LI-CODE&gt;&lt;P&gt;Again, as before, the fault is thrown on this line in PINS_Init:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;uint32_t regValue = config-&amp;gt;base-&amp;gt;PCR[config-&amp;gt;pinPortIdx];&lt;/LI-CODE&gt;&lt;P&gt;If I hover over PCR, I seem to get the correct port A address&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArkAndyFraser_0-1703426176427.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/255724i3C089C8FCF339ABA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ArkAndyFraser_0-1703426176427.png" alt="ArkAndyFraser_0-1703426176427.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what I am doing wrong? - again &lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;</description>
    <pubDate>Sun, 24 Dec 2023 13:58:59 GMT</pubDate>
    <dc:creator>ArkAndyFraser</dc:creator>
    <dc:date>2023-12-24T13:58:59Z</dc:date>
    <item>
      <title>Hard fault initialising GPIO port</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Hard-fault-initialising-GPIO-port/m-p/1779450#M11617</link>
      <description>&lt;P&gt;Every time I create a new S32K144 project I fall into the same trap and I can never remember how to get out of it &lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;I am using a FS32K144 48-pin device to provide simple digital I/O and a UART. I am using the internal fast 48MHz clock. I have setup all my clocks and all my digital I/O ports and built the project. I am initialising the hardware as follows:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;//
// Setup clocks.
//
// CLOCK_SYS_Init(g_clockManConfigsArr, CLOCK_MANAGER_CONFIG_CNT, g_clockManCallbacksArr, CLOCK_MANAGER_CALLBACK_CNT);
// CLOCK_SYS_UpdateConfiguration(0U, CLOCK_MANAGER_POLICY_AGREEMENT);
CLOCK_DRV_Init(&amp;amp;clockMan1_InitConfig0);

//
// Setup Digital I/O.
//
PINS_DRV_Init(NUM_OF_CONFIGURED_PINS0, g_pin_mux_InitConfigArr0);

//
// LPUART (430600, n, 8, 1)
//
LPUART_DRV_Init(lpUartInstance, lpUartState, lpUartInitConfig);
LPUART_DRV_InstallRxCallback(lpUartInstance, rxCallback, NULL);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;When I debug the code I get the following:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;Initializing.
Target has been RESET and is active.
BusFault: A precise (synchronous) data access error has occurred.
Possible BusFault location: 0x40049000.
HardFault: A fault has been escalated to a hard fault.
&lt;/LI-CODE&gt;&lt;P&gt;Again, as before, the fault is thrown on this line in PINS_Init:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;uint32_t regValue = config-&amp;gt;base-&amp;gt;PCR[config-&amp;gt;pinPortIdx];&lt;/LI-CODE&gt;&lt;P&gt;If I hover over PCR, I seem to get the correct port A address&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="ArkAndyFraser_0-1703426176427.png" style="width: 400px;"&gt;&lt;img src="https://community.nxp.com/t5/image/serverpage/image-id/255724i3C089C8FCF339ABA/image-size/medium?v=v2&amp;amp;px=400" role="button" title="ArkAndyFraser_0-1703426176427.png" alt="ArkAndyFraser_0-1703426176427.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any idea what I am doing wrong? - again &lt;LI-EMOJI id="lia_disappointed-face" title=":disappointed_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2023 13:58:59 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Hard-fault-initialising-GPIO-port/m-p/1779450#M11617</guid>
      <dc:creator>ArkAndyFraser</dc:creator>
      <dc:date>2023-12-24T13:58:59Z</dc:date>
    </item>
    <item>
      <title>Re: Hard fault initialising GPIO port</title>
      <link>https://community.nxp.com/t5/S32-Design-Studio/Hard-fault-initialising-GPIO-port/m-p/1779456#M11618</link>
      <description>&lt;P&gt;Nevermind - I still had the external clock input enabled even though I don't have an external clock !&lt;/P&gt;&lt;P&gt;Andy&lt;/P&gt;</description>
      <pubDate>Sun, 24 Dec 2023 15:31:03 GMT</pubDate>
      <guid>https://community.nxp.com/t5/S32-Design-Studio/Hard-fault-initialising-GPIO-port/m-p/1779456#M11618</guid>
      <dc:creator>ArkAndyFraser</dc:creator>
      <dc:date>2023-12-24T15:31:03Z</dc:date>
    </item>
  </channel>
</rss>

