AM2634: Issue with I2C3 Receive Interrupt on AM263x LP Kit

Part Number: AM2634
Other Parts Discussed in Thread: SYSCONFIG,

Tool/software:

Hi Team,

I am trying to run I2C3 with a receive interrupt in slave mode on the AM263x LP kit, but we are not able to call the ISR function. Could you please let me know what I might be missing?

In addition, I am facing another issue — the I2C communication is happening and data is being exchanged between I2C_ICDXR and I2C_CDRR, but the data is not being copied into the variable. Could you let me know why this might be happening?

I am sharing my main.c, SysConfig file, and some UART log files for your reference. Please check and advise.

Note-: I have shorted I2C1 and I2C3 just only for reduce the HW connection. I am facing same issue with other MCU I2C also.

/*
 *  Copyright (C) 2018-2022 Texas Instruments Incorporated
 *
 *  Redistribution and use in source and binary forms, with or without
 *  modification, are permitted provided that the following conditions
 *  are met:
 *
 *    Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 *
 *    Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the
 *    distribution.
 *
 *    Neither the name of Texas Instruments Incorporated nor the names of
 *    its contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
 *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
 *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
 *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
 *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
 *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
 *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
 */

#include <stdlib.h>
#include "ti_drivers_config.h"
#include "ti_board_config.h"
#include <drivers/soc.h>
#include <drivers/i2c/v1/lld/i2c_lld.h>
#include <drivers/hw_include/cslr_i2c.h>
#include "ti_drivers_open_close.h"
#include <kernel/dpl/HwiP.h>
#include <drivers/hw_include/soc_config.h>
#include <drivers/hw_include/cslr_soc.h>
#include <kernel/nortos/dpl/r5/HwiP_armv7r_vim.h>

#define I2C_TIMEOUT       (5000U)
#define I2C_INTERRUPT_PRIORITY          (4U)

I2CLLD_Handle I2C3,I2C1;


uint8_t tx_byte = 0x0A,rx_byte=0x00,count=1;


I2C_ExtendedParams I2C3_RX_Params,I2C3_TX_Params,I2C1_RX_Params,I2C1_TX_Params;

I2CLLD_Handle gI2cLldHandle3;
uint32_t gI2cVimStsAddr, intrNum, gI2cVimStsClrMask, intcBaseAddr;

HwiP_Params     hwiPrms;
HwiP_Object         gGpioHwiObject;

HwiP_Config gHwiConfig3 = {
    .intcBaseAddr = 0x50F00000u,
};


void gpio_led_blink_main(void *args);

static void i2c_isr(void *args,const I2CLLD_Transaction * targetTxn,int32_t transferStatus);

static __attribute__((__section__(".text.hwi"), noinline, naked, target("arm"), aligned(4))) void App_I2C_ISR(void);


void print_dat(void)
{
    DebugP_log("Tx_Byte = 0x%02X, Rx_Byte = 0x%02X,\n\r",tx_byte,rx_byte);
//    DebugP_log("BRD Send = {");
//  for(int i=0; i<txlen; i++)
//  {
//      DebugP_log("0x%02X,",txdata[i]);
//  }
//  DebugP_log("} \n\r");
//  DebugP_log("AM263x Rec = {");
//  for(int i=0; i<rxlen; i++)
//  {
//      DebugP_log("0x%02X,",rxdata[i]);
//      rxdata[i] = 0;
//  }
//  DebugP_log("} \n\n\r");
}



void printRegisterRange(void)
{
    uint32_t startAddr = 0x52503004UL;
    uint32_t endAddr   = 0x52503008UL;

    for (uint32_t addr = startAddr; addr <= endAddr; addr += 4)
    {
        uint32_t val = *(volatile uint32_t *)addr;
        DebugP_log("0x%08X : 0x%08X\r\n", addr, val);
    }
    uint32_t addr1   = 0x52501020UL;
    uint32_t val1 = *(volatile uint32_t *)addr1;
    DebugP_log("0x%08X : 0x%08X\r\n", addr1, val1);

    uint32_t addr3   = 0x52503018UL;
    uint32_t val3 = *(volatile uint32_t *)addr3;
    DebugP_log("0x%08X : 0x%08X\r\n", addr3, val3);
}


static __attribute__((__section__(".text.hwi"), noinline, naked, target("arm"), aligned(4))) void App_I2C_ISR(void)
{
    ISR_CALL_LEVEL_NONFLOAT_REENTRANT(I2C_lld_controllerIsr, \
                                    gI2cLldHandle3, \
                                    intrNum, \
                                    gI2cVimStsAddr, \
                                    gI2cVimStsClrMask,
                                    intcBaseAddr);
}


static void i2c_isr(void *args,const I2CLLD_Transaction * targetTxn,int32_t transferStatus)
{
     tx_byte = 0xAB;
     count++;

}
void init_i2c_int(void)
{
    gI2cLldHandle3 =  (I2CLLD_Handle)(gI2cLldHandle[CONFIG_I2C3]);
    intrNum = gI2cLldHandle3->intrNum;
    intcBaseAddr = gHwiConfig3.intcBaseAddr;
    gI2cVimStsAddr = intcBaseAddr + (0x404u + (((intrNum)>> 5) & 0xFu) * 0x20u);
    gI2cVimStsClrMask = 0x1u << ((intrNum) & 0x1Fu);
    gI2cLldHandle3->targetTransferCompleteCallback = i2c_isr;
    HwiP_setVecAddr(intrNum, (uintptr_t)&App_I2C_ISR);
    HwiP_setPri(intrNum, I2C_INTERRUPT_PRIORITY);
    HwiP_enableInt(intrNum);

}



int main(void)
{
    System_init();
    Board_init();
    Drivers_open();
  I2C3 = (I2CLLD_Handle)(gI2cLldHandle[CONFIG_I2C3]);
  I2C1 = (I2CLLD_Handle)(gI2cLldHandle[CONFIG_I2C1]);

  I2C1->i2cMsg.controllerMode = true;
  I2C1_TX_Params.deviceAddress = 0x53;
  I2C1_TX_Params.buffer = &tx_byte;
  I2C1_TX_Params.size   = 1U;
  I2C1_TX_Params.expandSA = false;

  I2C3->i2cMsg.targetAddress = 0x40;
  I2C3_RX_Params.buffer = &rx_byte;
  I2C3_RX_Params.size   = 1U;
  I2C3_RX_Params.expandSA = false;
  GPIO_pinWriteHigh(CSL_GPIO0_U_BASE, GPIO_LED_PIN);
  printRegisterRange();
  print_dat();
  init_i2c_int();
    while(1)
    {

         printRegisterRange();
         I2C_lld_write(I2C1, &I2C1_TX_Params, 100);
         I2C_lld_target_read(I2C3, &I2C3_RX_Params, 100);
         ClockP_sleep(1);
         DebugP_log("GPIO LED Blinking...%d\r\n",count);
         print_dat();
 //        tx_byte++;
         if(tx_byte > 0xF0)
         {
             tx_byte = 0x0A;
         }

    }

    Board_deinit();
    System_deinit();

    return 0;
}
/**
 * These arguments were used when this file was generated. They will be automatically applied on subsequent loads
 * via the GUI or CLI. Run CLI with '--help' for additional information on how to override these arguments.
 * @cliArgs --device "AM263x_beta" --part "AM263x" --package "ZCZ" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM263x@10.02.00"
 * @v2CliArgs --device "AM2634" --package "NFBGA (ZCZ)" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM263x@10.02.00"
 * @versions {"tool":"1.23.0+4000"}
 */

/**
 * Import the modules used in this configuration.
 */
const gpio            = scripting.addModule("/drivers/gpio/gpio", {}, false);
const gpio1           = gpio.addInstance();
const i2c             = scripting.addModule("/drivers/i2c/i2c");
const i2c1            = i2c.addInstance();
const i2c2            = i2c.addInstance();
const debug_log       = scripting.addModule("/kernel/dpl/debug_log");
const dpl_cfg         = scripting.addModule("/kernel/dpl/dpl_cfg");
const mpu_armv7       = scripting.addModule("/kernel/dpl/mpu_armv7", {}, false);
const mpu_armv71      = mpu_armv7.addInstance();
const mpu_armv72      = mpu_armv7.addInstance();
const mpu_armv73      = mpu_armv7.addInstance();
const mpu_armv74      = mpu_armv7.addInstance();
const default_linker  = scripting.addModule("/memory_configurator/default_linker", {}, false);
const default_linker1 = default_linker.addInstance();
const general         = scripting.addModule("/memory_configurator/general", {}, false);
const general1        = general.addInstance();
const region          = scripting.addModule("/memory_configurator/region", {}, false);
const region1         = region.addInstance();
const section         = scripting.addModule("/memory_configurator/section", {}, false);
const section1        = section.addInstance();
const section2        = section.addInstance();
const section3        = section.addInstance();
const section4        = section.addInstance();
const section5        = section.addInstance();
const section6        = section.addInstance();
const section7        = section.addInstance();
const section8        = section.addInstance();
const section9        = section.addInstance();
const section10       = section.addInstance();
const section11       = section.addInstance();
const section12       = section.addInstance();

/**
 * Write custom configuration values to the imported modules.
 */
gpio1.$name          = "GPIO_LED";
gpio1.pinDir         = "OUTPUT";
gpio1.rx             = true;
gpio1.GPIO_n.$assign = "UART0_CTSn";

i2c1.$name           = "CONFIG_I2C3";
i2c1.enableIntr      = false;
i2c1.sdkInfra        = "LLD";
i2c1.ownTargetAddr   = 0x53;
i2c1.I2C.$assign     = "I2C3";
i2c1.I2C_child.$name = "drivers_i2c_v1_i2c_v1_template0";

i2c2.$name           = "CONFIG_I2C1";
i2c2.sdkInfra        = "LLD";
i2c2.ownTargetAddr   = 0x40;
i2c2.I2C.$assign     = "I2C1";
i2c2.I2C_child.$name = "drivers_i2c_v1_i2c_v1_template1";

debug_log.enableUartLog            = true;
debug_log.uartLog.$name            = "CONFIG_UART0";
debug_log.uartLog.UART.$assign     = "UART0";
debug_log.uartLog.UART.RXD.$assign = "UART0_RXD";
debug_log.uartLog.UART.TXD.$assign = "UART0_TXD";
debug_log.uartLog.child.$name      = "drivers_uart_v2_uart_v2_template0";

mpu_armv71.$name             = "CONFIG_MPU_REGION0";
mpu_armv71.size              = 31;
mpu_armv71.attributes        = "Device";
mpu_armv71.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv71.allowExecute      = false;

mpu_armv72.$name             = "CONFIG_MPU_REGION1";
mpu_armv72.size              = 15;
mpu_armv72.accessPermissions = "Supervisor RD+WR, User RD";

mpu_armv73.$name             = "CONFIG_MPU_REGION2";
mpu_armv73.baseAddr          = 0x80000;
mpu_armv73.size              = 15;
mpu_armv73.accessPermissions = "Supervisor RD+WR, User RD";

mpu_armv74.$name             = "CONFIG_MPU_REGION3";
mpu_armv74.accessPermissions = "Supervisor RD+WR, User RD";
mpu_armv74.baseAddr          = 0x70000000;
mpu_armv74.size              = 21;

default_linker1.$name = "memory_configurator_default_linker0";

general1.$name        = "CONFIG_GENERAL0";
general1.linker.$name = "TIARMCLANG0";

region1.$name                                = "MEMORY_REGION_CONFIGURATION0";
region1.memory_region.create(11);
region1.memory_region[0].type                = "TCMA";
region1.memory_region[0].$name               = "R5F_VECS";
region1.memory_region[0].size                = 0x40;
region1.memory_region[0].auto                = false;
region1.memory_region[1].type                = "TCMA";
region1.memory_region[1].$name               = "R5F_TCMA";
region1.memory_region[1].size                = 0x7FC0;
region1.memory_region[2].type                = "TCMB";
region1.memory_region[2].size                = 0x8000;
region1.memory_region[2].$name               = "R5F_TCMB";
region1.memory_region[3].$name               = "SBL";
region1.memory_region[3].auto                = false;
region1.memory_region[3].size                = 0x40000;
region1.memory_region[4].$name               = "OCRAM";
region1.memory_region[4].auto                = false;
region1.memory_region[4].manualStartAddress  = 0x70040000;
region1.memory_region[4].size                = 0x40000;
region1.memory_region[5].type                = "FLASH";
region1.memory_region[5].auto                = false;
region1.memory_region[5].size                = 0x80000;
region1.memory_region[5].$name               = "FLASH";
region1.memory_region[6].$name               = "USER_SHM_MEM";
region1.memory_region[6].auto                = false;
region1.memory_region[6].manualStartAddress  = 0x701D0000;
region1.memory_region[6].size                = 0x4000;
region1.memory_region[6].isShared            = true;
region1.memory_region[6].shared_cores        = ["r5fss0-1","r5fss1-0","r5fss1-1"];
region1.memory_region[7].$name               = "LOG_SHM_MEM";
region1.memory_region[7].auto                = false;
region1.memory_region[7].manualStartAddress  = 0x701D4000;
region1.memory_region[7].size                = 0x4000;
region1.memory_region[7].isShared            = true;
region1.memory_region[7].shared_cores        = ["r5fss0-1","r5fss1-0","r5fss1-1"];
region1.memory_region[8].type                = "CUSTOM";
region1.memory_region[8].$name               = "RTOS_NORTOS_IPC_SHM_MEM";
region1.memory_region[8].auto                = false;
region1.memory_region[8].manualStartAddress  = 0x72000000;
region1.memory_region[8].size                = 0x3E80;
region1.memory_region[8].isShared            = true;
region1.memory_region[8].shared_cores        = ["r5fss0-1","r5fss1-0","r5fss1-1"];
region1.memory_region[9].type                = "CUSTOM";
region1.memory_region[9].$name               = "MAILBOX_HSM";
region1.memory_region[9].auto                = false;
region1.memory_region[9].manualStartAddress  = 0x44000000;
region1.memory_region[9].size                = 0x3CE;
region1.memory_region[9].isShared            = true;
region1.memory_region[9].shared_cores        = ["r5fss0-1","r5fss1-0","r5fss1-1"];
region1.memory_region[10].type               = "CUSTOM";
region1.memory_region[10].$name              = "MAILBOX_R5F";
region1.memory_region[10].auto               = false;
region1.memory_region[10].manualStartAddress = 0x44000400;
region1.memory_region[10].size               = 0x3CE;
region1.memory_region[10].isShared           = true;
region1.memory_region[10].shared_cores       = ["r5fss0-1","r5fss1-0","r5fss1-1"];

section1.load_memory                  = "R5F_VECS";
section1.group                        = false;
section1.$name                        = "Vector Table";
section1.output_section.create(1);
section1.output_section[0].$name      = ".vectors";
section1.output_section[0].palignment = true;

section2.load_memory                  = "OCRAM";
section2.$name                        = "Text Segments";
section2.output_section.create(5);
section2.output_section[0].$name      = ".text.hwi";
section2.output_section[0].palignment = true;
section2.output_section[1].$name      = ".text.cache";
section2.output_section[1].palignment = true;
section2.output_section[2].$name      = ".text.mpu";
section2.output_section[2].palignment = true;
section2.output_section[3].$name      = ".text.boot";
section2.output_section[3].palignment = true;
section2.output_section[4].$name      = ".text:abort";
section2.output_section[4].palignment = true;

section3.load_memory                  = "OCRAM";
section3.$name                        = "Code and Read-Only Data";
section3.output_section.create(2);
section3.output_section[0].$name      = ".text";
section3.output_section[0].palignment = true;
section3.output_section[1].$name      = ".rodata";
section3.output_section[1].palignment = true;

section4.load_memory                  = "OCRAM";
section4.$name                        = "Data Segment";
section4.output_section.create(1);
section4.output_section[0].$name      = ".data";
section4.output_section[0].palignment = true;

section5.load_memory                             = "OCRAM";
section5.$name                                   = "Memory Segments";
section5.output_section.create(3);
section5.output_section[0].$name                 = ".bss";
section5.output_section[0].output_sections_start = "__BSS_START";
section5.output_section[0].output_sections_end   = "__BSS_END";
section5.output_section[0].palignment            = true;
section5.output_section[1].$name                 = ".sysmem";
section5.output_section[1].palignment            = true;
section5.output_section[2].$name                 = ".stack";
section5.output_section[2].palignment            = true;

section6.load_memory                              = "OCRAM";
section6.$name                                    = "Stack Segments";
section6.output_section.create(5);
section6.output_section[0].$name                  = ".irqstack";
section6.output_section[0].output_sections_start  = "__IRQ_STACK_START";
section6.output_section[0].output_sections_end    = "__IRQ_STACK_END";
section6.output_section[0].input_section.create(1);
section6.output_section[0].input_section[0].$name = ". = . + __IRQ_STACK_SIZE;";
section6.output_section[1].$name                  = ".fiqstack";
section6.output_section[1].output_sections_start  = "__FIQ_STACK_START";
section6.output_section[1].output_sections_end    = "__FIQ_STACK_END";
section6.output_section[1].input_section.create(1);
section6.output_section[1].input_section[0].$name = ". = . + __FIQ_STACK_SIZE;";
section6.output_section[2].$name                  = ".svcstack";
section6.output_section[2].output_sections_start  = "__SVC_STACK_START";
section6.output_section[2].output_sections_end    = "__SVC_STACK_END";
section6.output_section[2].input_section.create(1);
section6.output_section[2].input_section[0].$name = ". = . + __SVC_STACK_SIZE;";
section6.output_section[3].$name                  = ".abortstack";
section6.output_section[3].output_sections_start  = "__ABORT_STACK_START";
section6.output_section[3].output_sections_end    = "__ABORT_STACK_END";
section6.output_section[3].input_section.create(1);
section6.output_section[3].input_section[0].$name = ". = . + __ABORT_STACK_SIZE;";
section6.output_section[4].$name                  = ".undefinedstack";
section6.output_section[4].output_sections_start  = "__UNDEFINED_STACK_START";
section6.output_section[4].output_sections_end    = "__UNDEFINED_STACK_END";
section6.output_section[4].input_section.create(1);
section6.output_section[4].input_section[0].$name = ". = . + __UNDEFINED_STACK_SIZE;";

section7.load_memory                  = "OCRAM";
section7.$name                        = "Initialization and Exception Handling";
section7.output_section.create(3);
section7.output_section[0].$name      = ".ARM.exidx";
section7.output_section[0].palignment = true;
section7.output_section[1].$name      = ".init_array";
section7.output_section[1].palignment = true;
section7.output_section[2].$name      = ".fini_array";
section7.output_section[2].palignment = true;

section8.load_memory                 = "USER_SHM_MEM";
section8.type                        = "NOLOAD";
section8.$name                       = "User Shared Memory";
section8.group                       = false;
section8.output_section.create(1);
section8.output_section[0].$name     = ".bss.user_shared_mem";
section8.output_section[0].alignment = 0;

section9.load_memory                 = "LOG_SHM_MEM";
section9.$name                       = "Log Shared Memory";
section9.group                       = false;
section9.type                        = "NOLOAD";
section9.output_section.create(1);
section9.output_section[0].$name     = ".bss.log_shared_mem";
section9.output_section[0].alignment = 0;

section10.load_memory                 = "RTOS_NORTOS_IPC_SHM_MEM";
section10.type                        = "NOLOAD";
section10.$name                       = "IPC Shared Memory";
section10.group                       = false;
section10.output_section.create(1);
section10.output_section[0].$name     = ".bss.ipc_vring_mem";
section10.output_section[0].alignment = 0;

section11.load_memory                 = "MAILBOX_HSM";
section11.type                        = "NOLOAD";
section11.$name                       = "SIPC HSM Queue Memory";
section11.group                       = false;
section11.output_section.create(1);
section11.output_section[0].$name     = ".bss.sipc_hsm_queue_mem";
section11.output_section[0].alignment = 0;

section12.load_memory                 = "MAILBOX_R5F";
section12.$name                       = "SIPC R5F Queue Memory";
section12.group                       = false;
section12.type                        = "NOLOAD";
section12.output_section.create(1);
section12.output_section[0].$name     = ".bss.sipc_secure_host_queue_mem";
section12.output_section[0].alignment = 0;

/**
 * Pinmux solution for unlocked pins/peripherals. This ensures that minor changes to the automatic solver in a future
 * version of the tool will not impact the pinmux you originally saw.  These lines can be completely deleted in order to
 * re-solve from scratch.
 */
i2c1.I2C.SCL.$suggestSolution = "EPWM8_B";
i2c1.I2C.SDA.$suggestSolution = "EPWM8_A";
i2c2.I2C.SCL.$suggestSolution = "I2C1_SCL";
i2c2.I2C.SDA.$suggestSolution = "I2C1_SDA";
Tx_Byte = 0x0A, Rx_Byte = 0x00,
0x52503004 : 0x00000040
0x52503008 : 0x00000438
0x52501020 : 0x0000000A
0x52503018 : 0x0000000A
GPIO LED Blinking...1
Tx_Byte = 0x0A, Rx_Byte = 0x00,
0x52503004 : 0x00000040
0x52503008 : 0x00000438
0x52501020 : 0x0000000A
0x52503018 : 0x0000000A
GPIO LED Blinking...1
Tx_Byte = 0x0A, Rx_Byte = 0x00,
0x52503004 : 0x00000040
0x52503008 : 0x00000438
0x52501020 : 0x0000000A
0x52503018 : 0x0000000A
GPIO LED Blinking...1
Tx_Byte = 0x0A, Rx_Byte = 0x00,
0x52503004 : 0x00000040
0x52503008 : 0x00000438
0x52501020 : 0x0000000A
0x52503018 : 0x0000000A
 

  • Hi Team Any updated here ? 

  • Hi Vipul,

    Apologies for a delayed response due, I was out-of-office due to the long weekend.

    1. I do see data in I2C data receive register (0x0A at 0x52503018) for I2C3 and the same data in Data transmit register (0x0A at 0x52501020) so I2C communication is fine (can be confirmed as all three iterations in the logs work correctly)

    2. Since I2C communication seems to be fine and the issue is with data being copied from I2C Buffers to application buffers, we might be having some incorrect configs or memory corruption, to further confirm, can you please place breakpoints at your receive interrupt (in the I2C LLD Driver, i2c_v1_lld.c, go to the I2C_lld_primeTransferIntr() function and check the pointers, check if I2CSetDataCount() sets correct read bytes and make sure the I2CControllerIntEnableEx() function is called to enable the Rx interrupt.)

    Also, can you give me the steps to reproduce the exact issue? Do i just test it over a single AM2634 launchpad? If yes, can you zip your CCS project and share as a zip here so I can reproduce and debug.

    Regards,
    Shaunak

  • Hi Shaunak 

    Thanks for your replay I will check as per your suggestion. 

    I would like to inform you I ma using two I2C in same lunch pad just remove the connection. and circuit.

    I am facing some challenge data copy in the variable and buffer and another point my callback function is not able to call while I2C receive interrupt.

    for your reference i am sharing my project zip file.

    Please guide me also 0066.gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang.zipfor callback what configuration i am missing.   

          

  • Hi Shaunak 

    Yes your both points are correct

    1.can be confirmed as all three iterations in the logs work correctly, Yes

    2. Since I2C communication seems to be fine and the issue is with data being copied from I2C Buffers to application buffers, yes

    3. Do i just test it over a single AM2634 launchpad? yes just short I2C1 and I2C3 on LP kit. 

  • Hi Vipul,

    Thanks for confirming, Id need some time to get this board mods done to test on AM2634 launchpad.

    can you please place breakpoints at your receive interrupt (in the I2C LLD Driver, i2c_v1_lld.c, go to the I2C_lld_primeTransferIntr() function and check the pointers, check if I2CSetDataCount() sets correct read bytes and make sure the I2CControllerIntEnableEx() function is called to enable the Rx interrupt.)

    Until then, would it be possible for you to share some details about this

    Regards,
    Shaunak

  • HI Shaunak 

    I tried to flow steps suggested by you, but first time code goes to Debug mode but not able to jump after System_init(); API and if try to second time then compiler showing. Error for write memory add. means code is not going to debug mode. here is the Error logs.    

    Cortex_R5_1: AM263x
    Cortex_R5_1: Board Selected : CC
    Cortex_R5_1: Trouble Writing Memory Block at 0x0 on Page 0 of Length 0x40: (Error -1065 @ 0x40) Unable to access device memory. Verify that the memory address is in valid memory. If error persists, confirm configuration, power-cycle board, and/or try more reliable JTAG settings (e.g. lower TCLK). (Emulation package 20.0.0.3178)
    Cortex_R5_1: File Loader: Verification failed: Target failed to write 0x00000000
    Cortex_R5_1: GEL: File: C:\Users\vvdn\Desktop\First_LED_AM263\gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang\Release\gpio_led_blink_am263x-lp_r5fss0-0_nortos_ti-arm-clang.out: Load failed.

    I tried with change this add in linker.cmd file while compile after that the code remain the same add. Tomorrow I will check further.   
     

  • I tried to flow steps suggested by you, but first time code goes to Debug mode but not able to jump after System_init(); API and if try to second time then compiler showing. Error for write memory add. means code is not going to debug mode. here is the Error logs.    

    Hi Vipul,

    Can you flash SBL Null to the board and try in OSPI boot mode? Looks like some error with device reset and reloading the binary. You can just reset the CPU in CCS after core halt and re-load the .out binary. 

    i wasn't able to spend time today on this due to some other debugs, I'll spend time as soon as possible on this.

    Regards,
    Shaunak

  • Hi Shaunak 

    After Null Boot its working for Debugging. and i have flowed step as per suggested by you call the API I2CControllerIntEnableEx() add break point in I2CSetDataCount() but unfortunately we are not able to get this break point and call back function also I am still debugging.  

  • Hi Vipul,

    I had a quick look and here is what I found:

    I believe we have some configuration issue or issue related to addressing. The first time, we enter I2C_PrimeTransferPoll() function, and try to read but encounter an address mismatch condition, which leads to a timeout and thus set the status to an error code, as a result other I2C flags are not cleared, and in every subsequent read call, the I2C bus enters the error condition because of the first iteration itself.

    I'll try to change some things around in the code and test.

    Regards,
    Shaunak

  • Hi Vipul,

    More specifically, some issue on the I2C3 read side, we have misconfigured something, we do see data in I2C3 DRR so data has reached the I2C.

    Now AM263x has to use its own I2C3 slave address to read the data from the DRR. This is done inside the I2CControllerDataGet function (reading DRR).

    Regards,
    Shaunak

  • Hi Shaunak 

    Yes you are right I was using same master and slave address, Bcz after some activity perform I could not get the result so i thought Both I2C add should be same for Communication so, and I did change again but Still same, 

    And Apart from data miss, I would like to remind you please check also for I2C callback function in Slave mode. I will wait for your work around.    

  • Hi Shaunak 

    Have you check it with EVAK board ? 

  • Hi Shaunka 

    Is there any update here?