NOTICE توجه: این یک موضوع قدیمی است که آخرین پست ارسالی آن مربوط به 3768 روز قبل است . لطفا فقط پاسخ ها ، سوالات و درخواست های 100 درصد مرتبط را به آن ارسال کنید و برای درخواست ها و سوالات جدید موضوع جدیدی را ایجاد کنید
نمایش نتایج: از 1 به 7 از 7

موضوع: مشکل در وارد کردن کتابخونه st به پروژه

  1. #1
    کاربر علاقه مند
    تاریخ عضویت
    Dec 2012
    نوشته ها
    33
    تشکر
    27
    تشکر شده 9 بار در 7 پست

    Red face مشکل در وارد کردن کتابخونه st به پروژه

    با سلام
    دوستان من روی برد stm32f4 discovery کار میکنم.
    سوال این جاست که هنگامی که مثال های خود ST رو rebuild میکنم ، هیچ مشکلی به وجود نمیاد و پروژه کامپایل میشه. امّا زمانی که دقیقاً (عیناً) همون پروژه رو میخواهیم خودمون به وجود بیاریم ( تمامی کتابخونه های مورد نیاز داخل پوشه پروژه کپی شده و داخل پروژه include شده اند) ، در پنجره build out پیغام های زیر نمایش داده میشود و نهایتاً پروژه کامپایل نمیشود :

    کد:
    Rebuild target 'Target 1'
    compiling main.c...
    main.c(34): error:  #20: identifier "GPIO_InitTypeDef" is undefined
    main.c(58): warning:  #223-D: function "RCC_AHB1PeriphClockCmd" declared implicitly
    main.c(58): error:  #20: identifier "RCC_AHB1Periph_GPIOD" is undefined
    main.c(61): error:  #20: identifier "GPIO_Pin_12" is undefined
    main.c(61): error:  #20: identifier "GPIO_Pin_13" is undefined
    main.c(61): error:  #20: identifier "GPIO_Pin_14" is undefined
    main.c(61): error:  #20: identifier "GPIO_Pin_15" is undefined
    main.c(62): error:  #20: identifier "GPIO_Mode_OUT" is undefined
    main.c(63): error:  #20: identifier "GPIO_OType_PP" is undefined
    main.c(64): error:  #20: identifier "GPIO_Speed_100MHz" is undefined
    main.c(65): error:  #20: identifier "GPIO_PuPd_NOPULL" is undefined
    main.c(66): warning:  #223-D: function "GPIO_Init" declared implicitly
    main.c(71): warning:  #223-D: function "GPIO_SetBits" declared implicitly
    main.c(94): warning:  #223-D: function "GPIO_ResetBits" declared implicitly
    compiling stm32f4xx_it.c...
    compiling system_stm32f4xx.c...
    compiling stm32f4_discovery.c...
    stm32f4_discovery.c(69): error:  #20: identifier "GPIO_Pin_12" is undefined
    stm32f4_discovery.c(69): error:  #20: identifier "GPIO_Pin_13" is undefined
    stm32f4_discovery.c(69): error:  #20: identifier "GPIO_Pin_14" is undefined
    stm32f4_discovery.c(70): error:  #20: identifier "GPIO_Pin_15" is undefined
    stm32f4_discovery.c(71): error:  #20: identifier "RCC_AHB1Periph_GPIOD" is undefined
    stm32f4_discovery.c(76): error:  #20: identifier "GPIO_Pin_0" is undefined
    stm32f4_discovery.c(78): error:  #20: identifier "RCC_AHB1Periph_GPIOA" is undefined
    stm32f4_discovery.c(80): error:  #20: identifier "EXTI_Line0" is undefined
    stm32f4_discovery.c(82): error:  #20: identifier "EXTI_PortSourceGPIOA" is undefined
    stm32f4_discovery.c(84): error:  #20: identifier "EXTI_PinSource0" is undefined
    stm32f4_discovery.c(87): error:  #20: identifier "NVIC_InitTypeDef" is undefined
    stm32f4_discovery.c(118): error:  #20: identifier "GPIO_InitTypeDef" is undefined
    stm32f4_discovery.c(121): warning:  #223-D: function "RCC_AHB1PeriphClockCmd" declared implicitly
    stm32f4_discovery.c(125): error:  #20: identifier "GPIO_Mode_OUT" is undefined
    stm32f4_discovery.c(126): error:  #20: identifier "GPIO_OType_PP" is undefined
    stm32f4_discovery.c(127): error:  #20: identifier "GPIO_PuPd_UP" is undefined
    stm32f4_discovery.c(128): error:  #20: identifier "GPIO_Speed_50MHz" is undefined
    stm32f4_discovery.c(129): warning:  #223-D: function "GPIO_Init" declared implicitly
    stm32f4_discovery.c(190): error:  #20: identifier "GPIO_InitTypeDef" is undefined
    stm32f4_discovery.c(191): error:  #20: identifier "EXTI_InitTypeDef" is undefined
    stm32f4_discovery.c(192): error:  #20: identifier "NVIC_InitTypeDef" is undefined
    stm32f4_discovery.c(195): warning:  #223-D: function "RCC_AHB1PeriphClockCmd" declared implicitly
    stm32f4_discovery.c(196): warning:  #223-D: function "RCC_APB2PeriphClockCmd" declared implicitly
    stm32f4_discovery.c(196): error:  #20: identifier "RCC_APB2Periph_SYSCFG" is undefined
    stm32f4_discovery.c(199): error:  #20: identifier "GPIO_Mode_IN" is undefined
    stm32f4_discovery.c(200): error:  #20: identifier "GPIO_PuPd_NOPULL" is undefined
    stm32f4_discovery.c(202): warning:  #223-D: function "GPIO_Init" declared implicitly
    stm32f4_discovery.c(207): warning:  #223-D: function "SYSCFG_EXTILineConfig" declared implicitly
    stm32f4_discovery.c(211): error:  #20: identifier "EXTI_Mode_Interrupt" is undefined
    stm32f4_discovery.c(212): error:  #20: identifier "EXTI_Trigger_Rising" is undefined
    stm32f4_discovery.c(214): warning:  #223-D: function "EXTI_Init" declared implicitly
    stm32f4_discovery.c(222): warning:  #223-D: function "NVIC_Init" declared implicitly
    stm32f4_discovery.c(234): warning:  #223-D: function "GPIO_ReadInputDataBit" declared implicitly
    compiling misc.c...
    misc.c(115): warning:  #223-D: function "assert_param" declared implicitly
    misc.c(135): warning:  #223-D: function "assert_param" declared implicitly
    misc.c(177): warning:  #223-D: function "assert_param" declared implicitly
    misc.c(196): warning:  #223-D: function "assert_param" declared implicitly
    misc.c(220): warning:  #223-D: function "assert_param" declared implicitly
    compiling stm32f4xx_exti.c...
    stm32f4xx_exti.c(124): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_exti.c(193): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_exti.c(224): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_exti.c(246): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_exti.c(262): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_exti.c(285): warning:  #223-D: function "assert_param" declared implicitly
    compiling stm32f4xx_gpio.c...
    stm32f4xx_gpio.c(123): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(187): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(260): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(304): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(326): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(343): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(365): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(383): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(402): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(422): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(445): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(459): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_gpio.c(535): warning:  #223-D: function "assert_param" declared implicitly
    compiling stm32f4xx_syscfg.c...
    stm32f4xx_syscfg.c(105): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_syscfg.c(124): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_syscfg.c(142): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_syscfg.c(160): warning:  #223-D: function "assert_param" declared implicitly
    compiling stm32f4xx_rcc.c...
    stm32f4xx_rcc.c(240): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(296): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(331): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(356): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(396): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(439): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(462): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(488): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(503): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(521): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(548): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(586): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(692): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(745): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(777): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(808): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(985): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1015): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1032): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1049): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1088): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1120): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1147): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1197): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1237): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1276): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1305): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1329): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1376): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1412): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1458): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1490): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1517): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1567): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1607): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1652): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1692): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1754): warning:  #223-D: function "assert_param" declared implicitly
    stm32f4xx_rcc.c(1785): warning:  #223-D: function "assert_param" declared implicitly
    assembling startup_stm32f4xx.s...
    Target not created
    تصویر پروژه ایجاد شده توسط بنده:



    تصویر پروژه ایجاد شده توسط ST:




    از دوستان ممنون میشم راهنمایی کنند .

  2. # ADS
    Circuit advertisement
    تاریخ عضویت
    Always
    نوشته ها
    Many
     

  3. #2
    مدیرکل انجمنها Doloop آواتار ها
    تاریخ عضویت
    Aug 2011
    نام
    حسين
    نوشته ها
    1,964
    تشکر
    3,312
    تشکر شده 3,086 بار در 1,371 پست

    پیش فرض

    سلام
    ساخت پروژه های CMSIS یکم دنگ و فنگ داره
    اگر منظور شما از انجام تنظیمات و اضافه کردن فایل ها به پروژه فقط همین Add کردن فایل ها توی قسمت Project هست باید بگم کافی نیست

    شما تنظیمات آدرس زیر رو هم انجام دادید ؟؟؟ فکر کنم علت اون همه ارور همین باشه

    Flash->Configure Flash Tools->C/Cpp

    توی آدرس زیر نحوه ساخت پروژه CMSIS کامل توضیح داده شده ...

    آموزش ساخت پروژه با توابع cmsis - ایـــــــــران میـــــــکرو ™
    *** اللّهم عجّل لولیک الفرج ***

  4. کاربران : 5 تشکر کرده اند از شما Doloop برای ارسال این پست سودمند:


  5. #3
    کاربر علاقه مند
    تاریخ عضویت
    Dec 2012
    نوشته ها
    33
    تشکر
    27
    تشکر شده 9 بار در 7 پست

    پیش فرض

    سلام به Doloop گُلم
    دستت درد نکنه ، واقعاً کارم راه افتاد
    ان شاالله صد در دنیا و هزار در آخرت خداوند به شما خیر و برکت اهدا نماید.

  6. تشکرها از این نوشته :


  7. #4
    کاربر علاقه مند
    تاریخ عضویت
    Dec 2012
    نوشته ها
    33
    تشکر
    27
    تشکر شده 9 بار در 7 پست

    پیش فرض

    با سلام دوباره
    فقط یه چیزی یکم تو ذوق میزنه :

    کد:
    #include "stm32f4xx_conf.h"
    
    GPIO_InitTypeDef  GPIO_InitStructure;
    
    
    void Delay(__IO uint32_t nCount);
    
    
    int main(void)
    {
    
      /* GPIOD Periph clock enable */
      RCC_AHB1PeriphClockCmd(RCC_AHB1Periph_GPIOD, ENABLE);
    
      /* Configure PD12, PD13, PD14 and PD15 in output pushpull mode */
      GPIO_InitStructure.GPIO_Pin = GPIO_Pin_12 | GPIO_Pin_13| GPIO_Pin_14| GPIO_Pin_15;
      GPIO_InitStructure.GPIO_Mode = GPIO_Mode_OUT;
      GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
      GPIO_InitStructure.GPIO_Speed = GPIO_Speed_100MHz;
      GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
      GPIO_Init(GPIOD, &GPIO_InitStructure);
    
      while (1)
      {
        /* PD12 to be toggled */
        GPIO_SetBits(GPIOD, GPIO_Pin_12);
        
        /* Insert delay */
        Delay(0x6FFFFF);
        
        /* PD13 to be toggled */
        GPIO_SetBits(GPIOD, GPIO_Pin_13);
        
        /* Insert delay */
        Delay(0x6FFFFF);
      
        /* PD14 to be toggled */
        GPIO_SetBits(GPIOD, GPIO_Pin_14);
        
        /* Insert delay */
        Delay(0x6FFFFF);
        
        /* PD15 to be toggled */
        GPIO_SetBits(GPIOD, GPIO_Pin_15);
        
        /* Insert delay */
        Delay(0x6FFFFF);
        
        GPIO_ResetBits(GPIOD, GPIO_Pin_12|GPIO_Pin_13|GPIO_Pin_14|GPIO_Pin_15);
        
        /* Insert delay */
        Delay(0x6FFFFF);
      }
    }
    
    
    void Delay(__IO uint32_t nCount)
    {
      while(nCount--)
      {
      }
    }
    
    
    #ifdef  USE_FULL_ASSERT
    
    
    void assert_failed(uint8_t* file, uint32_t line)
    { 
      
      while (1)
      {
      }
    }
    #endif
    اونم اینه که کامپایلر کنار #include "stm32f4xx_conf.h" یه علامت ضربدر میزاره که به عنوان fatal error معرفی میکنه و میگه #include "stm32f4xx_conf.h" file not found در صورتی که بدون هیچ گونه ارور و وارنینگ و ... برنامه رو کامپایل میکنه و برنامه هم درست کار میکنه .
    جالب اینجاست وقتی #include "stm32f4xx_conf.h" رو از main حذف میکنیم تمامی توابع ناشناخته میشوند و کامپایلر کلی ارور میده .

    به نظر شما مشکل از کجاست؟




    ویرایش توسط abolfazlk873 : 03-01-2014 در ساعت 16:04

  8. #5
    مدیرکل انجمنها Doloop آواتار ها
    تاریخ عضویت
    Aug 2011
    نام
    حسين
    نوشته ها
    1,964
    تشکر
    3,312
    تشکر شده 3,086 بار در 1,371 پست

    پیش فرض

    سلام

    سلام به Doloop گُلم
    دستت درد نکنه ، واقعاً کارم راه افتاد
    ان شاالله صد در دنیا و هزار در آخرت خداوند به شما خیر و برکت اهدا نماید.
    خواهش ...
    قابل دار نیست
    اونم اینه که کامپایلر کنار #include "stm32f4xx_conf.h" یه علامت ضربدر میزاره که به عنوان fatal error معرفی میکنه و میگه #include "stm32f4xx_conf.h" file not found در صورتی که بدون هیچ گونه ارور و وارنینگ و ... برنامه رو کامپایل میکنه و برنامه هم درست کار میکنه .
    خوب اصلا نیازی نیست این هدر رو توی Main فرا بخونی فقط هدرش رو کنار فایل های پروژت کپی کن بعد اگه توی اون قسمتی که باید آدرس پوشه های مربوط به پروژه رو تعریف میکردی
    Flash->Configure Flash Tools->C/Cpp
    درست عمل کرده باشی بعد از کامپایل برنامه هدر توی قسمت Project ادد میشه
    در ضمن شما ابتدای فایل Main چرا stm32f4xx.h رو فرا نخوندی
    دارم به دونسته های خودم شک میکنم که چطور برنامت ارور نمیده .!!!

    پروژت رو قرار بدی راحت تر میتونم بگم چه بلاهایی سر پروژه آوردی

    ولی باز این نکات رو میگم

    شما دو خط اول main این دوتا رو بنویس :
    کد:
    #include "stm32f4xx.h"
    #include "system_stm32f4xx.h"
    فکر کنم مشکلت درست بشه
    *** اللّهم عجّل لولیک الفرج ***

  9. کاربران : 3 تشکر کرده اند از شما Doloop برای ارسال این پست سودمند:


  10. #6
    کاربر علاقه مند
    تاریخ عضویت
    Dec 2012
    نوشته ها
    33
    تشکر
    27
    تشکر شده 9 بار در 7 پست

    پیش فرض

    با سلام
    دوست عزیز من بدون اینکه کتابخونه stm32f4xx.h رو داخل main.c اینکلود کنم از پروژم جواب گرفتم.
    البته فکر میکنم این به این دلیله که stm32f4xx.h داخل کتابخونه stm32f4xx_adc.h اینکلود شده است. و stm32f4xx_adc.h داخل stm32f4xx_conf.h اینکلود شده است و stm32f4xx_conf.h داخل پروژه من اینکلود شده است.
    اون مشکلمم بدون اینکه کار خاصی بکنم حل شد.(برنامه رو باز و بسته کردم)
    باز اگر نکته ای هست ممنون میشم ذکر کنید.
    پروژه رو ضمیمه کردم.
    Download ADC.rar

  11. تشکرها از این نوشته :


  12. #7
    مدیرکل انجمنها Doloop آواتار ها
    تاریخ عضویت
    Aug 2011
    نام
    حسين
    نوشته ها
    1,964
    تشکر
    3,312
    تشکر شده 3,086 بار در 1,371 پست

    پیش فرض

    سلام
    پس بازی از کیل بود این مورد توی ورژن های جدید هم هنوز وجود داره منتها نیازی به بستن نیست قسمتی از دستور رو پاک و مجددا تایپ کنی درست میشه ...

    همه چی درسته
    موفق باشی
    *** اللّهم عجّل لولیک الفرج ***

  13. تشکرها از این نوشته :


مجوز های ارسال و ویرایش

  • شما نمیتوانید موضوع جدیدی ارسال کنید
  • شما امکان ارسال پاسخ را ندارید
  • شما نمیتوانید فایل پیوست کنید.
  • شما نمیتوانید پست های خود را ویرایش کنید
  •