Error On Writing Block Crc 1
by CloudFlare Ray ID: 2f19dd70b46027aa
30 Days In the Last 90 Days In the Last 6 Months Home/Discussion Forum LPC1788 MCI systematic CRC error on block write Next Thread | Thread List | Previous Thread Start a Thread | Settings Details Message Read-Only AuthorAntoine Gardiol Posted28-Aug-2012 09:51 GMT ToolsetARM LPC1788 MCI systematic CRC error on block write Antoine Gardiol Hi, During the migration of a project from LPC2478 to LPC1788 I get a near systematic issue when trying to write to an SD card. After each write block attempt I get an DATA CRC error in MCI status reg. I also was able to check that data are really not written on the card. http://team-xecuter.com/forums/threads/146241-Error-Writing-Blocks-Help-Will-Pay The exception is when almost all byte are 0xFF. In that case, data are written and no CRC error occurs. I tried to lower MCLK, PCLK and SD clock frequency (down to 2MHz) but it does not change anything. I tried several SD card too. I checked all errata sheet from NXP and did not find anything. With an identical board with an LPC2478, I never get this issue. Has anyone already encountered a similar http://www.keil.com/forum/21392/lpc1788-mci-systematic-crc-error-on-block-write issue ? I use a Keil RL-ARM library. Here is the source code of the driver (MCI commands 25 send separately by the library before calling this function) : /*--------------------------- WriteBlock -------------------------------------*/ static BOOL WriteBlock (U32 block, U8 *buf, U32 cnt) { /* Write a cnt number of 512 byte blocks to Flash Card. */ U32 i,j; for (j = 0; j < cnt; buf += 512, j++) { /* Set MCI Transfer registers. */ LPC_MCI->DATATMR = DATA_WR_TOUT_VALUE; LPC_MCI->DATALEN = 512; /* Start DMA Memory to Peripheral transfer. */ DmaStart (DMA_WRITE, buf); LPC_MCI->DATACTRL = 0x99; for (i = DMA_TOUT; i; i--) { if (LPC_GPDMA->RawIntTCStat & 0x01) { /* Data transfer finished. */ break; } } if (i == 0) { /* DMA Data Transfer timeout. */ return (__FALSE); } if (cnt == 1) { break; } /* Wait until Data Block sent to Card. */ while (LPC_MCI->STATUS != (MCI_DATA_END | MCI_DATA_BLK_END)) { if (LPC_MCI->STATUS & (MCI_DATA_CRC_FAIL | MCI_DATA_TIMEOUT)) { /* Error while Data Block sending occured. */ return (__FALSE); <------------------------------------------------------ systematic error with LPC_MCI->STATUS = 0x02 } } /* Wait 2 SD clocks */ for (i = WAIT_2SD_CLK(__CPUCLK); i; i--); } return (__TRUE); } Thanks by advance and best regards. Antoine Gardiol Read-Only AuthorTamir Michael Posted28-Aug-2012 11:58 GMT ToolsetARM RE: LPC1788 MCI systematic CRC error on block write Tamir Michael It has been
Sign in Pricing Blog Support Search GitHub This repository Watch 28 Star 221 Fork https://github.com/vasi/pixz/blob/master/src/write.c 20 vasi/pixz Code Issues 20 Pull requests 1 Projects 0 Pulse Graphs Permalink Branch: master Switch branches/tags Branches Tags master stream Nothing to show v1.0.6 http://www.ttinet.com/tti/secrets_file_io_001.html v1.0.5 v1.0.4 v1.0.3 v1.0.2 v1.0.1 v1.0 Nothing to show Find file Copy path pixz/src/write.c Fetching contributors… Cannot retrieve contributors at this time Raw Blame History error on 534 lines (435 sloc) 15.4 KB #include "pixz.h" #include
a data-block sequence number the data that you requested be backed up a CRC for readback error DETECTION The second type of data-block contains redundancy group data. These data blocks are used for readback error CORRECTION. A VMS BACKUP PURE DATA BLOCK +--------------------------------------------------+ |seq#|data|data|data|data|data|data|data|......|crc| +--------------------------------------------------+ A VMS BACKUP REDUNDANCY DATA BLOCK +--------------------------------------------------+ |redundancy data for last group of user data-blocks| +--------------------------------------------------+ 3.2 The Effects of Block Size The size of each data-block is determined by the /BLOCK_SIZE qualifier. The use of large blocks can greatly speed up backup operations and allow more data to be put onto a single reel of tape. However, when using low-density tape devices, care must be taken. Increasing the block size speeds up data written to tape and increases disk performance because a larger block of data can be read from disk. VMS BACKUP will use from three to five memory buffers to do its work. Each buffer contains one data-block. A 9-track reel of tape has only 10 feet of writable surface past the end-of-tape reflector. Therefore, when BACKUP detects the EOT reflector, it must write all remaining buffers to tape within that 10 feet. If a /BLOCK_SIZE=40960 is used with a low-density tape device (1600 BPI), 25 inches of tape are consumed each time a data-block is written to tape (40960/1600 = 25). If five buffers are being used by BACKUP, over 10 feet of tape will be consumed when the EOT reflector is encountered. This could cause the tape to spin off the end of the reel. If when writing one of the blocks, BACKUP gets a tape error, it will try to rewrite the block to tape. If the tape is already positioned past the EOT reflector, the tape may spin off the end of the reel trying to complete the write operation. 3.3 Sequence Number Usage Each data-block is written with a BACKUP supplied sequence number. If the tape drive detects a write error, then BACKUP rewrites the data-block using the same sequence number. The sequence number is incremented only after a "good" block has been written. When restoring, data-blocks are only written when the sequence number changes. In this way, only the "good" data-blocks are restored. 3.4 Error Detection and Correction By default, VMS BACKUP does b