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.

AM263P4: SDFM Data rdy Interrupt

Part Number: AM263P4
Other Parts Discussed in Thread: SYSCONFIG, TMDSCNCD263P, AMC1306EVM

Tool/software:

Hey,
i wanna get my SDFM module triggered by PWM and read out the data when rdy.
Therefore i try to implement the data rdy interrupt, but it doesnt trigger.
When iam debugging, i see the following:

-SDIFLG.AF1=1 -> so i assume my hardware connections are okay and new data is rdy at SDFM module

-SDCTL.MIE=1 -> so interrupts are enabled for SDFM

-SDFIFOCTRL1.DRINTSEL=0 -> so AF1 is source for Data rdy Interrupt

-INTXBAR0_G4_SEL = 2 -> so SD0.FILT1.DRINT is used as R5FSS0_CORE0_CONTROLSS_INTRXBAR0_OUT_0

-VIM0_INTR_EN_SET_4 = 262144 -> so bit 18 is set, which corresponds to R5FSS0_CORE0_CONTROLSS_INTRXBAR0_OUT_0

But my interrupt:


/* Register & enable interrupt */
HwiP_Params_init(&hwiPrms);
hwiPrms.intNum = CSLR_R5FSS0_CORE0_CONTROLSS_INTRXBAR0_OUT_0;
hwiPrms.priority = 0; /* setting high priority. optional */
hwiPrms.isPulse = 1;
hwiPrms.callback = &App_sdfmISR;
status = HwiP_construct(&gAdcHwiObject, &hwiPrms);

 doesn't get triggered.

Where is my mistake?

Moreover is there any easy way, to see which interrupts are activated in sysconfig? In debugging my only way is to check the VIM0_INTR_EN_SET registers?

Best regards

Marcel

  • Hello Marcel,

    Apologies for the delayed response here. I don't see anything obvious from your code.

    What is the definition of &gAdcHwiObject? I wonder if there should there be an equivalent &gSdfmHwiObject?

    Does your code enable general hardware interrupts with HwiP_enable() function?

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM263PX/latest/exports/docs/api_guide_am263px/group__KERNEL__DPL__HWI.html#ga89a0a63fd819bbcb31064a60fc901629

    Does your code enable SDFM-specific interrupts with SDFM_enableInterrupt(); function?

    https://software-dl.ti.com/mcu-plus-sdk/esd/AM263PX/latest/exports/docs/api_guide_am263px/group__DRV__SDFM__MODULE.html#ga74fa1e0d1e842dd521a57615f8f2b8cc

    Best Regards,

    Zackary Fleenor

  • Hey,

    just fergot to rename the &gAdcHwiObject to &gSdfmHwiObject because i tested an ADC interrupt before. But this doesnt change anything. 

    I do enable general hardware interrupt with HwiP_enable() function.

    SDFM-specific interrupts are enabled here:

    Best Regards

    Marcel

  • Hey Marcel,

    Did the ADC interrupt work during testing?

    Where in the code is that SDFM configuration happening? Are you using SysConfig to generate the various header files?

    Can you provide the .syscfg file and relevant configuration code for reference?

    Best Regards,

    Zackary Fleenor

  • Hey,
    yes ADC interrupt was working.
    Iam using SysConfig. I could not upload sysconfig normaly, so i renamed it in example.c, then i works. 
    Main.c is calling pwc.c where most tings happen. OS.c isn't needed and can be commented out.

    /*
     *  Copyright (C) 2021 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 <stdio.h>
    #include <kernel/dpl/DebugP.h>
    #include "ti_drivers_config.h"
    #include "ti_drivers_open_close.h"
    #include "ti_board_open_close.h"
    #include "app_rti.h"
    #include "os.h"
    
    /*
     * This is an empty project provided for all cores present in the device.
     * User can use this project to start their application by adding more SysConfig modules.
     *
     * This application does driver and board init and just prints the pass string on the console.
     * In case of the main core, the print is redirected to the UART console.
     * For all other cores, CCS prints are used.
     */
    volatile uint32_t gAdc1Result0;
    volatile uint32_t filter1Result;
    static HwiP_Object  gAdcHwiObject;
    static HwiP_Object  gSdfmHwiObject;
    
    static void App_adcISR(void *args);
    static void App_sdfmISR(void *args);
    
    void pwc_main(void *args)
    {
        uint32_t    delaySec = 1;
        uint32_t    gpioBaseAddr, pinNum;
        int32_t  status;
        HwiP_Params  hwiPrms;
    
        OS_Init();
    
        /* Open drivers to open the UART driver for console */
        Drivers_open();
        Board_driversOpen();
        gpioBaseAddr = (uint32_t) AddrTranslateP_getLocalAddr(GPIO_LED_BASE_ADDR);
        pinNum       = GPIO_LED_PIN;
        GPIO_setDirMode(gpioBaseAddr, pinNum, GPIO_LED_DIR);
    
    
    //    /* Register & enable interrupt */
    //    HwiP_Params_init(&hwiPrms);
    //    hwiPrms.intNum      = CSLR_R5FSS0_CORE0_CONTROLSS_INTRXBAR0_OUT_0;
    //    hwiPrms.priority    = 0;                        /* setting high priority. optional */
    //    hwiPrms.callback    = &App_adcISR;
    //    status              = HwiP_construct(&gAdcHwiObject, &hwiPrms);
    
        /* Register & enable interrupt */
        HwiP_Params_init(&hwiPrms);
        hwiPrms.intNum      = CSLR_R5FSS0_CORE0_CONTROLSS_INTRXBAR0_OUT_0;
        hwiPrms.priority    = 0;                        /* setting high priority. optional */
        hwiPrms.isPulse     = 1;
        hwiPrms.callback    = &App_sdfmISR;
        status              = HwiP_construct(&gSdfmHwiObject, &hwiPrms);
    
        while(1)
        {
    //        GPIO_pinWriteHigh(gpioBaseAddr, pinNum);
    //        ClockP_sleep(delaySec);
    //        GPIO_pinWriteLow(gpioBaseAddr, pinNum);
    //        ClockP_sleep(delaySec);
            OS_BG();
        }
    
    
        DebugP_log("All tests have passed!!\r\n");
    
        Board_driversClose();
        Drivers_close();
    }
    
    //static void App_adcISR(void *args)
    //{
    //    gAdc1Result0 = ADC_readResult(CONFIG_ADC1_RESULT_BASE_ADDR, ADC_SOC_NUMBER0);
    //    OS_Scheduler();
    //    ADC_clearInterruptStatus(CONFIG_ADC1_BASE_ADDR, ADC_INT_NUMBER1);
    //    if(true == ADC_getInterruptOverflowStatus(CONFIG_ADC1_BASE_ADDR, ADC_INT_NUMBER1))
    //    {
    //        ADC_clearInterruptStatus(CONFIG_ADC1_BASE_ADDR, ADC_INT_NUMBER1);
    //        ADC_clearInterruptOverflowStatus(CONFIG_ADC1_BASE_ADDR, ADC_INT_NUMBER1);
    //    }
    //}
    
    static void App_sdfmISR(void *args)
    {
    //    gAdc1Result0 = ADC_readResult(CONFIG_ADC1_RESULT_BASE_ADDR, ADC_SOC_NUMBER0);
        if(SDFM_getNewFilterDataStatus(CONFIG_SDFM0_BASE_ADDR, SDFM_FILTER_1) == true)
        {
            filter1Result = SDFM_getFilterData(CONFIG_SDFM0_BASE_ADDR, SDFM_FILTER_1) >> CSL_SDFM_SDDATA1_DATA32HI_SHIFT;
        }
        OS_Scheduler();
        SDFM_clearInterruptFlag(CONFIG_SDFM0_BASE_ADDR, SDFM_FILTER_1_NEW_DATA_FLAG);
    //    ADC_clearInterruptStatus(CONFIG_ADC1_BASE_ADDR, ADC_INT_NUMBER1);
    //    if(true == ADC_getInterruptOverflowStatus(CONFIG_ADC1_BASE_ADDR, ADC_INT_NUMBER1))
    //    {
    //        ADC_clearInterruptStatus(CONFIG_ADC1_BASE_ADDR, ADC_INT_NUMBER1);
    //        ADC_clearInterruptOverflowStatus(CONFIG_ADC1_BASE_ADDR, ADC_INT_NUMBER1);
    //    }
    }
    
    
    /**
     * 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 "AM263Px" --part "AM263P4" --package "ZCZ_S" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM263Px@10.00.00"
     * @v2CliArgs --device "AM263P4" --package "NFBGA (ZCZ-S)" --context "r5fss0-0" --product "MCU_PLUS_SDK_AM263Px@10.00.00"
     * @versions {"tool":"1.21.0+3721"}
     */
    scripting.excludeFromBuild("ti_enet_config.c");
    scripting.excludeFromBuild("ti_enet_config.h");
    scripting.excludeFromBuild("ti_enet_open_close.c");
    scripting.excludeFromBuild("ti_enet_open_close.h");
    scripting.excludeFromBuild("ti_enet_soc.c");
    scripting.excludeFromBuild("ti_enet_lwipif.c");
    scripting.excludeFromBuild("ti_enet_lwipif.h");
    
    /**
     * Import the modules used in this configuration.
     */
    const adc             = scripting.addModule("/drivers/adc/adc", {}, false);
    const adc1            = adc.addInstance();
    const epwm            = scripting.addModule("/drivers/epwm/epwm", {}, false);
    const epwm1           = epwm.addInstance();
    const epwm2           = epwm.addInstance();
    const gpio            = scripting.addModule("/drivers/gpio/gpio", {}, false);
    const gpio1           = gpio.addInstance();
    const sdfm            = scripting.addModule("/drivers/sdfm/sdfm", {}, false);
    const sdfm1           = sdfm.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 mpu_armv75      = mpu_armv7.addInstance();
    const mpu_armv76      = 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();
    const int_xbar        = scripting.addModule("/xbar/int_xbar/int_xbar", {}, false);
    const int_xbar1       = int_xbar.addInstance();
    
    /**
     * Write custom configuration values to the imported modules.
     */
    adc1.adcClockPrescaler = "ADC_CLK_DIV_3_0";
    adc1.$name             = "CONFIG_ADC1";
    adc1.enableConverter   = true;
    adc1.soc0Trigger       = "ADC_TRIGGER_EPWM0_SOCA";
    adc1.ADC.$assign       = "ADC1";
    
    epwm1.$name                                                      = "CONFIG_EPWM0";
    epwm1.epwmTimebase_period                                        = 10000;
    epwm1.epwmTimebase_counterMode                                   = "EPWM_COUNTER_MODE_UP_DOWN";
    epwm1.epwmTimebase_syncOutPulseMode                              = ["EPWM_SYNC_OUT_PULSE_ON_CNTR_ZERO"];
    epwm1.epwmCounterCompare_cmpA                                    = 5000;
    epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA   = "EPWM_AQ_OUTPUT_HIGH";
    epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_LOW";
    epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA   = "EPWM_AQ_OUTPUT_LOW";
    epwm1.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_DOWN_CMPA = "EPWM_AQ_OUTPUT_HIGH";
    epwm1.epwmDeadband_enableRED                                     = true;
    epwm1.epwmDeadband_enableFED                                     = true;
    epwm1.epwmDeadband_delayFED                                      = 400;
    epwm1.epwmDeadband_delayRED                                      = 400;
    epwm1.epwmDeadband_polarityFED                                   = "EPWM_DB_POLARITY_ACTIVE_LOW";
    epwm1.epwmEventTrigger_EPWM_SOC_A_triggerEnable                  = true;
    epwm1.epwmEventTrigger_EPWM_SOC_A_triggerSource                  = "EPWM_SOC_TBCTR_ZERO";
    epwm1.epwmEventTrigger_EPWM_SOC_A_triggerEventPrescalar          = "1";
    epwm1.EPWM.$assign                                               = "EPWM0";
    
    epwm2.$name                                                    = "CONFIG_EPWM1";
    epwm2.epwmTimebase_counterMode                                 = "EPWM_COUNTER_MODE_UP";
    epwm2.epwmTimebase_emulationMode                               = "EPWM_EMULATION_FREE_RUN";
    epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_usedEvents          = ["EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA","EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO"];
    epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_ZERO    = "EPWM_AQ_OUTPUT_LOW";
    epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_A_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
    epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_usedEvents          = ["EPWM_AQ_OUTPUT_ON_TIMEBASE_UP_CMPA","EPWM_AQ_OUTPUT_ON_TIMEBASE_ZERO"];
    epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_ZERO    = "EPWM_AQ_OUTPUT_LOW";
    epwm2.epwmActionQualifier_EPWM_AQ_OUTPUT_B_ON_TIMEBASE_UP_CMPA = "EPWM_AQ_OUTPUT_HIGH";
    epwm2.epwmTimebase_period                                      = 19;
    epwm2.epwmCounterCompare_cmpA                                  = 9;
    
    gpio1.$name          = "GPIO_LED";
    gpio1.pinDir         = "OUTPUT";
    gpio1.GPIO_n.$assign = "LIN2_TXD";
    
    sdfm1.$name                     = "CONFIG_SDFM0";
    sdfm1.Use_FilterChannel_1       = true;
    sdfm1.Ch2_SDCLKSEL              = "SDFM_CLK_SOURCE_SD1_CLK";
    sdfm1.Ch1_DataFilterEnable      = true;
    sdfm1.Ch1_SDSYNC_Enable         = true;
    sdfm1.Ch2_DataFilterEnable      = true;
    sdfm1.Ch2_SDSYNC_Enable         = true;
    sdfm1.Ch1_SD_modulatorFrequency = 10;
    sdfm1.useInterrupts             = true;
    sdfm1.Ch1_SDFFIL                = "1";
    sdfm1.SDFFINT                   = ["SDFM_FILTER_1"];
    sdfm1.AE                        = ["SDFM_FILTER_1"];
    sdfm1.Ch1_DOSR                  = 128;
    sdfm1.SDFM.CLK0.$assign         = "SDFM0_CLK0";
    sdfm1.SDFM.CLK1.$used           = false;
    sdfm1.SDFM.CLK2.$used           = false;
    sdfm1.SDFM.CLK3.$used           = false;
    sdfm1.SDFM.D0.$assign           = "SDFM0_D0";
    sdfm1.SDFM.D1.$assign           = "SDFM0_D1";
    sdfm1.SDFM.D1.$used             = false;
    sdfm1.SDFM.D2.$used             = false;
    sdfm1.SDFM.D3.$used             = false;
    
    const soc_ctrl_adc    = scripting.addModule("/drivers/soc_ctrl/v0/subModules/soc_ctrl_adc", {}, false);
    const soc_ctrl_adc1   = soc_ctrl_adc.addInstance({}, false);
    soc_ctrl_adc1.$name   = "soc_ctrl_adc0";
    const soc_ctrl        = scripting.addModule("/drivers/soc_ctrl/soc_ctrl", {}, false);
    soc_ctrl.soc_ctrl_adc = soc_ctrl_adc1;
    adc.adcReferences     = soc_ctrl_adc1;
    
    const soc_ctrl_cmpss    = scripting.addModule("/drivers/soc_ctrl/v0/subModules/soc_ctrl_cmpss", {}, false);
    const soc_ctrl_cmpss1   = soc_ctrl_cmpss.addInstance({}, false);
    soc_ctrl_cmpss1.$name   = "soc_ctrl_cmpss0";
    soc_ctrl.soc_ctrl_cmpss = soc_ctrl_cmpss1;
    
    const soc_ctrl_epwm    = scripting.addModule("/drivers/soc_ctrl/v0/subModules/soc_ctrl_epwm", {}, false);
    const soc_ctrl_epwm1   = soc_ctrl_epwm.addInstance({}, false);
    soc_ctrl_epwm1.$name   = "soc_ctrl_epwm0";
    epwm.epwmTbClkSync     = soc_ctrl_epwm1;
    soc_ctrl.soc_ctrl_epwm = soc_ctrl_epwm1;
    
    const soc_ctrl_sdfm    = scripting.addModule("/drivers/soc_ctrl/v0/subModules/soc_ctrl_sdfm", {}, false);
    const soc_ctrl_sdfm1   = soc_ctrl_sdfm.addInstance({}, false);
    soc_ctrl_sdfm1.$name   = "soc_ctrl_sdfm0";
    soc_ctrl.soc_ctrl_sdfm = soc_ctrl_sdfm1;
    sdfm.soc_ctrl_sdfm     = soc_ctrl_sdfm1;
    
    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;
    
    mpu_armv75.$name        = "CONFIG_MPU_REGION4";
    mpu_armv75.baseAddr     = 0x50D00000;
    mpu_armv75.size         = 14;
    mpu_armv75.allowExecute = false;
    mpu_armv75.attributes   = "Device";
    
    mpu_armv76.$name        = "CONFIG_MPU_REGION5";
    mpu_armv76.baseAddr     = 0x72000000;
    mpu_armv76.size         = 14;
    mpu_armv76.allowExecute = false;
    mpu_armv76.attributes   = "NonCached";
    
    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].manualStartAddress  = 0x60100000;
    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;
    
    int_xbar1.$name      = "CONFIG_INT_XBAR0";
    int_xbar1.xbarOutput = ["SD0_FILT0_DRINT"];
    
    /**
     * 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.
     */
    adc1.ADC.AIN0.$suggestSolution = "ADC1_AIN0";
    adc1.ADC.AIN1.$suggestSolution = "ADC1_AIN1";
    adc1.ADC.AIN2.$suggestSolution = "ADC1_AIN2";
    adc1.ADC.AIN3.$suggestSolution = "ADC1_AIN3";
    adc1.ADC.AIN4.$suggestSolution = "ADC1_AIN4";
    adc1.ADC.AIN5.$suggestSolution = "ADC1_AIN5";
    epwm1.EPWM.A.$suggestSolution  = "EPWM0_A";
    epwm1.EPWM.B.$suggestSolution  = "EPWM0_B";
    epwm2.EPWM.$suggestSolution    = "EPWM1";
    epwm2.EPWM.A.$suggestSolution  = "EPWM1_A";
    epwm2.EPWM.B.$suggestSolution  = "EPWM1_B";
    sdfm1.SDFM.$suggestSolution    = "SDFM0";
    
    /*
     *  Copyright (C) 2022-23 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"
    
    void empty_main(void *args);
    
    int main(void)
    {
        System_init();
        Board_init();
    
        pwc_main(NULL);
    
        Board_deinit();
        System_deinit();
    
        return 0;
    }
    

    Best regards,

    Marcel

  • Hey Marcel,

    Thanks for sharing this. I was able to import what you shared into sysconfig.

    Can you share your ti_drivers_open_close.c file?

    I don't see the code below which is used to map the SDFM Data Ready Interrupt for Filter Channel 1 (though I realize that the index is off here (SD1_FILT0 instead of SD1_FILT1), will file a ticket internally for this), to the INTXBAR0_OUT_0 which is mapped to your VIM via HwIP_params.

    void Drivers_intXbarOpen()
    {
        /* INT XBAR */
        SOC_xbarSelectInterruptXBarInputSource_ext(CSL_CONTROLSS_INTXBAR_U_BASE, 0, 0, 0, 0, 0, ( INT_XBAR_SD1_FILT0_DRINT ), 0, 0, 0, 0, 0);
    }

    Did the ADC example also rely on the INTXBAR routing?

    Best Regards,

    Zackary Fleenor

  • Hey,
    thought you could generate ti_drivers_open_close.c file with systemconfig. Nevertheless:
    ti_drivers_open_close.c

    Yes the ADC ecample also relied on the INTXBAR routing. I also routed it to INT_XBAR_0 

    Best regards,

    Marcel

  • Hello,

    Yes, this is true, I just wanted to verify that the same auto-generated file is being used by the project.

    Can you provide details on what is connected to the SDFM0_CLK and SDFM0_D[0:1] pins? I would like to confirm proper data is available otherwise, the Interrupt will never trigger by design.

    Best Regards,

    Zackary Fleenor

  • Hey,

    iam using TMDSCNCD263P with180-pin controlCARD Docking Station. As sigma delta modulator iam using AMC1306EVM.
    Ive the following connections between AMC1306 and dockingstation:

    Moreover Pin 55(HSEC_EPWM1_B) is connected to Pin 72(HSEC_SDFM0_CLK0) at Docking station.

    I assumed this is correct because i already see SDIFLG.AF1=1 which means that data is availabale.

    Best regards,

    Marcel

  • Hey Marcel,

    I am working on getting one of these EVM's so I can attempt to replicate the issue on my side. Nothing obvious is sticking out to me at this point so I will loop in a fellow expert to review as well.

    Best Regards,

    Zackary Fleenor

  • Hey Fleenor,

    any progress here?

    Best regards,

    Marcel

  • Hey Marcel,

    Happy New Year! Apologies for the delay, this got fallen through the cracks of holidays and OOOs! 

    I checked through your pwm.c code. I couldn't find any Interrupt Flag Clear APIs for the SDFM module. could you try adding the following API after the interrupt registration?

    SDFM_clearInterruptFlag(gSdfmBase, SDFM_MAIN_INTERRUPT_FLAG | <all the other related flags that are enabled to trigger interrupts >);
    Thanks and regards,
    Madhava
  • i just cleared the interruptflag in the interrupt itself like in example code. 
    Clearing the interruptflag right after registration solved my problem.

    Thanks,

    Marcel