Code to load a LPC1114 over tx/rx. I have only tested with a 1114 chip but it should work with other LPC uControllers
Dependencies: DirectoryList MODSERIAL mbed
Fork of ika_shouyu_poppoyaki by
Diff: verification.cpp
- Revision:
- 26:a63e73885b21
- Parent:
- 24:9830b4f1207b
- Child:
- 27:2b5c1eb39bb5
--- a/verification.cpp Fri Sep 13 03:51:14 2013 +0000 +++ b/verification.cpp Fri Sep 13 12:56:23 2013 +0000 @@ -17,6 +17,8 @@ verify_binary_data( fp ); else verify_uucoded_data( fp ); + + return ( 0 ); // this is temporallry return code } @@ -43,8 +45,6 @@ error( "malloc error happened (in verify process, read data buffer)\r\n" ); - printf( "\r\n ==== flash reading and verifying ====\r\n" ); - while ( size = fread( bf, sizeof( char ), flash_reading_size, fp ) ) { if ( read_size < 0x20 ) { @@ -53,11 +53,11 @@ if ( checksum_count == 7 ) { checksum = 0xFFFFFFFF - checksum + 1; *((unsigned int *)(bf + i)) = checksum; - //printf( "\r\n\r\n -- calculated checksum : 0x%08X\r\n", checksum ); + //printf( "\r\n\r\n -- calculated checksum : 0x%08X\r\n", checksum ); } else { checksum += *((unsigned int *)(bf + i)); } - + checksum_count++; } } @@ -80,12 +80,12 @@ if ( error_flag ) break; - + read_size += size; // printf( " total %d bytes read\r\n", read_size ); } - + error_state |= error_flag; printf( " total %d bytes read\r", read_size ); @@ -143,7 +143,7 @@ if ( error_flag ) break; - + read_size += size; // printf( " total %d bytes read\r", read_size ); }