在进行CH374\CH374LIB\MCS51\LIB6\EXAM9试验时,进行到调用CreateDirectory( void )函数,到i = CH374FileWriteX( ); /* 写目录的第一个扇区 */这句就进行不下去了,我比较了FILE_DATA_BUF地址,感觉没问题啊,后面还改了小端模式还是到那里通不过,感觉是CH374FileWriteX( ) 函数跑飞了,因为都没有返回i值,还有就是前面的默认数据: DirConstData = ". \x10\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x21\x30\x0\x0\x0\x0\x0\x0.. \x10\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x0\x21\x30\x0\x0\x0\x0\x0\x0";这是什么意思????为什么这么写???可以修改吗??~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~那位大虾救命啊!!help!help![Emot]27[/Emot]
CreateDirectory()这个函数请不要修改。51的大小端是固定的,我们库里面会考虑。不用去修改。 这些函数根本不要修改,你需要注意的是RAM是否溢出,中断引脚定义是否和你的实际电路一样,不一样修改即可。 这个程序占用的RAM很多。检查RAM是否溢出
我没用中断的,是查询的~~~现在已经能用了,不过问题又来了,就是建的子目录"/YEAR2004/MONTH05“这么没用啊,不是文件夹啊,显示根本打不开,属性也没有,就看见大小是1K???难道子目录不是文件夹吗??
我用的是M64外扩62256~~~~~刚才接着做试验,发现其中一个YEAR2004\DEMO2004.txt的DEMO2004.txt变成了文件夹,里面的演示数据变成了文件打不开了~~~其他的建的YEAR2004\DEMO2004.txt都正常直接就可以点开看见“演示数据”,而里面的MONTH05还是显示文件而不是文件夹,并且打不开,没有属性
新建目录始终不成功啊,只有自己建好第一级/YEAR2004,然后程序才能进行后面的~~~如果没建第一级子目录,老问题:运行到CreateDirectory( void )函数,到i = CH374FileWriteX( ); /* 写目录的第一个扇区 */这句就进行不下去了就没了,它自己跑飞了,没有返回值~~~~~~~~~~~~救命啊!!!!
Create Level 1 Directory /YEAR2004 准备写 在根目录下创建子目录 以创建文件的方法创建目录 如果成功 pDISK_BASE_BUF: DDA address: 102F DirXramBuf: 2E address: 102E DirXramBuf: 20 address: 102D DirXramBuf: 20 address: 102C DirXramBuf: 20 address: 102B DirXramBuf: 20 address: 102A DirXramBuf: 20 address: 1029 DirXramBuf: 20 address: 1028 DirXramBuf: 20 address: 1027 DirXramBuf: 20 address: 1026 DirXramBuf: 20 address: 1025 DirXramBuf: 20 address: 1024 DirXramBuf: 10 address: 1023 DirXramBuf: 00 address: 1022 DirXramBuf: 00 address: 1021 DirXramBuf: 00 address: 1020 DirXramBuf: 00 address: 101F DirXramBuf: 00 address: 101E DirXramBuf: 00 address: 101D DirXramBuf: 00 address: 101C DirXramBuf: 00 address: 101B DirXramBuf: 00 address: 101A DirXramBuf: 00 address: 1019 DirXramBuf: 00 address: 1018 DirXramBuf: 00 address: 1017 DirXramBuf: 21 address: 1016 DirXramBuf: 30 address: 1015 DirXramBuf: 00 address: 1014 DirXramBuf: 00 address: 1013 DirXramBuf: 00 address: 1012 DirXramBuf: 00 address: 1011 DirXramBuf: 00 address: 1010 DirXramBuf: 00 address: 100F DirXramBuf: 2E address: 100E DirXramBuf: 2E address: 100D DirXramBuf: 20 address: 100C DirXramBuf: 20 address: 100B DirXramBuf: 20 address: 100A DirXramBuf: 20 address: 1009 DirXramBuf: 20 address: 1008 DirXramBuf: 20 address: 1007 DirXramBuf: 20 address: 1006 DirXramBuf: 20 address: 1005 DirXramBuf: 20 address: 1004 DirXramBuf: 10 address: 1003 DirXramBuf: 00 address: 1002 DirXramBuf: 00 address: 1001 DirXramBuf: 00 address: 1000 DirXramBuf: 00 address: FFF DirXramBuf: 00 address: FFE DirXramBuf: 00 address: FFD DirXramBuf: 00 address: FFC DirXramBuf: 00 address: FFB DirXramBuf: 00 address: FFA DirXramBuf: 00 address: FF9 DirXramBuf: 00 address: FF8 DirXramBuf: 00 address: FF7 DirXramBuf: 21 address: FF6 DirXramBuf: 30 address: FF5 DirXramBuf: 00 address: FF4 DirXramBuf: 00 address: FF3 DirXramBuf: 00 address: FF2 DirXramBuf: 00 address: FF1 DirXramBuf: 00 address: FF0 DirXramBuf: 00 自身的起始簇号 结束起始簇号 count: 1C0 dir: FEE count: 1BF dir: FED count: 1BE dir: FEC count: 1BD dir: FEB count: 1BC dir: FEA count: 1BB dir: FE9 count: 1BA dir: FE8 count: 1B9 dir: FE7 count: 1B8 dir: FE6 count: 1B7 dir: FE5 count: 1B6 dir: FE4 count: 1B5 dir: FE3 count: 1B4 dir: FE2 count: 1B3 dir: FE1 count: 1B2 dir: FE0 count: 1B1 dir: FDF count: 1B0 dir: FDE count: 1AF dir: FDD count: 1AE dir: FDC count: 1AD dir: FDB count: 1AC dir: FDA count: 1AB dir: FD9 count: 1AA dir: FD8 count: 1A9 dir: FD7 count: 1A8 dir: FD6 count: 1A7 dir: FD5 count: 1A6 dir: FD4 count: 1A5 dir: FD3 count: 1A4 dir: FD2 count: 1A3 dir: FD1 count: 1A2 dir: FD0 count: 1A1 dir: FCF count: 1A0 dir: FCE count: 19F dir: FCD count: 19E dir: FCC count: 19D dir: FCB count: 19C dir: FCA count: 19B dir: FC9 count: 19A dir: FC8 count: 199 dir: FC7 count: 198 dir: FC6 count: 197 dir: FC5 count: 196 dir: FC4 count: 195 dir: FC3 count: 194 dir: FC2 count: 193 dir: FC1 count: 192 dir: FC0 count: 191 dir: FBF count: 190 dir: FBE count: 18F dir: FBD count: 18E dir: FBC count: 18D dir: FBB count: 18C dir: FBA count: 18B dir: FB9 count: 18A dir: FB8 count: 189 dir: FB7 count: 188 dir: FB6 count: 187 dir: FB5 count: 186 dir: FB4 count: 185 dir: FB3 count: 184 dir: FB2 count: 183 dir: FB1 count: 182 dir: FB0 count: 181 dir: FAF count: 180 dir: FAE count: 17F dir: FAD count: 17E dir: FAC count: 17D dir: FAB count: 17C dir: FAA count: 17B dir: FA9 count: 17A dir: FA8 count: 179 dir: FA7 count: 178 dir: FA6 count: 177 dir: FA5 count: 176 dir: FA4 count: 175 dir: FA3 count: 174 dir: FA2 count: 173 dir: FA1 count: 172 dir: FA0 count: 171 dir: F9F count: 170 dir: F9E count: 16F dir: F9D count: 16E dir: F9C count: 16D dir: F9B count: 16C dir: F9A count: 16B dir: F99 count: 16A dir: F98 count: 169 dir: F97 count: 168 dir: F96 count: 167 dir: F95 count: 166 dir: F94 count: 165 dir: F93 count: 164 dir: F92 count: 163 dir: F91 count: 162 dir: F90 count: 161 dir: F8F count: 160 dir: F8E count: 15F dir: F8D count: 15E dir: F8C count: 15D dir: F8B count: 15C dir: F8A count: 15B dir: F89 count: 15A dir: F88 count: 159 dir: F87 count: 158 dir: F86 count: 157 dir: F85 count: 156 dir: F84 count: 155 dir: F83 count: 154 dir: F82 count: 153 dir: F81 count: 152 dir: F80 count: 151 dir: F7F count: 150 dir: F7E count: 14F dir: F7D count: 14E dir: F7C count: 14D dir: F7B count: 14C dir: F7A count: 14B dir: F79 count: 14A dir: F78 count: 149 dir: F77 count: 148 dir: F76 count: 147 dir: F75 count: 146 dir: F74 count: 145 dir: F73 count: 144 dir: F72 count: 143 dir: F71 count: 142 dir: F70 count: 141 dir: F6F count: 140 dir: F6E count: 13F dir: F6D count: 13E dir: F6C count: 13D dir: F6B count: 13C dir: F6A count: 13B dir: F69 count: 13A dir: F68 count: 139 dir: F67 count: 138 dir: F66 count: 137 dir: F65 count: 136 dir: F64 count: 135 dir: F63 count: 134 dir: F62 count: 133 dir: F61 count: 132 dir: F60 count: 131 dir: F5F count: 130 dir: F5E count: 12F dir: F5D count: 12E dir: F5C count: 12D dir: F5B count: 12C dir: F5A count: 12B dir: F59 count: 12A dir: F58 count: 129 dir: F57 count: 128 dir: F56 count: 127 dir: F55 count: 126 dir: F54 count: 125 dir: F53 count: 124 dir: F52 count: 123 dir: F51 count: 122 dir: F50 count: 121 dir: F4F count: 120 dir: F4E count: 11F dir: F4D count: 11E dir: F4C count: 11D dir: F4B count: 11C dir: F4A count: 11B dir: F49 count: 11A dir: F48 count: 119 dir: F47 count: 118 dir: F46 count: 117 dir: F45 count: 116 dir: F44 count: 115 dir: F43 count: 114 dir: F42 count: 113 dir: F41 count: 112 dir: F40 count: 111 dir: F3F count: 110 dir: F3E count: 10F dir: F3D count: 10E dir: F3C count: 10D dir: F3B count: 10C dir: F3A count: 10B dir: F39 count: 10A dir: F38 count: 109 dir: F37 count: 108 dir: F36 count: 107 dir: F35 count: 106 dir: F34 count: 105 dir: F33 count: 104 dir: F32 count: 103 dir: F31 count: 102 dir: F30 count: 101 dir: F2F count: 100 dir: F2E count: FF dir: F2D count: FE dir: F2C count: FD dir: F2B count: FC dir: F2A count: FB dir: F29 count: FA dir: F28 count: F9 dir: F27 count: F8 dir: F26 count: F7 dir: F25 count: F6 dir: F24 count: F5 dir: F23 count: F4 dir: F22 count: F3 dir: F21 count: F2 dir: F20 count: F1 dir: F1F count: F0 dir: F1E count: EF dir: F1D count: EE dir: F1C count: ED dir: F1B count: EC dir: F1A count: EB dir: F19 count: EA dir: F18 count: E9 dir: F17 count: E8 dir: F16 count: E7 dir: F15 count: E6 dir: F14 count: E5 dir: F13 count: E4 dir: F12 count: E3 dir: F11 count: E2 dir: F10 count: E1 dir: F0F count: E0 dir: F0E count: DF dir: F0D count: DE dir: F0C count: DD dir: F0B count: DC dir: F0A count: DB dir: F09 count: DA dir: F08 count: D9 dir: F07 count: D8 dir: F06 count: D7 dir: F05 count: D6 dir: F04 count: D5 dir: F03 count: D4 dir: F02 count: D3 dir: F01 count: D2 dir: F00 count: D1 dir: EFF count: D0 dir: EFE count: CF dir: EFD count: CE dir: EFC count: CD dir: EFB count: CC dir: EFA count: CB dir: EF9 count: CA dir: EF8 count: C9 dir: EF7 count: C8 dir: EF6 count: C7 dir: EF5 count: C6 dir: EF4 count: C5 dir: EF3 count: C4 dir: EF2 count: C3 dir: EF1 count: C2 dir: EF0 count: C1 dir: EEF count: C0 dir: EEE count: BF dir: EED count: BE dir: EEC count: BD dir: EEB count: BC dir: EEA count: BB dir: EE9 count: BA dir: EE8 count: B9 dir: EE7 count: B8 dir: EE6 count: B7 dir: EE5 count: B6 dir: EE4 count: B5 dir: EE3 count: B4 dir: EE2 count: B3 dir: EE1 count: B2
目录要一级一级的建立,不可以一次建立多级目录 例如建立1/2 在建立2之前要确保1已经存在,不存在的话,要先建立1再建立2
我就是建第一级目录就出问题~~~~~~~跟踪代码运行,到这里: mCmdParam.WriteX.mDataBuffer = &FILE_DATA_BUF[0]; /* 缓冲区 */ ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ printf( "地址: %02X\n", &FILE_DATA_BUF[0] );¥¥¥¥¥¥¥到这里下面就就跑飞啦¥¥¥¥ ¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥ i = CH374FileWriteX( ); /* 写目录的第一个扇区 */ 然后就运行不下去了~~~~然后拔U盘到电脑上看u盘里面的情况,发现建的目录无法打开,而且没有属性,只显示大小1K~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~可能是什么原因啊??为什么我的到CH374FileWriteX( )这个函数老是不行啊???这个函数应该不难啊??我把DirXramBuf里面的数据都读了一遍,前面的DirConstData都读进去了,而且RAM没有溢出啊???是什么原因啊???~~~~~~~~~~~~~~~~~~~~~~~~~~~崩溃啊~~~~~~~大虾救命啊!!!!![Emot]27[/Emot][Emot]27[/Emot]
怎么没人啊???红桃六啊~~~~~快来帮忙啊!!!