Part Number: MCU-PLUS-SDK-AM263X
Other Parts Discussed in Thread: AM2634-Q1, SYSCONFIG
I am working on GPMC using AM2634-Q1 and the device which I am interfacing is a 8bit nor like device which has 16bit addressing. I am not using multiplexed s address and data.
As per "Am263+ MCU guide" it supports NOR like devices and for it in sys.config there are limited options like device type(PSRAM) and device size(16bit).
So, I am configuring them manually using functions from gpmc.h
But for timing configuration even though I am changing values at sys.config they are not reflecting on my generated drivers_config.c file which I am attaching here.
So, I am changing them manually in my .c file for timming calculation I am reffering to complete version of this document "AM64x Sitara™ Processors datasheet (Rev. G) ". and "7.10.5.8.2 GPMC and NOR Flash — Asynchronous Mode " this section.
There is a mistake at gpmc.h file where devtype is assigned two times instead of devsize at this function "static inline void GPMC_Params_init(GPMC_Params *params)"
(I have changed that .h file and it is working fine)
issue:
- In sys.config timming configuration is not having any effect.
- My timming at IOW, IOR and Cs is taking effect after changing them through .c but the output timing is not as desired.
I am attaching my .c file where I am configuring GPMC and a picture of my sys config
/*
* 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.
*/
/*
* Auto generated file
*/
#include "ti_drivers_config.h"
/*
* GPIO
*/
/* ----------- GPIO Direction, Trigger, Interrupt initialization ----------- */
void GPIO_init()
{
uint32_t baseAddr;
/* Instance 0 */
/* Get address after translation translate */
baseAddr = (uint32_t) AddrTranslateP_getLocalAddr(CONFIG_GPIO0_BASE_ADDR);
GPIO_setDirMode(baseAddr, CONFIG_GPIO0_PIN, CONFIG_GPIO0_DIR);
/* Instance 1 */
/* Get address after translation translate */
baseAddr = (uint32_t) AddrTranslateP_getLocalAddr(CONFIG_GPIO2_BASE_ADDR);
GPIO_pinWriteLow(baseAddr, CONFIG_GPIO2_PIN);
GPIO_setDirMode(baseAddr, CONFIG_GPIO2_PIN, CONFIG_GPIO2_DIR);
}
/* ----------- GPIO Interrupt de-initialization ----------- */
void GPIO_deinit()
{
}
/*
* GPMC
*/
/* GPMC attributes */
static GPMC_HwAttrs gGpmcAttrs[CONFIG_GPMC_NUM_INSTANCES] =
{
{
.gpmcBaseAddr = CSL_GPMC0_CFG_U_BASE,
.dataBaseAddr = CSL_GPMC0_MEM_U_BASE,
.inputClkFreq = 100000000U,
.intrNum = CSLR_R5FSS0_CORE0_GPMC_SINTR,
.intrPriority = 4U,
.chipSelBaseAddr = 0x68000000U,
.chipSelAddrSize = GPMC_CS_MASK_ADDR_SIZE_16MB,
.clkDivider = CSL_GPMC_CONFIG1_GPMCFCLKDIVIDER_DIVBY1,
.waitPinNum = CSL_GPMC_CONFIG1_WAITPINSELECT_W0,
.addrDataMux = CSL_GPMC_CONFIG1_MUXADDDATA_NONMUX,
.timeLatency = CSL_GPMC_CONFIG1_TIMEPARAGRANULARITY_X1,
.waitPinPol = CSL_GPMC_CONFIG_WAIT0PINPOLARITY_W0ACTIVEL,
.timingParams =
{
.csOnTime = 3,
.csRdOffTime = 21,
.csWrOffTime = 21,
.advOnTime = 1,
.advRdOffTime = 3,
.advWrOffTime = 3,
.advAadMuxOnTime = 1,
.advAadMuxRdOffTime = 2,
.advAadMuxWrOffTime = 2,
.weOnTtime = 10,
.weOffTime = 16,
.oeOnTime = 10,
.oeOffTime = 1,
.oeAadMuxOnTime = 1,
.oeAadMuxOffTime = 15,
.pageBurstAccess = 3,
.rdAccessTime = 16,
.wrAcessTime = 8,
.rdCycleTime = 23,
.wrCycleTime = 23,
.wrDataOnMuxBusTime = 0,
.cycle2CycleDelay = 0,
.cycleDelaySameChipSel = CSL_GPMC_CONFIG6_CYCLE2CYCLESAMECSEN_NOC2CDELAY,
.cycleDelayDiffChipSel = CSL_GPMC_CONFIG6_CYCLE2CYCLEDIFFCSEN_NOC2CDELAY,
.busTurnAroundTime = 1,
},
.readType = CSL_GPMC_CONFIG1_READTYPE_RDASYNC,
.csExDelay = CSL_GPMC_CONFIG2_CSEXTRADELAY_NOTDELAYED,
.accessType = CSL_GPMC_CONFIG1_READMULTIPLE_RDSINGLE,
},
};
/* GPMC objects - initialized by the driver */
static GPMC_Object gGpmcObjects[CONFIG_GPMC_NUM_INSTANCES];
/* GPMC driver configuration */
GPMC_Config gGpmcConfig[CONFIG_GPMC_NUM_INSTANCES] =
{
{
&gGpmcAttrs[CONFIG_GPMC0],
&gGpmcObjects[CONFIG_GPMC0],
},
};
uint32_t gGpmcConfigNum = CONFIG_GPMC_NUM_INSTANCES;
#include <drivers/gpmc/v0/dma/gpmc_dma.h>
GPMC_DmaConfig gGpmcDmaConfig[CONFIG_GPMC_NUM_DMA_INSTANCES] =
{
};
uint32_t gGpmcDmaConfigNum = CONFIG_GPMC_NUM_DMA_INSTANCES;
/*
* I2C
*/
/* I2C Attributes */
static I2C_HwAttrs gI2cHwAttrs[CONFIG_I2C_HLD_NUM_INSTANCES] =
{
{
.baseAddr = CSL_I2C2_U_BASE,
.intNum = 46,
.eventId = 0,
.funcClk = 96000000U,
.enableIntr = 1,
.ownTargetAddr = 0x1C,
},
};
/* I2C Objects - Initialized by the Driver */
static I2C_Object gI2cObjects[CONFIG_I2C_HLD_NUM_INSTANCES];
/* I2C driver configuration */
I2C_Config gI2cConfig[CONFIG_I2C_HLD_NUM_INSTANCES] =
{
{
.object = &gI2cObjects[CONFIG_I2C0],
.hwAttrs = &gI2cHwAttrs[CONFIG_I2C0]
},
};
uint32_t gI2cConfigNum = CONFIG_I2C_HLD_NUM_INSTANCES;
/*
* UART
*/
/* UART atrributes */
static UART_Attrs gUartAttrs[CONFIG_UART_NUM_INSTANCES] =
{
{
.baseAddr = CSL_UART0_U_BASE,
.inputClkFreq = 48000000U,
},
};
/* UART objects - initialized by the driver */
static UART_Object gUartObjects[CONFIG_UART_NUM_INSTANCES];
/* UART driver configuration */
UART_Config gUartConfig[CONFIG_UART_NUM_INSTANCES] =
{
{
&gUartAttrs[CONFIG_UART_CONSOLE],
&gUartObjects[CONFIG_UART_CONSOLE],
},
};
uint32_t gUartConfigNum = CONFIG_UART_NUM_INSTANCES;
#include <drivers/uart/v0/lld/dma/uart_dma.h>
UART_DmaHandle gUartDmaHandle[] =
{
};
uint32_t gUartDmaConfigNum = CONFIG_UART_NUM_DMA_INSTANCES;
void Drivers_uartInit(void)
{
UART_init();
}
/*
* MCU_LBIST
*/
uint32_t gMcuLbistTestStatus = 0U;
void SDL_lbist_selftest(void)
{
}
void Pinmux_init(void);
void PowerClock_init(void);
void PowerClock_deinit(void);
/*
* Common Functions
*/
void System_init(void)
{
/* DPL init sets up address transalation unit, on some CPUs this is needed
* to access SCICLIENT services, hence this needs to happen first
*/
Dpl_init();
/* initialize PMU */
CycleCounterP_init(SOC_getSelfCpuClk());
PowerClock_init();
/* Now we can do pinmux */
Pinmux_init();
/* finally we initialize all peripheral drivers */
GPIO_init();
GPMC_init();
I2C_init();
Drivers_uartInit();
}
void System_deinit(void)
{
GPIO_deinit();
GPMC_deinit();
I2C_deinit();
UART_deinit();
PowerClock_deinit();
Dpl_deinit();
}






