Hi team,
Customer is porting SPI, I2C, UART drivers from an old project to a new project.
Old project: DSP-BIOS 5.42.01.09, PSP 01.30.01, EDMA 01.11.02.05, XDC 3.22.04.45
New project: SYS-BIOS 6.35.04.50, BIOSPSP 03.00.01.00, EDMA 02.11.11.13, XDC 3.25.03.72
Drivers (SPI, UART, I2C) code we wrote for the old project is using GIO. They've ported all the code to new environment and made necessary modifications as the signature is changed (e.g. "GIO_create", "GIO_Params" )as shown below.
*********************************** BIOS5 code: GIO_Attrs gioAttrs = GIO_ATTRS; Spi_ChanParams chanParams; EDMA3_DRV_Result edmaResult = 0; if (NULL == hEdma[0]) { edmaResult = edma3init(); if (EDMA3_DRV_SOK != edmaResult) { /* Error in configuring the edma driver */ //LOG_printf(&trace,"\r\nEDMA3 : edma3init() failed\r\n"); } else { //LOG_printf(&trace,"\r\nEDMA3 : edma3init() passed\r\n"); } } chanParams.hEdma = hEdma[0]; Int32 status; /* create SPI channel for transmission */ spiflashHandle = GIO_create("/SPI1",IOM_INPUT,&status,&chanParams,&gioAttrs); BIOS6 code: GIO_Params gioParams; Error_Block eb; Error_init(&eb); Spi_ChanParams chanParams; EDMA3_DRV_Result edmaResult = 0; GIO_Params_init(&gioParams); if (NULL == hEdma[0]) { hEdma[0] = edma3init(0, &edmaResult); if (EDMA3_DRV_SOK != edmaResult) { /* Error in configuring the edma driver */ //LOG_printf(&trace,"\r\nEDMA3 : edma3init() failed\r\n"); } else { //LOG_printf(&trace,"\r\nEDMA3 : edma3init() passed\r\n"); } } chanParams.hEdma = hEdma[0]; gioParams.chanParams = &chanParams; spiflashHandle = GIO_create("/SPI1",GIO_INPUT, &gioParams, &eb); *************************
Code compile and link fine but get following error when trying to execute above ("GIO_create") line.
SPI Test: EDMA Request failed
SPI Test: EDMA Request failedti.sysbios.io.GIO: line 248: E_createFailed: mdCreateChan returned error -139
Drivers are created using following code in *.cfg file.
var iomFxns = "Uart_IOMFXNS"; var initFxn = "UartInit"; var deviceParams = "uartParams"; var deviceId = 1; GIO.addDeviceMeta("/UART0", iomFxns, initFxn, deviceId, deviceParams); var iomFxns = "Spi_IOMFXNS"; var initFxn = "SpiInit"; var deviceParams = "spiParams"; var deviceId = 0; GIO.addDeviceMeta("/SPI0", iomFxns, initFxn, deviceId, deviceParams); var iomFxns = "Spi_IOMFXNS"; var initFxn = "SpiFlashInit"; var deviceParams = "spiflashParams"; var deviceId = 1; GIO.addDeviceMeta("/SPI1", iomFxns, initFxn, deviceId, deviceParams); var iomFxns = "I2c_IOMFXNS"; var initFxn = "I2cBatteryInit"; var deviceParams = "i2cBatteryParams"; var deviceId = 0; GIO.addDeviceMeta("/I2C0", iomFxns, initFxn, deviceId, deviceParams); var iomFxns = "I2c_IOMFXNS"; var initFxn = "I2cInit"; var deviceParams = "i2cParams"; var deviceId = 1; GIO.addDeviceMeta("/I2C1", iomFxns, initFxn, deviceId, deviceParams);
Worth noting, the customer also has an external E2E presence (http://e2e.ti.com/members/592095/default.aspx) and has had previously inquiries during this porting effort.
Error -139 appears to be an invalid parameter error but the parameters passed to GIO_Create look ok.
Any insight is greatly appreciated.