ºìÁªLinuxÃÅ»§
Linux°ïÖú

ADC²É¼¯

·¢²¼Ê±¼ä:2011-08-08 17:16:46À´Ô´:ºìÁª×÷Õß:zl870213
Çë¸÷λ´óÏÀ·¹ý¿´¿´£º
Îҵİå×ÓÊÇtiny6410£¬ÏµÍ³×Ô´øµÄADCÊÇͨ¹ýµ÷ÊÔµç×èAIN0£©À´²âÊÔ£¬ÏÖÔÚÎҸĻ»Ò»Ï£¬ÓÃÆäËû·À´²É¼¯Ðźš£±ÈÈçAIN1£¬AIN2µÈ£¬ÎÒ×¼±¸¸ü¸Ä36Äں˸½´øµÄADCÇý¶¯£¬ÎÒÊ×ÏÈÔÚÐéÄâ»úµÄºìñÀïÃæÓÃÓÑÉƵÄarm-linux-gcc4.5.1°ÑÓÑÉƵÄADCÇý¶¯³ÌÐò£¨Ð޸ĵ½ÆäËûͨµÀ£©½øÐбàÒ룬Èç¹ûûÓб¨´í£¬ÎҾͰÑËü±àÒëµ½36ÄÚºËÀïÃ棬»òÕß¼ÓÔØÕâ¸öÄ£¿é£¬µ±È»µÄ°É֮ǰ×Ô´øµÄжÔصô£¬Ö®ºóÔÚÒÆÖ²µ½°å×ÓÉÏ¡£

ÖÁÓÚÇý¶¯µÄÐÞ¸ÄÎÒÊÇÕâÑùÏëµÄ£º
ÏÈ°ÑÓÑÉƵÄADÇý¶¯ÐÞ¸ÄÒ»¸öͨµÀÊÔһϣ¬Èç¹ûÐУ¬ÔÚ°É×Ô¼º¸ÄµÄ½áºÏÍøÉϵÄһЩADCÇý¶¯°´ÕÕ֮ǰ¸ãµÄ£¬°ÑËü¸ãµ½°å×ÓÉÏÈ¥¡£

ÏÖÔÚÓöµ½µÄÎÊÌâÊÇ£ºÓÃarm-linux-gcc±àÒëʱ³öÏÖmini_6410adc.c£ºfatal error£ºlinux/module.h:no such file or directory compilation terminated.

Ï£ÍûÓиã¹ý²É¼¯µÄ»òÕßÊìϤ±¾¹ý³ÌµÄ¸øһЩ½¨Ò飬
ÔÙ´ÎÏÈл¹ýÀ²£¡
ÎÄÕÂÆÀÂÛ

¹²ÓÐ 4 ÌõÆÀÂÛ

  1. zl870213 ÓÚ 2011-08-10 11:16:24·¢±í:

    Õâ¸öadc_zl_1.koÊÇÎÒÔÚÓúͰå×ÓÒ»ÑùµÄÄÚºË2.6.38ÔÚpc»úÉϱàÒëµÄadc_zl_1.koÎļþ¡£ÆäÖÐÖ»ÊÇ°ÑÓÑÉƵÄADCÇý¶¯ÉÔ¼ÓÐ޸ģ¨Í¨µÀ»»ÁËһϣ©£¬µÄ˵Ã÷µÄÊÇÓÑÉÆ°å×ÓµÄϵͳÀïÃæÓиöadc¡£ÀͼÝÇë¸÷λ°ïÎÒ¿´¿´¡£
    [root@FriendlyARM 2.6.38-FriendlyARM]# modprobe adc_zl_1
    modprobe: module 'adc_zl_1' not found
    [root@FriendlyARM 2.6.38-FriendlyARM]# insmod adc_zl_1.ko
    ------------[ cut here ]------------
    WARNING: at fs/sysfs/dir.c:455 sysfs_add_one+0x80/0xa8()//ÎÒ¾õµÃÕâÈýÐÐÊÇ´íÎó¹Ø¼üµ«²»Ã÷°×sysfs: cannot create duplicate filename '/devices/virtual/misc/adc'
    Modules linked in: adc_zl_1(+)
    [] (unwind_backtrace+0x0/0xe4) from [] (warn_slowpath_common
    +0x4c/0x64)
    [] (warn_slowpath_common+0x4c/0x64) from [] (warn_slowpath_f
    mt+0x2c/0x3c)
    [] (warn_slowpath_fmt+0x2c/0x3c) from [] (sysfs_add_one+0x80
    /0xa8)
    [] (sysfs_add_one+0x80/0xa8) from [] (create_dir+0x5c/0xac)
    [] (create_dir+0x5c/0xac) from [] (sysfs_create_dir+0xb8/0xe
    0)
    one_wire_status: 2
    [] (sysfs_create_dir+0xb8/0xe0) from [] (kobject_add_interna
    l+0xd0/0x1e8)
    [] (kobject_add_internal+0xd0/0x1e8) from [] (kobject_add+0x
    68/0x8c)
    one_wire_status: 2
    [] (kobject_add+0x68/0x8c) from [] (device_add+0xa0/0x508)
    [] (device_add+0xa0/0x508) from [] (device_create_vargs+0x84
    /0xcc)
    [] (device_create_vargs+0x84/0xcc) from [] (device_create+0x
    1c/0x24)
    one_wire_status: 2
    [] (device_create+0x1c/0x24) from [] (misc_register+0xbc/0x1
    28)
    [] (misc_register+0xbc/0x128) from [] (dev_init+0xa4/0xd8 [a
    dc_zl_1])
    one_wire_status: 2
    [] (dev_init+0xa4/0xd8 [adc_zl_1]) from [] (do_one_initcall+
    0xbc/0x190)
    [] (do_one_initcall+0xbc/0x190) from [] (sys_init_module+0x1
    58c/0x1754)
    one_wire_status: 4
    [] (sys_init_module+0x158c/0x1754) from [] (ret_fast_syscall
    +0x0/0x30)
    ---[ end trace 3328e7f542e004dc ]---
    kobject_add_internal failed for adc with -EEXIST, don't try to register things w
    ith the same name in the same directory.
    [] (unwind_backtrace+0x0/0xe4) from [] (kobject_add_internal
    +0x1bc/0x1e8)
    [] (kobject_add_internal+0x1bc/0x1e8) from [] (kobject_add+0
    x68/0x8c)
    one_wire_status: 5
    [] (kobject_add+0x68/0x8c) from [] (device_add+0xa0/0x508)
    [] (device_add+0xa0/0x508) from [] (device_create_vargs+0x84
    /0xcc)
    [] (device_create_vargs+0x84/0xcc) from [] (device_create+0x
    1c/0x24)
    [] (device_create+0x1c/0x24) from [] (misc_register+0xbc/0x1
    28)
    [] (misc_register+0xbc/0x128) from [] (dev_init+0xa4/0xd8 [a
    dc_zl_1])
    one_wire_status: 2
    [] (dev_init+0xa4/0xd8 [adc_zl_1]) from [] (do_one_initcall+
    0xbc/0x190)
    [] (do_one_initcall+0xbc/0x190) from [] (sys_init_module+0x1
    58c/0x1754)
    [] (sys_init_module+0x158c/0x1754) from [] (ret_fast_syscall
    +0x0/0x30)
    one_wire_status: 2
    adc initialized
    insmod: can't insert 'adc_zl_1.ko': File exists

  2. zl870213 ÓÚ 2011-08-09 14:48:11·¢±í:

    ÎÒÒªÔÚÐéÄâ»úÖÐÅäÖúͰå×ÓÄÚºËÒ»ÑùµÄÔ´´úÂëÊ÷£ºÎÒÏÖÔÚwindowsÏ°ÉÕâ¸ö °æ±¾µÄ.38½âѹ³öÀ´£¬È»ºóͨ¹ýsmb¹²Ïíµ½ÐéÄâ»úµÄ/usr/src/ÏÂÃ棬ӦΪ¿´¼ûÐéÄâ»úµÃlinuxµÄÄÚºËÒ²·ÅÔÚÕ⣬
    È»ºóÔÚÕâô×öÄØ£¿
    Ä¿µÄÊÇÔÚÀûÓÃÕâ¸öºÍ°å×ÓÒ»ÑùµÄÄں˱àÒëеÄADCÇý¶¯Ä£¿éÉú³É.koÎļþ£¬È»ºó¿½±´µ½°å×ÓÉÏÔÚ°àÉϽøÐÐÇý¶¯Ä£¿éµÄ°²×°¡£
    ÇëÄÄλ°ï×Å°ÉÏêϸµÄ²½ÖèÁгöÀ´£¬¸ÕѧϰÕâ¸ö£¬Íû´Í½Ì£¡

  3. liusongguang ÓÚ 2011-08-09 12:28:27·¢±í:

    ѧϰ·¹ý

  4. alick ÓÚ 2011-08-09 10:55:30·¢±í:

    ÒýÓÃ:
    ÏÖÔÚÓöµ½µÄÎÊÌâÊÇ£ºÓÃarm-linux-gcc±àÒëʱ³öÏÖmini_6410adc.c£ºfatal error£ºlinux/module.h:no such file or directory compilation terminated.

    ûÓÐÄں˵ÄÍ·Îļþ¡£

    ÒÉÎÊ£ºÂ¥Ö÷µÄϵͳÊÇ ºìñÄĸö°æ±¾£¿ÊÇ·ñ°²×°ÁË kernel-headers Èí¼þ°ü£¿