Not applicable
Apr 10, 2016
11:09 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Apr 10, 2016
11:09 PM
Hi all,
I have trying QSPI with iLLD library 1.0.0.0.7. I want using QSPI0 with manually driven CS pin. Here is SPI the initialization code part:
As you see I set up the autoCS disabled but it was not took effect, CS stays automatically driven. Also if I set NULL_PTR for spiMasterChannelConfig.sls.output.pin, then I get intrisic entry, debugger jumps to here :
( file IfxCpu_Inrtinsics_Gnuc.h )
What the problem could be please ?
Thank you in advance !
Best regards,
Born
I have trying QSPI with iLLD library 1.0.0.0.7. I want using QSPI0 with manually driven CS pin. Here is SPI the initialization code part:
//********************************************************************************
// Function Name : init_SPI
// Author :
// Date :
// Parameters : NONE
// Returns : NONE
// Notes : Initializes the SPI Interface
//********************************************************************************
void init_SPI(void)
{
uint32 i;
/* disable interrupts */
boolean interruptState = IfxCpu_disableInterrupts();
IfxQspi_SpiMaster_Config spiMasterConfig;
IfxQspi_SpiMaster_ChannelConfig spiMasterChannelConfig;
{
/* create module config */
IfxQspi_SpiMaster_initModuleConfig(&spiMasterConfig, &MODULE_QSPI0);
/* set the maximum baudrate */
spiMasterConfig.base.maximumBaudrate = 10000000;
/* ISR priorities and interrupt target */
spiMasterConfig.base.txPriority = ISR_PRIORITY_QSPI0_TX;
spiMasterConfig.base.rxPriority = ISR_PRIORITY_QSPI0_RX;
spiMasterConfig.base.erPriority = ISR_PRIORITY_QSPI0_ER;
spiMasterConfig.base.isrProvider = (IfxSrc_Tos)IfxCpu_getCoreIndex();
/* pin configuration */
const IfxQspi_SpiMaster_Pins pins = {&IfxQspi0_SCLK_P20_11_OUT, /* SCLK */
IfxPort_OutputMode_pushPull,
&IfxQspi0_MTSR_P20_14_OUT, /* MOSI */
IfxPort_OutputMode_pushPull,
&IfxQspi0_MRSTA_P20_12_IN, IfxPort_InputMode_pullDown, /* MISO */
IfxPort_PadDriver_cmosAutomotiveSpeed3 /* pad driver mode */
};
spiMasterConfig.pins = &pins;
/* initialize module */
IfxQspi_SpiMaster_initModule(&g_QspiCpu.drivers.spiMaster, &spiMasterConfig);
}
{
/* create channel config */
IfxQspi_SpiMaster_initChannelConfig(&spiMasterChannelConfig,
&g_QspiCpu.drivers.spiMaster);
/* set the baudrate for this channel */
spiMasterChannelConfig.base.baudrate = 3000000;
const IfxQspi_SpiMaster_Output slsOutput = {
&IfxQspi0_SLSO9_P20_3_OUT,
//NULL_PTR, // if this option is used then got jump to intrisic code part !!!!!
IfxPort_OutputMode_pushPull,
IfxPort_PadDriver_cmosAutomotiveSpeed1};
spiMasterChannelConfig.sls.output.pin = slsOutput.pin;
spiMasterChannelConfig.sls.output.mode = slsOutput.mode;
spiMasterChannelConfig.sls.output.driver = slsOutput.driver;
spiMasterChannelConfig.base.mode.autoCS = 0; // HERE I SET AUTO CS DISABLED, BUT CS STAYS ENABLED!!!!!
/* initialize channel */
IfxQspi_SpiMaster_initChannel(&g_QspiCpu.drivers.spiMasterChannel, &spiMasterChannelConfig);
}
/* init tx buffer area */
for (i = 0; i < SPI_BUFFER_SIZE; i++)
g_QspiCpu.qspiBuffer.spi0RxBuffer = (uint8)(0);
IfxCpu_restoreInterrupts(interruptState);
} //end init_SPI
As you see I set up the autoCS disabled but it was not took effect, CS stays automatically driven. Also if I set NULL_PTR for spiMasterChannelConfig.sls.output.pin, then I get intrisic entry, debugger jumps to here :
( file IfxCpu_Inrtinsics_Gnuc.h )
/** Insert DEBUG instruction
*/
IFX_INLINE void __debug(void)
{
__asm__ volatile ("debug" : : : "memory");
}
What the problem could be please ?
Thank you in advance !
Best regards,
Born
- Tags:
- IFX
3 Replies
Aug 14, 2018
02:19 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Aug 14, 2018
02:19 AM
Hello,
I have the exactly same issue, did you manage to fix this?
I have the exactly same issue, did you manage to fix this?
Jan 24, 2022
06:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 24, 2022
06:47 AM
Hello,
Also, I have the exactly same issue, How can I handle it?
Regards,
DJ LEE
Jan 24, 2022
01:20 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jan 24, 2022
01:20 PM
Hi, I think here the nuclear option may be need it, so try to override the CS configuration. For this you need to write directly in the QSPI registers, do that after SpiMaster_initChannel function , so you can try:
update: in order to make this "hack" to work you need to set the autoCS to "1".
/* initialize channel */
IfxQspi_SpiMaster_initChannel(&g_QspiCpu.drivers.spiMasterChannel, &spiMasterChannelConfig);
}
/* let's manually override CS configuration*/
QSPI0_SSOC.B.OEN = 0x0; // OEN bitfield controls the automatic for each CS
IfxPort_setPinMode(&MODULE_P20, 3u, IfxPort_Mode_outputPushPullGeneral); // reconfigure the pin as GPIO
// here set the pint at the desired level, high or low
// for example with function IfxPort_setPinHigh()