cancel
Showing results for 
Search instead for 
Did you mean: 

STM32F429 SPI4 via DMA

p23
Associate II
Posted on February 06, 2014 at 11:50

Hello everyone,

I'm using the SPI4 to read out data from an SD-card, witch is working. Now I want to let the DMA controller do the work at least I want him to do it... I pretty much used the code of the F4 discoveryboard and changed the needed settings. I'm at a point where I don't have a clue why the DMA controller won't start.

Here the code i ended with:

GPIO_InitTypeDef GPIO_InitStructure;

SPI_InitTypeDef  SPI_InitStructure;

DMA_InitTypeDef DMA_InitStructure;

/* peripheral clock enable */

/* enable SPI clock */

RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI4, ENABLE);

/* enable GPIO clock */

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE, ENABLE);

/* enable DMA clock */

RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2, ENABLE);

/* SPI GPIO Configuration */

/* connect SPI pins to AF5 */

GPIO_PinAFConfig(GPIOE, GPIO_PinSource2, GPIO_AF_SPI4);

GPIO_PinAFConfig(GPIOE, GPIO_PinSource5, GPIO_AF_SPI4);

GPIO_PinAFConfig(GPIOE, GPIO_PinSource6, GPIO_AF_SPI4);

   GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;

   GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

   GPIO_InitStructure.GPIO_PuPd  = GPIO_PuPd_DOWN;

   /* SPI SCK pin configuration */

   GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2;

   GPIO_Init(GPIOE, &GPIO_InitStructure);

  

   /* SPI RX pin configuration */

   GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_5;

   GPIO_Init(GPIOE, &GPIO_InitStructure);  

   /* SPI TX pin configuration */

   GPIO_InitStructure.GPIO_Pin =  GPIO_Pin_6;

   GPIO_Init(GPIOE, &GPIO_InitStructure);

/* SPI CS pin configuration */

GPIO_InitStructure.GPIO_Pin = GPIO_Pin_CS;

GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;

GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_UP;

GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

GPIO_Init(GPIOE, &GPIO_InitStructure);

/* no SPI Chip Select */

GPIO_SetBits(GPIO_CS, GPIO_Pin_CS);

/* SPI configuration */

SPI_I2S_DeInit(SPI4);

SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;

SPI_InitStructure.SPI_Mode = SPI_Mode_Master;

SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;

SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;

SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;

SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;

SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8;

SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;

SPI_InitStructure.SPI_CRCPolynomial = 7;

SPI_Init(SPI4, &SPI_InitStructure);

SPI_CalculateCRC(SPI4, DISABLE);

SPI_Cmd(SPI4, ENABLE);

/* test SPI */

SPI_I2S_SendData(SPI4, 0x55);

while (SPI_I2S_GetFlagStatus(SPI4, SPI_I2S_FLAG_TXE) == RESET) { ; }

SPI_Cmd(SPI4, DISABLE);

/* Deinit both streams */

   DMA_DeInit(DMA2_Stream1);

   DMA_DeInit(DMA2_Stream0);

   /* Configure DMA Initialization Structure */

   DMA_InitStructure.DMA_BufferSize = 123;

   DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable;

   DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_1QuarterFull;

   DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;

   DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;

   DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;

   DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;

   DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t) (&(SPI4->DR));

   DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;

   DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;

   DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;

   DMA_InitStructure.DMA_Priority = DMA_Priority_High;

/* Configure TX DMA */

   DMA_InitStructure.DMA_Channel = DMA_Channel_4;

   DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToPeripheral;

   DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)aTxBuffer;

   DMA_Init(DMA2_Stream1, &DMA_InitStructure);

   /* Configure RX DMA */

   DMA_InitStructure.DMA_Channel = DMA_Channel_4;

   DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralToMemory;

   DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)aRxBuffer;

   DMA_Init(DMA2_Stream0, &DMA_InitStructure);

// SPI_InitStructure.SPI_Mode = SPI_Mode_Master;

// SPI_Init(SPI4, &SPI_InitStructure);

   /* Enable DMA SPI TX Stream */

   DMA_Cmd(DMA2_Stream1,ENABLE);

   /* Enable DMA SPI RX Stream */

   DMA_Cmd(DMA2_Stream0,ENABLE);

   /* Enable SPI DMA TX Requsts */

   SPI_I2S_DMACmd(SPI4, SPI_I2S_DMAReq_Tx, ENABLE);

   /* Enable SPI DMA RX Requsts */

   SPI_I2S_DMACmd(SPI4, SPI_I2S_DMAReq_Rx, ENABLE);

/* Enable the SPI peripheral */

   SPI_Cmd(SPI4, ENABLE);

   /* Waiting the end of Data transfer */

while(DMA_GetFlagStatus(DMA2_Stream1,DMA_FLAG_TCIF1)==RESET);

   while(DMA_GetFlagStatus(DMA2_Stream0,DMA_FLAG_TCIF0)==RESET);

   /* Clear DMA Transfer Complete Flags */

   DMA_ClearFlag(DMA2_Stream1,DMA_FLAG_TCIF1);

   DMA_ClearFlag(DMA2_Stream0,DMA_FLAG_TCIF0);  

   /* Disable DMA SPI TX Stream */

   DMA_Cmd(DMA2_Stream1,DISABLE);

   /* Disable DMA SPI RX Stream */

   DMA_Cmd(DMA2_Stream0,DISABLE);

   /* Disable SPI DMA TX Requsts */

   SPI_I2S_DMACmd(SPI4, SPI_I2S_DMAReq_Tx, DISABLE);

   /* Disable SPI DMA RX Requsts */

   SPI_I2S_DMACmd(SPI4, SPI_I2S_DMAReq_Rx, DISABLE);

/* Disable the SPI peripheral */

   SPI_Cmd(SPI4, DISABLE);

sending a test byte without DMA works properly, so the SPI sould be fine. But when I initialize the DMA controller and just want to sent 10 bytes afterwards nothing gets sent and the code is stuck in the while-loop for checking the transmitting complete flag.

Is there anything I have forgotten or done wrong? Any ideas?
4 REPLIES 4
p23
Associate II
Posted on February 17, 2014 at 17:00

Nobody has a clue? I'm still face that problem... :(

Posted on February 17, 2014 at 18:00

Nobody has a clue? I'm still face that problem... :(

You seem a tad confused how forums work. Your code is incomplete, so it's hard to tell if the problems lay outside the code you chose to share. Does the DMA indicates some sort of transfer error? DMA and clocking appears to work for SPI4 on an STM32F429I-DISCO

// STM32F429I-DISCO SPI4 TX DMA Demo - sourcer32@gmail.com
// SPI4 90 MHz, /256 35155 Hz @ PE2
#include <
stdio.h
>
#include <
stdlib.h
>
#include ''stm32f429i_discovery.h''
//****************************************************************************
void GPIO_Configuration(void)
{
GPIO_InitTypeDef GPIO_InitStructure;
/* GPIOE clock enable */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE, ENABLE);
/* SPI SCK/MISO/MOSI pin configuration */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;
GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;
GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2 | GPIO_Pin_5 | GPIO_Pin_6;
GPIO_Init(GPIOE, &GPIO_InitStructure);
GPIO_PinAFConfig(GPIOE, GPIO_PinSource2, GPIO_AF_SPI4); // PE2 SPI4_CLK (F427/F429 Parts)
GPIO_PinAFConfig(GPIOE, GPIO_PinSource5, GPIO_AF_SPI4); // PE5 SPI4_MISO
GPIO_PinAFConfig(GPIOE, GPIO_PinSource6, GPIO_AF_SPI4); // PE6 SPI4_MOSI
}
//****************************************************************************
void SPI_Configuration(void)
{
SPI_InitTypeDef SPI_InitStructure;
RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI4, ENABLE);
/* SPI configuration */
SPI_I2S_DeInit(SPI4);
/* Initializes the SPI communication */
SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;
SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;
SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;
SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;
SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;
SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256;
SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;
SPI_InitStructure.SPI_CRCPolynomial = 7;
SPI_InitStructure.SPI_Mode = SPI_Mode_Master;
SPI_Init(SPI4, &SPI_InitStructure);
/* The Data transfer is performed in the SPI using Direct Memory Access */
/* Enable DMA SPI TX Stream */
DMA_Cmd(DMA2_Stream1, ENABLE);
/* Enable SPI DMA TX Requsts */
SPI_I2S_DMACmd(SPI4, SPI_I2S_DMAReq_Tx, ENABLE);
/* Enable the SPI peripheral */
SPI_Cmd(SPI4, ENABLE);
}
//****************************************************************************
uint8_t TxBuffer[] = ''The quick brown fox jumps over the lazy dog'';
void DMA_Configuration(void)
{
DMA_InitTypeDef DMA_InitStructure;
/* DMA clock enable */
RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2, ENABLE);
// DMA2 Channel4 Stream1 SPI4_TX
DMA_DeInit(DMA2_Stream1);
DMA_StructInit(&DMA_InitStructure);
DMA_InitStructure.DMA_Channel = DMA_Channel_4;
DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(&SPI4->DR);
DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&TxBuffer[0];
DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToPeripheral;
DMA_InitStructure.DMA_BufferSize = sizeof(TxBuffer) - 1;
DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;
DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;
DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;
DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;
DMA_InitStructure.DMA_Priority = DMA_Priority_High;
DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable;
DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;
DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;
DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;
DMA_Init(DMA2_Stream1, &DMA_InitStructure);
/* Enable DMA Stream Transfer Complete interrupt */
DMA_ITConfig(DMA2_Stream1, DMA_IT_TC, ENABLE);
}
//****************************************************************************
void NVIC_Configuration(void)
{
NVIC_InitTypeDef NVIC_InitStructure;
/* Enable the DMA gloabal Interrupt */
NVIC_InitStructure.NVIC_IRQChannel = DMA2_Stream1_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);
}
//****************************************************************************
void DMA2_Stream1_IRQHandler(void)
{
/* Test on DMA Stream Transfer Complete interrupt */
if (DMA_GetITStatus(DMA2_Stream1, DMA_IT_TCIF1))
{
/* Clear DMA Stream Transfer Complete interrupt pending bit */
DMA_ClearITPendingBit(DMA2_Stream1, DMA_IT_TCIF1);
/* Toggle LED3 */
STM_EVAL_LEDToggle(LED3);
}
}
//****************************************************************************
int main(void)
{
/* Initialize Leds mounted on STM32F429I-DISCO board */
STM_EVAL_LEDInit(LED3);
/* Turn on LED3 */
STM_EVAL_LEDOn(LED3);
NVIC_Configuration();
GPIO_Configuration();
DMA_Configuration();
SPI_Configuration();
while(1); // Do not exit
}
//****************************************************************************
// Rough SWV support in Keil, STM32F429I-DISCO, Make SB9 to connect PB3/SWO
//****************************************************************************
#include <
rt_misc.h
>
#pragma import(__use_no_semihosting_swi)
struct __FILE { int handle; /* Add whatever you need here */ };
FILE __stdout;
FILE __stdin;
int fputc(int ch, FILE *f)
{
ITM_SendChar(ch);
return(ch);
}
int fgetc(FILE *f)
{
char ch;
ch = 1;
return((int)ch);
}
int ferror(FILE *f)
{
/* Your implementation of ferror */
return EOF;
}
void _ttywrch(int ch)
{
ITM_SendChar(ch);
}
void _sys_exit(int return_code)
{
label: goto label; /* endless loop */
}
//******************************************************************************
#ifdef USE_FULL_ASSERT
/**
* @brief Reports the name of the source file and the source line number
* where the assert_param error has occurred.
* @param file: pointer to the source file name
* @param line: assert_param error line source number
* @retval None
*/
void assert_failed(uint8_t* file, uint32_t line)
{
/* User can add his own implementation to report the file name and line number,
ex: printf(''Wrong parameters value: file %s on line %d

'', file, line) */
/* Infinite loop */
while (1)
{
}
}
#endif
//******************************************************************************

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
p23
Associate II
Posted on February 18, 2014 at 10:30

I'm not sure but i thought my code would be complete... Anyways, I implemented your code as follow:

/* Includes ------------------------------------------------------------------*/

#include ''main.h''

#include ''rtc.h''

#include ''SDCard_Flash.h''

#include ''stm32f4xx_gpio.h''

#include ''stm32f4xx.h''

#include ''stm32f4xx_gpio.h''

#include ''stm32f4xx_spi.h''

#include ''stm32f4xx_dma.h''

void NVIC_Config (void);

void DMA2_SPI_Init (void);

void SPI_Config (void);

void GPIO_SPI_Init (void);

uint8_t TxBuffer[] = ''The quick brown fox jumps over the lazy dog'';

u8 u8g_TCIF_Flag, u8g_HTIF_Flag, u8g_TEIF_Flag, u8g_DMEIF_Flag, u8g_FEIF_Flag = 0;

int main(void)

{  

/*!< At this stage the microcontroller clock setting is already configured, 

       this is done through SystemInit() function which is called from startup

       files (startup_stm32f429_439xx.s) before to branch to application main. 

       To reconfigure the default setting of SystemInit() function, refer to

       system_stm32f4xx.c file

     */

 

   if (SysTick_Config(SystemCoreClock / 100))

   {

     /* Capture error */

     while (1);

   }

NVIC_Config ();

GPIO_SPI_Init();

DMA2_SPI_Init();

SPI_Config();

u8g_TCIF_Flag  = DMA_GetFlagStatus(DMA2_Stream1, DMA_FLAG_TCIF1);

u8g_HTIF_Flag  = DMA_GetFlagStatus(DMA2_Stream1, DMA_FLAG_HTIF1);

u8g_TEIF_Flag  = DMA_GetFlagStatus(DMA2_Stream1, DMA_FLAG_TEIF1);

u8g_DMEIF_Flag = DMA_GetFlagStatus(DMA2_Stream1, DMA_FLAG_DMEIF1);

u8g_FEIF_Flag  = DMA_GetFlagStatus(DMA2_Stream1, DMA_FLAG_FEIF1);

  /* Infinite loop */

  while (1)

  {

  }

}

/*******************************************************************************/

void GPIO_SPI_Init (void)

{

  GPIO_InitTypeDef GPIO_InitStructure;

 

  /* GPIOE clock enable */

  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOE, ENABLE);

 

  /* SPI SCK/MISO/MOSI pin configuration */

  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;

  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_50MHz;

  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;

  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_DOWN;

  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_2 | GPIO_Pin_5 | GPIO_Pin_6;

  GPIO_Init(GPIOE, &GPIO_InitStructure);

 

  GPIO_PinAFConfig(GPIOE, GPIO_PinSource2, GPIO_AF_SPI4); // PE2 SPI4_CLK

  GPIO_PinAFConfig(GPIOE, GPIO_PinSource5, GPIO_AF_SPI4); // PE5 SPI4_MISO

  GPIO_PinAFConfig(GPIOE, GPIO_PinSource6, GPIO_AF_SPI4); // PE6 SPI4_MOSI

}

/*******************************************************************************/

void SPI_Config (void)

{

  SPI_InitTypeDef SPI_InitStructure;

 

  RCC_APB2PeriphClockCmd(RCC_APB2Periph_SPI4, ENABLE);

 

  /* SPI configuration */

  SPI_I2S_DeInit(SPI4);

 

  /* Initializes the SPI communication */

 

  SPI_InitStructure.SPI_Direction = SPI_Direction_2Lines_FullDuplex;

  SPI_InitStructure.SPI_DataSize = SPI_DataSize_8b;

  SPI_InitStructure.SPI_CPOL = SPI_CPOL_Low;

  SPI_InitStructure.SPI_CPHA = SPI_CPHA_1Edge;

  SPI_InitStructure.SPI_NSS = SPI_NSS_Soft;

  SPI_InitStructure.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_256;

  SPI_InitStructure.SPI_FirstBit = SPI_FirstBit_MSB;

  SPI_InitStructure.SPI_CRCPolynomial = 7;

  SPI_InitStructure.SPI_Mode = SPI_Mode_Master;

 

  SPI_Init(SPI4, &SPI_InitStructure);

 

  /* The Data transfer is performed in the SPI using Direct Memory Access */

 

  /* Enable DMA SPI TX Stream */

  DMA_Cmd(DMA2_Stream1, ENABLE);

 

  /* Enable SPI DMA TX Requsts */

  SPI_I2S_DMACmd(SPI4, SPI_I2S_DMAReq_Tx, ENABLE);

 

  /* Enable the SPI peripheral */

  SPI_Cmd(SPI4, ENABLE);

}

/*******************************************************************************/

void DMA2_SPI_Init (void)

{

  DMA_InitTypeDef DMA_InitStructure;

 

  /* DMA clock enable */

  RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_DMA2, ENABLE);

 

  // DMA2 Channel4 Stream1 SPI4_TX

 

  DMA_DeInit(DMA2_Stream1);

  DMA_StructInit(&DMA_InitStructure);

  DMA_InitStructure.DMA_Channel = DMA_Channel_4;

  DMA_InitStructure.DMA_PeripheralBaseAddr = (uint32_t)(&SPI4->DR);

  DMA_InitStructure.DMA_Memory0BaseAddr = (uint32_t)&TxBuffer[0];

  DMA_InitStructure.DMA_DIR = DMA_DIR_MemoryToPeripheral;

  DMA_InitStructure.DMA_BufferSize = sizeof(TxBuffer) - 1;

  DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Disable;

  DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;

  DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte;

  DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte;

  DMA_InitStructure.DMA_Mode = DMA_Mode_Circular;

  DMA_InitStructure.DMA_Priority = DMA_Priority_High;

  DMA_InitStructure.DMA_FIFOMode = DMA_FIFOMode_Disable;

  DMA_InitStructure.DMA_FIFOThreshold = DMA_FIFOThreshold_Full;

  DMA_InitStructure.DMA_MemoryBurst = DMA_MemoryBurst_Single;

  DMA_InitStructure.DMA_PeripheralBurst = DMA_PeripheralBurst_Single;

  DMA_Init(DMA2_Stream1, &DMA_InitStructure);

 

  /* Enable DMA Stream Transfer Complete interrupt */

  DMA_ITConfig(DMA2_Stream1, DMA_IT_TC, ENABLE);

}

/*******************************************************************************/

void NVIC_Config (void)

{

  NVIC_InitTypeDef NVIC_InitStructure;

 

  /* Enable the DMA gloabal Interrupt */

  NVIC_InitStructure.NVIC_IRQChannel = DMA2_Stream1_IRQn;

  NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0;

  NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;

  NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;

  NVIC_Init(&NVIC_InitStructure);

}

/**

 * @brief  This function handles DMA Stream interrupt request.

 * @param  None

 * @retval None

 */

void DMA2_Stream1_IRQHandler(void)

{

  /* Test on DMA Stream Transfer Complete interrupt */

  if (DMA_GetITStatus(DMA2_Stream1, DMA_IT_TCIF1))

  {

    /* Clear DMA Stream Transfer Complete interrupt pending bit */

    DMA_ClearITPendingBit(DMA2_Stream1, DMA_IT_TCIF1);

 

    /* Toggle LED3 */

   // STM_EVAL_LEDToggle(LED3);

  }

}

sadly your code isn't working for me. It's not sending, therefore I'm not getting an interrupt. So I added the part to save the flags. None of the flags exept the 'Stream Error Flag' is set. The description in the Standard Peripherals Library says 'DMA_FLAG_TEIFx : to indicate that a Transfer Error event occurred'.

Ok. Pretty obvious... But what can be the trigger that an error occurs?
p23
Associate II
Posted on February 18, 2014 at 10:31

double post...