This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

java.lang.NullPointerException while running interrupt code on CCS v5 for DM6446

Hi,

I get " java.lang.NullPointerException " while I run an example interrupt code on CCS v5 on windiws for dm6446 evm. i compiled the code without error, connected the target and while loading .out file my debugging hangs and I get this error, also find the screan shot attached.

I have tried these related links to: 

e2e.ti.com/.../275061

please help out.

Regards.

  • Hi,
    What is your CCS version ?
    What is your compiler version in CCS ?
    Did you refer the following TI wiki page ?
    processors.wiki.ti.com/.../Troubleshooting_CCSv5
  • Hi,

    Code Composer Studio Version: 5.5.0.00077
    Compiler version TI v5.1.1

    I have checked troubleshooting link too, and no such issues found or this problem solved. as I have mentioned earlier I could able to run the other codes or project. issue here is with interrupt code it is as below, is this a code or linker command file issue?


    ----------------------------------------------------------------------------------------------
    #pragma CODE_SECTION (HandleGPIO_INT, ".irqdata");
    void HandleGPIO_INT(void * arg)
    {
    /* Interrupt Generation Indicator Flag = 1 */
    IntGenFlag = 1;
    }



    void main ()
    {
    CSL_GpioConfig config;
    CSL_GpioPinNum pinNum;
    CSL_GpioBankData bankData;
    CSL_Status status;
    CSL_GpioContext pContext;
    CSL_GpioObj gpioObj;
    CSL_GpioHwSetup hwSetup;

    printf("******************* INTC Example ************************\n");

    SWI_sysMode();

    /* Initialize INTC */
    CSL_intcInit ();

    /* Initialize INTC Dispatcher */
    CSL_intcDispatcherInit ();

    /* Enable all interrupts */
    CSL_intcGlobalEnable (&eventStat);

    /* Open INTC */
    gpioIntcHwSetup.priority = CSL_INTC_PRIORITY_2;
    gpioIntcHandle = CSL_intcOpen (&gpioIntcObj, CSL_INTC_EVENTID_GPIO0,
    CSL_INTC_VECTID_DEFAULT, &gpioIntcHwSetup, &status);

    /* HwSetup INTC */
    CSL_intcHwSetup (gpioIntcHandle, &gpioIntcHwSetup);

    /* Bind ISR HandleGPIO_INT to Interrupt Controller */
    isr_gpio.handler = HandleGPIO_INT;
    isr_gpio.arg = NULL;
    CSL_intcPlugEventHandler (gpioIntcHandle, &isr_gpio);

    /* Event Enable */
    CSL_intcEventEnable (CSL_INTC_EVENTID_GPIO0, &eventStat);

    printf ("\nINTC: Interrupt Controller Setup... Passed.\n");

    /* Initialize the GPIO CSL module */
    status = CSL_gpioInit(&pContext);
    if (status != CSL_SOK) {
    printf ("GPIO: Initialization... Failed.\n");
    return;
    }
    else {
    printf ("GPIO: Module Initialization... Passed.\n");
    }

    /* Open the CSL module */
    hGpio = CSL_gpioOpen (&gpioObj, CSL_GPIO, NULL, &status);
    if ((hGpio == NULL) || (status != CSL_SOK)) {
    printf ("GPIO: Module Open... Failed.\n");
    return;
    }
    else {
    hGpio->numBanks = CSL_GPIO_NUM_BANKS;
    hGpio->numPins = CSL_GPIO_NUM_PINS;
    printf ("GPIO: Module open... Passed.\n");
    }

    /* Setup hardware parameters */
    hwSetup.extendSetup = NULL;

    /* Setup the General Purpose IO */
    status = CSL_gpioHwSetup(hGpio, &hwSetup);

    printf ("GPIO: Module Setup... Passed.\n");

    /* Interrupt Generation indicator flag is reset */
    IntGenFlag = 0;

    /* Configure pins 0 & 8 to generate an interrupt on Rising Edge, and
    * configure it as an output, then set the data High (Low->High).
    * Set Trigger
    */
    config.pinNum = CSL_GPIO_PIN0;
    config.trigger = CSL_GPIO_TRIG_RISING_EDGE;
    config.direction = CSL_GPIO_DIR_OUTPUT;
    hGpio->regs->BINTEN = 0x1;
    status = CSL_gpioHwControl (hGpio, CSL_GPIO_CMD_CONFIG_BIT, &config);
    if (status != CSL_SOK) {
    printf ("GPIO: Command to GPIO configuration... Failed.\n");
    errorExit();
    }

    config.pinNum = CSL_GPIO_PIN8;
    config.trigger = CSL_GPIO_TRIG_RISING_EDGE;
    config.direction = CSL_GPIO_DIR_OUTPUT;
    status = CSL_gpioHwControl (hGpio, CSL_GPIO_CMD_CONFIG_BIT, &config);
    if (status != CSL_SOK) {
    printf ("GPIO: Command to GPIO configuration... Failed.\n");
    errorExit();
    }

    /* Set Data High: */
    pinNum = CSL_GPIO_PIN0;
    status = CSL_gpioHwControl (hGpio, CSL_GPIO_CMD_SET_BIT, &pinNum);
    if (status != CSL_SOK) {
    printf ("GPIO: Command to set bit... Failed.\n");
    errorExit();
    }

    pinNum = CSL_GPIO_PIN8;
    status = CSL_gpioHwControl (hGpio, CSL_GPIO_CMD_SET_BIT, &pinNum);
    if (status != CSL_SOK) {
    printf ("GPIO: Command to set bit... Failed.\n");
    errorExit();
    }

    printf ("GPIO: Condition for interrupt generation... Done.\n");

    /* Wait for interrupt to be generated.
    * On receiving the interrupt, the CPU control goes to the ISR
    * In the ISR, the variable IntGenFlag becomes 1
    */
    while (IntGenFlag == 0);

    printf ("\nGPIO: Interrupt Occurred.\n");

    /* Check Interrupt Status: */
    bankData.data = 0;
    bankData.index = 0;
    status = CSL_gpioHwControl (hGpio, CSL_GPIO_CMD_GET_INTSTATUS, &bankData);
    if (status != CSL_SOK) {
    printf ("GPIO: Command to GPIO configuration... Failed.\n");
    errorExit();
    }

    if (bankData.data != 0x00000101){
    printf ("\nError in Interrupt Loopback Path\n");
    }

    /* Close the opened instances of GPIO and INTC */
    CSL_gpioClose (hGpio);
    CSL_intcClose (gpioIntcHandle);

    testEndPrint();
    }



    ------------------------------------------------------------------------

    linker command file: lnk32.cmd


    -e _reset
    -c /* LINK USING C CONVENTIONS */
    -stack 0x8000 /* SOFTWARE STACK SIZE */
    -heap 0x2000 /* HEAP AREA SIZE */
    -l rts32e.lib /* GET RUN-TIME SUPPORT */
    -l../../lib/csl_davinciArm9.lib
    //-l../../lib/davincievmbsl.lib

    /* SPECIFY THE SYSTEM MEMORY MAP */

    MEMORY
    {
    BOOT_MEM : org = 0x00000000 len = 0x00000108 /* map over exception vectors */
    IRQ_MEM : org = 0x00008000 len = 0x00001FFF
    P_MEM : org = 0x80000400 len = 0x03FFFC00 /* PROGRAM MEMORY */
    }

    /* SPECIFY THE SECTIONS ALLOCATION INTO MEMORY */

    SECTIONS
    {
    .boot : {} > BOOT_MEM /* Exception VECTORS start at 0x00000000 */
    .irqdata : {} > IRQ_MEM /* Should be the first one. */
    .bss : {} > P_MEM /* GLOBAL & STATIC VARS */
    .sysmem : {} > P_MEM /* DYNAMIC MEMORY ALLOCATION AREA */
    .stack : {} > P_MEM /* SOFTWARE SYSTEM STACK */

    .text : {} > P_MEM /* CODE */
    .cinit : {} > P_MEM /* INITIALIZATION TABLES */
    .const : {} > P_MEM /* CONSTANT DATA */
    .pinit : {} > P_MEM /* TEMPLATE INSTANTIATION TABLES */
    }


    Regards,
  • Hi Venkatraman,

    Check out below thread ,
    e2e.ti.com/.../275061