Other Parts Discussed in Thread: OMAPL138, TMDSLCDK138
Hi,
I'm running modified GPIO LED blink example from pdk_omapl138_1_0_10 on the C6748 core using remoteproc. And it looks like the DSP core is throttled by the Linux on the ARM core.
We are using:
1. TMDSLCDK138 board revision A7A
2. PROCESSOR-SDK-LINUX-OMAPL138 version 06_00_00_07
3. Custom device tree - 5127.device_tree.zip
4. Platform memory setup
5. *.cfg configuration file
/* Load all required BIOS/XDC runtime packages */ var Memory = xdc.useModule('xdc.runtime.Memory'); var BIOS = xdc.useModule('ti.sysbios.BIOS'); var HeapBuf = xdc.useModule('ti.sysbios.heaps.HeapBuf'); var Log = xdc.useModule('xdc.runtime.Log'); var Task = xdc.useModule('ti.sysbios.knl.Task'); var Semaphore = xdc.useModule('ti.sysbios.knl.Semaphore'); var Hwi = xdc.useModule('ti.sysbios.family.c64p.Hwi'); var ECM = xdc.useModule('ti.sysbios.family.c64p.EventCombiner'); var core = xdc.useModule('ti.sysbios.hal.Core'); var Cache = xdc.useModule ("ti.sysbios.hal.Cache"); var HeapMem = xdc.useModule('ti.sysbios.heaps.HeapMem'); var devType = "omapl138" /* Load the OSAL package */ var osType = "tirtos" var Osal = xdc.useModule('ti.osal.Settings'); Osal.osType = osType; Osal.socType = devType; /*use CSL package*/ var Csl = xdc.loadPackage('ti.csl'); Csl.Settings.deviceType = devType; /* Load the Board package and set the board name */ var Board = xdc.loadPackage('ti.board'); Board.Settings.boardName = "lcdkOMAPL138"; /* Load Profiling package */ /*var Utils = xdc.loadPackage('ti.utils.profiling');*/ /* Load the gpio package */ var Gpio = xdc.loadPackage('ti.drv.gpio'); Gpio.Settings.enableProfiling = false; Gpio.Settings.socType = devType; /* Load the uart package */ var Uart = xdc.useModule('ti.drv.uart.Settings'); Uart.socType = devType; /* Load the I2C package - required by board */ var I2c = xdc.loadPackage('ti.drv.i2c'); I2c.Settings.socType = devType; var System = xdc.useModule('xdc.runtime.System'); SysStd = xdc.useModule('xdc.runtime.SysStd'); System.SupportProxy = SysStd; /* Load and use the CSL packages */ var Csl = xdc.useModule('ti.csl.Settings'); Csl.deviceType = devType; /* No runtime stack checking is performed */ Task.checkStackFlag = false; /* Reduce the number of task priorities */ Task.numPriorities = 4; /* ================ Task configuration ================ */ var task0Params = new Task.Params(); task0Params.instance.name = "echo"; task0Params.stackSize = 0x1000; Program.global.echo = Task.create("&gpio_test", task0Params); /* This is the default memory heap. */ /* Memory.defaultHeapInstance = Program.global.heap0; Program.sectMap["systemHeap"] = Program.platform.stackMemory; Program.sectMap[".fardata:benchmarking"] = new Program.SectionSpec(); Program.sectMap[".fardata:benchmarking"].loadSegment = "APP_CACHED_DATA_BLK2_MEM"; Program.sectMap[".text:_c_int00"] = new Program.SectionSpec(); Program.sectMap[".text:_c_int00"].loadSegment = "APP_CACHED_DATA_BLK1_MEM"; */ /****** IPC - Shared Memory Settings ********/ /* IPC packages */ var memmap = Program.cpu.memoryMap; /*Startup = xdc.useModule('xdc.runtime.Startup'); Startup.firstFxns.$add('&myStartupFxn');*/ /* Enable BIOS Task Scheduler */ BIOS.taskEnabled = true; /* * Enable Event Groups here and registering of ISR for specific GEM INTC is done * using EventCombiner_dispatchPlug() and Hwi_eventMap() APIs */ var exception = xdc.useModule('ti.sysbios.family.c64p.Exception'); exception.enablePrint = true; /* * @(#) ti.sysbios.genx; 2, 0, 0, 0,275; 4-29-2009 15:45:06; /db/vtree/library/trees/avala/avala-k25x/src/ */ var xdc_runtime_SysMin = xdc.useModule('xdc.runtime.SysMin'); xdc_runtime_SysMin.bufSize = 0x8000; /* Override the default resource table with my own */ var Resource = xdc.useModule('ti.ipc.remoteproc.Resource'); Resource.loadSegment = "DDR"
6. Modified main_led_blink.c file
/* XDCtools Header files */ #include <xdc/std.h> #include <xdc/runtime/System.h> #include <xdc/runtime/Error.h> /* BIOS Header files */ #include <ti/sysbios/BIOS.h> #include <ti/sysbios/knl/Task.h> #include <stdio.h> /* TI-RTOS Header files */ #include <ti/drv/gpio/GPIO.h> #include <ti/drv/gpio/soc/GPIO_soc.h> #include "GPIO_board.h" #include <ti/board/board.h> /********************************************************************** ************************** Macros ************************************ **********************************************************************/ #define DELAY_VALUE (10U) /* 10 msec */ /********************************************************************** ************************** Internal functions ************************ **********************************************************************/ /* Delay function */ void AppDelay(unsigned int delayVal); /* Callback function */ void AppGpioCallbackFxn(void); /* * ======== Board_initI2C ======== */ static void Board_initGPIO(void) { Board_initCfg boardCfg; GPIO_v0_HwAttrs gpio_cfg; /* Get the default SPI init configurations */ GPIO_socGetInitCfg(GPIO_LED0_PORT_NUM, &gpio_cfg); /* Setup GPIO interrupt configurations */ GPIO_socSetBankInt(GPIO_LED0_PORT_NUM, GPIO_LED0_PIN_NUM, NULL); boardCfg = BOARD_INIT_PINMUX_CONFIG | BOARD_INIT_MODULE_CLOCK; Board_init(boardCfg); } /********************************************************************** ************************** Global Variables ************************** **********************************************************************/ volatile uint32_t gpio_intr_triggered = 0; uint32_t gpioBaseAddr; uint32_t gpioPin; /* * ======== test function ======== */ void gpio_test(UArg arg0, UArg arg1) { /* GPIO initialization */ GPIO_init(); /* Set the callback function */ GPIO_setCallback(USER_LED0, AppGpioCallbackFxn); /* Enable GPIO interrupt on the specific gpio pin */ GPIO_enableInt(USER_LED0); /* Write high to gpio pin to control LED1 */ GPIO_write((USER_LED1), GPIO_PIN_VAL_HIGH); AppDelay(DELAY_VALUE); while(1) { GPIO_toggle(USER_LED0); AppDelay(DELAY_VALUE); } } /* * ======== main ======== */ int main(void) { /* Call board init functions */ Board_initGPIO(); /* Start BIOS */ BIOS_start(); return (0); } /* * ======== AppDelay ======== */ void AppDelay(unsigned int delayVal) { Osal_delay(delayVal); } /* * ======== AppLoopDelay ======== */ void AppLoopDelay(uint32_t delayVal) { volatile uint32_t i; for (i = 0; i < (delayVal * 1000); i++) ; } /* * ======== Callback function ======== */ void AppGpioCallbackFxn(void) { /* Toggle LED1 */ GPIO_toggle(USER_LED1); AppLoopDelay(DELAY_VALUE); gpio_intr_triggered = 1; }
7. Here is the *.out file - 5736.GPIO_LedBlink_lcdkOMAPL138_c674xTestProject.zip
After remoteproc boots the DSP core and the DSP is running the code, LEDs are blink, but not as expected. When Linux is booting, they blink fast, when Linux prompts login line they begin to blink slower. If I press and hold any key on the keyboard connected to the USB HOST they begin to blink faster. Actually, it looks like if I keep ARM core busy the LEDs are blink faster, with “stress –cpu 1 –timeout 10” for example.
Here is the screenshots from oscilloscope. Yellow line is LED D5 voltage. Blue line is LED D4 voltage.
Linux is idle. The LEDs are blink slower.
Red arrows pointing to the place where the “down” key has been pressed and hold. The LEDs began to blink faster.
Is there any way to fix this?