<?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 i.mx7 ULP ends up in DefaultISR when using LPI2C1_IRQn in i.MX Processors</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-mx7-ULP-ends-up-in-DefaultISR-when-using-LPI2C1-IRQn/m-p/1367814#M182746</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm currently facing issues while testing I2C interrupts on a costum imx7ulp board.&lt;/P&gt;&lt;P&gt;Using examples provided with IAR works fine (lpi2c_interrupt_transfer). But this example is using an old SDK version: fsl_lpi2c.h with version 2.1.1).&lt;/P&gt;&lt;P&gt;For my project I would like to base my project on the new SDK and therefore I did build a new project with the config tool. After that I copied the I2C master part of the example project mentioned above into my main.cpp:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/*
 * Copyright (c) 2013 - 2015, Freescale Semiconductor, Inc.
 * Copyright 2016-2017 NXP
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include "fsl_device_registers.h"
#include "fsl_debug_console.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"

#include "fsl_lpi2c.h"

lpi2c_master_handle_t g_m_handle;
uint8_t g_master_buff[32];

/*!
 * @brief Main function
 */
int main(void)
{
    char ch;

    /* Init board hardware. */
    BOARD_InitPins();
    BOARD_BootClockRUN();
    BOARD_InitDebugConsole();

    PRINTF("Start CM4 .......................... \r\n");
    
    lpi2c_master_transfer_t masterXfer = {0};
    status_t reVal = kStatus_Fail;
    
    CLOCK_SetIpSrc(kCLOCK_Lpi2c1, kCLOCK_IpSrcFircAsync);
    NVIC_SetPriority(LPI2C1_IRQn, 0);
    lpi2c_master_config_t masterConfig;

    /*
     * masterConfig.debugEnable = false;
     * masterConfig.ignoreAck = false;
     * masterConfig.pinConfig = kLPI2C_2PinOpenDrain;
     * masterConfig.baudRate_Hz = 100000U;
     * masterConfig.busIdleTimeout_ns = 0;
     * masterConfig.pinLowTimeout_ns = 0;
     * masterConfig.sdaGlitchFilterWidth_ns = 0;
     * masterConfig.sclGlitchFilterWidth_ns = 0;
     */
    LPI2C_MasterGetDefaultConfig(&amp;amp;masterConfig);

    /* Change the default baudrate configuration */
    masterConfig.baudRate_Hz = 100000U;

    /* Initialize the LPI2C master peripheral */
    LPI2C_MasterInit(LPI2C1, &amp;amp;masterConfig, CLOCK_GetIpFreq(kCLOCK_Lpi2c1));

    /* Create the LPI2C handle for the non-blocking transfer */
    LPI2C_MasterTransferCreateHandle(LPI2C1, &amp;amp;g_m_handle, NULL, NULL);

    for (int i = 0; i &amp;lt; sizeof(g_master_buff); i++)
    {
        g_master_buff[i] = i;
    }
    /* Setup the master transfer */
    masterXfer.slaveAddress = 0x7E;
    masterXfer.direction = kLPI2C_Write;
    masterXfer.subaddress = 0;
    masterXfer.subaddressSize = 0;
    masterXfer.data = g_master_buff;
    masterXfer.dataSize = sizeof(g_master_buff);
    masterXfer.flags = kLPI2C_TransferDefaultFlag;

    /* Send master non-blocking data to slave */
    reVal = LPI2C_MasterTransferNonBlocking(LPI2C1, &amp;amp;g_m_handle, &amp;amp;masterXfer);

    while (true) {}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;When I execute this I will always end up in the DefaultISR after LPI2C_MasterTransferCreateHandle() function is called.&lt;/P&gt;&lt;P&gt;Any Idea what is going wrong here? For me it looks like I did everything as done in the example. The major difference is, that I'm using a new SDK version (fsl_lpi2c.h: 2.3.0).&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Klaas&lt;/P&gt;</description>
    <pubDate>Mon, 08 Nov 2021 09:37:52 GMT</pubDate>
    <dc:creator>klaas</dc:creator>
    <dc:date>2021-11-08T09:37:52Z</dc:date>
    <item>
      <title>i.mx7 ULP ends up in DefaultISR when using LPI2C1_IRQn</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-mx7-ULP-ends-up-in-DefaultISR-when-using-LPI2C1-IRQn/m-p/1367814#M182746</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I'm currently facing issues while testing I2C interrupts on a costum imx7ulp board.&lt;/P&gt;&lt;P&gt;Using examples provided with IAR works fine (lpi2c_interrupt_transfer). But this example is using an old SDK version: fsl_lpi2c.h with version 2.1.1).&lt;/P&gt;&lt;P&gt;For my project I would like to base my project on the new SDK and therefore I did build a new project with the config tool. After that I copied the I2C master part of the example project mentioned above into my main.cpp:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;/*
 * Copyright (c) 2013 - 2015, Freescale Semiconductor, Inc.
 * Copyright 2016-2017 NXP
 * All rights reserved.
 *
 * SPDX-License-Identifier: BSD-3-Clause
 */

#include "fsl_device_registers.h"
#include "fsl_debug_console.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "board.h"

#include "fsl_lpi2c.h"

lpi2c_master_handle_t g_m_handle;
uint8_t g_master_buff[32];

/*!
 * @brief Main function
 */
int main(void)
{
    char ch;

    /* Init board hardware. */
    BOARD_InitPins();
    BOARD_BootClockRUN();
    BOARD_InitDebugConsole();

    PRINTF("Start CM4 .......................... \r\n");
    
    lpi2c_master_transfer_t masterXfer = {0};
    status_t reVal = kStatus_Fail;
    
    CLOCK_SetIpSrc(kCLOCK_Lpi2c1, kCLOCK_IpSrcFircAsync);
    NVIC_SetPriority(LPI2C1_IRQn, 0);
    lpi2c_master_config_t masterConfig;

    /*
     * masterConfig.debugEnable = false;
     * masterConfig.ignoreAck = false;
     * masterConfig.pinConfig = kLPI2C_2PinOpenDrain;
     * masterConfig.baudRate_Hz = 100000U;
     * masterConfig.busIdleTimeout_ns = 0;
     * masterConfig.pinLowTimeout_ns = 0;
     * masterConfig.sdaGlitchFilterWidth_ns = 0;
     * masterConfig.sclGlitchFilterWidth_ns = 0;
     */
    LPI2C_MasterGetDefaultConfig(&amp;amp;masterConfig);

    /* Change the default baudrate configuration */
    masterConfig.baudRate_Hz = 100000U;

    /* Initialize the LPI2C master peripheral */
    LPI2C_MasterInit(LPI2C1, &amp;amp;masterConfig, CLOCK_GetIpFreq(kCLOCK_Lpi2c1));

    /* Create the LPI2C handle for the non-blocking transfer */
    LPI2C_MasterTransferCreateHandle(LPI2C1, &amp;amp;g_m_handle, NULL, NULL);

    for (int i = 0; i &amp;lt; sizeof(g_master_buff); i++)
    {
        g_master_buff[i] = i;
    }
    /* Setup the master transfer */
    masterXfer.slaveAddress = 0x7E;
    masterXfer.direction = kLPI2C_Write;
    masterXfer.subaddress = 0;
    masterXfer.subaddressSize = 0;
    masterXfer.data = g_master_buff;
    masterXfer.dataSize = sizeof(g_master_buff);
    masterXfer.flags = kLPI2C_TransferDefaultFlag;

    /* Send master non-blocking data to slave */
    reVal = LPI2C_MasterTransferNonBlocking(LPI2C1, &amp;amp;g_m_handle, &amp;amp;masterXfer);

    while (true) {}
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;When I execute this I will always end up in the DefaultISR after LPI2C_MasterTransferCreateHandle() function is called.&lt;/P&gt;&lt;P&gt;Any Idea what is going wrong here? For me it looks like I did everything as done in the example. The major difference is, that I'm using a new SDK version (fsl_lpi2c.h: 2.3.0).&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;Klaas&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 09:37:52 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-mx7-ULP-ends-up-in-DefaultISR-when-using-LPI2C1-IRQn/m-p/1367814#M182746</guid>
      <dc:creator>klaas</dc:creator>
      <dc:date>2021-11-08T09:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: i.mx7 ULP ends up in DefaultISR when using LPI2C1_IRQn</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-mx7-ULP-ends-up-in-DefaultISR-when-using-LPI2C1-IRQn/m-p/1367846#M182751</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I found the issue. My project was configured to C++ instead of C as for the example.&lt;/P&gt;&lt;P&gt;Now I have to figure out how this works with C++...&lt;/P&gt;&lt;P&gt;Thanks anyway&lt;BR /&gt;Klaas&lt;/P&gt;</description>
      <pubDate>Mon, 08 Nov 2021 10:32:30 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-mx7-ULP-ends-up-in-DefaultISR-when-using-LPI2C1-IRQn/m-p/1367846#M182751</guid>
      <dc:creator>klaas</dc:creator>
      <dc:date>2021-11-08T10:32:30Z</dc:date>
    </item>
    <item>
      <title>Re: i.mx7 ULP ends up in DefaultISR when using LPI2C1_IRQn</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-mx7-ULP-ends-up-in-DefaultISR-when-using-LPI2C1-IRQn/m-p/1368287#M182778</link>
      <description>&lt;P&gt;Glad to hear that the problem is solved.&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Artur&lt;/P&gt;</description>
      <pubDate>Tue, 09 Nov 2021 07:18:23 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-mx7-ULP-ends-up-in-DefaultISR-when-using-LPI2C1-IRQn/m-p/1368287#M182778</guid>
      <dc:creator>art</dc:creator>
      <dc:date>2021-11-09T07:18:23Z</dc:date>
    </item>
  </channel>
</rss>

