This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

DMA1 channel problem

Hi guys,

i have a problem about selection of DMA1 channels. i'm using an example application. and i did some changes on it. Application uses DMA1_Channel3. i have changed channel as DMA1_Channel1. But compiler give this error message:

..\source\main.c(112): error: #20: identifier "DMA1_Channel1" is undefined

if i use DMA1_Channel3, there is no problem. i opened _map.h and i comfirmed that DMA1_Channel1 and DMA1_Channel3 are defined.

my DMA code is here:

  DMA_InitStructure.DMA_PeripheralBaseAddr = (u32)bellek1;
  DMA_InitStructure.DMA_MemoryBaseAddr = (u32)bellek2;
  DMA_InitStructure.DMA_DIR = DMA_DIR_PeripheralSRC;
  DMA_InitStructure.DMA_BufferSize = 512;
  DMA_InitStructure.DMA_PeripheralInc = DMA_PeripheralInc_Enable;
  DMA_InitStructure.DMA_MemoryInc = DMA_MemoryInc_Enable;
  DMA_InitStructure.DMA_PeripheralDataSize = DMA_PeripheralDataSize_HalfWord;
  DMA_InitStructure.DMA_MemoryDataSize = DMA_MemoryDataSize_HalfWord;
  DMA_InitStructure.DMA_Mode = DMA_Mode_Normal;
  DMA_InitStructure.DMA_Priority = DMA_Priority_VeryHigh;
  DMA_InitStructure.DMA_M2M = DMA_M2M_Enable;
  DMA_Init(DMA1_Channel1, &DMA_InitStructure);

  //DMA_ITConfig(DMA1_Channel1, DMA_IT_TC | DMA_IT_HT | DMA_IT_TE, ENABLE);
  DMA_Cmd(DMA1_Channel1, ENABLE);
 </pre|


please help me.
best regards


Parents Reply Children
  • thanks for your comments.
    my chip is STM32f103ZET6. you can see my a bit of map.h here

    #ifdef _DMA1_Channel1
      #define DMA1_Channel1       ((DMA_Channel_TypeDef *) DMA1_Channel1_BASE)
    #endif /*_DMA1_Channel1 */
    
    #ifdef _DMA1_Channel2
      #define DMA1_Channel2       ((DMA_Channel_TypeDef *) DMA1_Channel2_BASE)
    #endif /*_DMA1_Channel2 */
    
    #ifdef _DMA1_Channel3
      #define DMA1_Channel3       ((DMA_Channel_TypeDef *) DMA1_Channel3_BASE)
    #endif /*_DMA1_Channel3 */
    
    #ifdef _DMA1_Channel4
      #define DMA1_Channel4       ((DMA_Channel_TypeDef *) DMA1_Channel4_BASE)
    #endif /*_DMA1_Channel4 */
    
    *
    *
    *
    

    when i use DMA1_channel3 and close the code part in map.h as you can see below, i receive same error message for DMA1_channel3:

    /*#ifdef _DMA1_Channel3
      #define DMA1_Channel3       ((DMA_Channel_TypeDef *) DMA1_Channel3_BASE)
    #endif*/
    

    i think, it shows that i included it there is no problem. i'm using dma for fsmc for LCD driving. i'm confused :(

  • hello all,

    i found the problem. i channged conf.h. some definations was closed. i opened them after then everting is ok:)
    thanks