1. ホーム
  2. リナックス

mach-mini2440.c:155: error: array type has incomplete element type

2022-02-10 06:04:59

最新のmini2440 linux移植開発ガイドに従って、"Nandドライバの移植とパーティション情報の変更"の操作で、ドキュメントを修正した後、zImageをコンパイルすると、常にコンパイルに失敗し、次のようなエラーメッセージが表示されます。

arch/arm/mach-s3c2440/mach-mini2440.c:155: error: array type has incomplete element type



arch/arm/mach-s3c2440/mach-mini2440.c:156: error: array index in non-array initializer



arch/arm/mach-s3c2440/mach-mini2440.c:156: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:158: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:158: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:160: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:160: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:162: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:162: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:165: error: array index in non-array initializer



arch/arm/mach-s3c2440/mach-mini2440.c:165: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:166: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:166: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:168: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:168: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:170: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:170: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:173: error: array index in non-array initializer



arch/arm/mach-s3c2440/mach-mini2440.c:173: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:174: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:174: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:176: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:176: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:178: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:178: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:180: error: array index in non-array initializer



arch/arm/mach-s3c2440/mach-mini2440.c:180: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:181: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:181: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:183: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:183: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:185: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:185: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:187: error: array index in non-array initializer




arch/arm/mach-s3c2440/mach-mini2440.c:187: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:188: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:188: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:190: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:190: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:192: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:192: error: (near initialization for 'mini2440_default_nand_part')



arch/arm/mach-s3c2440/mach-mini2440.c:197: error: array type has incomplete element type



arch/arm/mach-s3c2440/mach-mini2440.c:198: error: array index in non-array initializer



arch/arm/mach-s3c2440/mach-mini2440.c:198: error: (near initialization for 'mini2410_nand_sets')



arch/arm/mach-s3c2440/mach-mini2440.c:199: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:199: error: (near initialization for 'mini2410_nand_sets')



arch/arm/mach-s3c2440/mach-mini2440.c:200: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:200: error: (near initialization for 'mini2410_nand_sets')



arch/arm/mach-s3c2440/mach-mini2440.c:201: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:201: error: (near initialization for 'mini2410_nand_sets')



arch/arm/mach-s3c2440/mach-mini2440.c:201: warning: type defaults to 'int' in declaration of 'type name'



arch/arm/mach-s3c2440/mach-mini2440.c:201: warning: type defaults to 'int' in declaration of 'type name'



arch/arm/mach-s3c2440/mach-mini2440.c:201: error: negative width in bit-field '<anonymous>'



arch/arm/mach-s3c2440/mach-mini2440.c:202: error: field name not in record or union initializer



arch/arm/mach-s3c2440/mach-mini2440.c:202: error: (near initialization for 'mini2410_nand_sets')



arch/arm/mach-s3c2440/mach-mini2440.c:205: error: variable 'mini2440_nand_info' has initializer but incomplete type



arch/arm/mach-s3c2440/mach-mini2440.c:206: error: unknown field 'tacls' specified in initializer



arch/arm/mach-s3c2440/mach-mini2440.c:206: warning: excess elements in struct initializer



arch/arm/mach-s3c2440/mach-mini2440.c:206: warning: (near initialization for 'mini2440_nand_info')



arch/arm/mach-s3c2440/mach-mini2440.c:207: error: unknown field 'twrph0' specified in initializer



arch/arm/mach-s3c2440/mach-mini2440.c:207: warning: excess elements in struct initializer



arch/arm/mach-s3c2440/mach-mini2440.c:207: warning: (near initialization for 'mini2440_nand_info')



arch/arm/mach-s3c2440/mach-mini2440.c:208: error: unknown field 'twrph1' specified in initializer



arch/arm/mach-s3c2440/mach-mini2440.c:208: warning: excess elements in struct initializer



arch/arm/mach-s3c2440/mach-mini2440.c:208: warning: (near initialization for 'mini2440_nand_info')



arch/arm/mach-s3c2440/mach-mini2440.c:209: error: unknown field 'nr_sets' specified in initializer



arch/arm/mach-s3c2440/mach-mini2440.c:209: error: 'mini2440_nand_sets' undeclared here (not in a function)



arch/arm/mach-s3c2440/mach-mini2440.c:209: warning: type defaults to 'int' in declaration of 'type name'



arch/arm/mach-s3c2440/mach-mini2440.c:209: warning: type defaults to 'int' in declaration of 'type name'




arch/arm/mach-s3c2440/mach-mini2440.c:209: error: negative width in bit-field '<anonymous>'



arch/arm/mach-s3c2440/mach-mini2440.c:209: warning: excess elements in struct initializer



arch/arm/mach-s3c2440/mach-mini2440.c:209: warning: (near initialization for 'mini2440_nand_info')



arch/arm/mach-s3c2440/mach-mini2440.c:210: error: unknown field 'sets' specified in initializer



arch/arm/mach-s3c2440/mach-mini2440.c:210: warning: excess elements in struct initializer



arch/arm/mach-s3c2440/mach-mini2440.c:210: warning: (near initialization for 'mini2440_nand_info')



arch/arm/mach-s3c2440/mach-mini2440.c:211: error: unknown field 'ignore_unset_ecc' specified in initializer



arch/arm/mach-s3c2440/mach-mini2440.c:211: warning: excess elements in struct initializer



arch/arm/mach-s3c2440/mach-mini2440.c:211: warning: (near initialization for 'mini2440_nand_info')



<スパン ネットで多くのブログやフォーラムを読んだ後、私はようやく以下のサイトで自分にとって正しい答えを見つけました。

ドライバー/mtd/nand/s3c2410.c を変更して ecc checksum をオフにします。

    chip->ecc.mode = NAND_ECC_SOFT;






に変更します。
chip->ecc.mode = NAND_ECC_NONE;

注:上記のこのステップをやっていないので、うまくいくかどうかわからないので、後で実験して見ます。


では。
macn-mini2440にヘッダーファイルを追加します。

#include <plat/common-smdk.h>



#include <linux/mtd/mtd.h>



#include <linux/mtd/nand.h>



#include <linux/mtd/nand_ecc.h>



#include <linux/mtd/partitions.h>



#include <plat/nand.h>



再度zImageをコンパイルするとOK.

<スパン リンク http://www.arm9home.net/simple/index.php?t7611.html