Nov 15, 2018
06:04 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 15, 2018
06:04 AM
Dear Infineon,
I'm currently working on a XMC4700-F100F2048 configured in DAVE with an SPI_MASTER app and a DIGITAL_IO to manage the SPI_CS.
SPI_MASTER app is configured in DMA mode both in transmit and in receive and runs at 1Mb/s, Full-duplex.
My firmware has both a bootloader and an application, developed in two different DAVE projects. SPI works correctly in bootloader, but when the
application starts the first SPI transaction doesn't send the first byte.
To emulate this behavior i developed a test project with the SPI configured as follows:
Here it is the main.c code:
What it is missing?
Thanks in advance for your kindness,
Andrea
I'm currently working on a XMC4700-F100F2048 configured in DAVE with an SPI_MASTER app and a DIGITAL_IO to manage the SPI_CS.
SPI_MASTER app is configured in DMA mode both in transmit and in receive and runs at 1Mb/s, Full-duplex.
My firmware has both a bootloader and an application, developed in two different DAVE projects. SPI works correctly in bootloader, but when the
application starts the first SPI transaction doesn't send the first byte.
To emulate this behavior i developed a test project with the SPI configured as follows:
Here it is the main.c code:
#include//Declarations from DAVE Code Generation (includes SFR declaration)
static uint8_t buffer[3] = { 0x01, 0x02, 0x03 };
void SPI_Send( uint8_t *buffer, uint8_t length )
{
DIGITAL_IO_SetOutputLow( &SPI_SS );
SPI_MASTER_Transmit( &SPI_MASTER, buffer, 3 );
while( SPI_MASTER_IsTxBusy( &SPI_MASTER ) );
while( SPI_MASTER_GetFlagStatus(&SPI_MASTER, (uint32_t)XMC_SPI_CH_STATUS_FLAG_MSLS) != 0U );
DIGITAL_IO_SetOutputHigh( &SPI_SS );
}
int main(void)
{
DAVE_Init();
SPI_Send( buffer, 3 );
SPI_MASTER_Init( &SPI_MASTER );
SPI_Send( buffer, 3 );
while(1U);
}
What it is missing?
Thanks in advance for your kindness,
Andrea
- Tags:
- IFX
2 Replies
Nov 22, 2018
02:38 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 22, 2018
02:38 PM
Hi,
You will need to clear the service request in the DLR in between.
You find which request line is being used by DMA CH in the DAVE report.
Regards,
Jesus
You will need to clear the service request in the DLR in between.
int main(void)
{
DAVE_Init();
SPI_Send( buffer, 3 );
XMC_DMA_ClearRequestLine(XMC_DMA1, 3);
SPI_MASTER_Init( &SPI_MASTER );
SPI_Send( buffer, 3 );
while(1U);
}
You find which request line is being used by DMA CH in the DAVE report.
Regards,
Jesus
Nov 23, 2018
05:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Nov 23, 2018
05:25 AM
It worked.
Thank you for your response.
Thank you for your response.