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: main.cpp
- Revision:
- 29:96e28bc1bd99
- Parent:
- 28:689c3880e0e4
- Child:
- 30:e0d7524661ca
diff -r 689c3880e0e4 -r 96e28bc1bd99 main.cpp --- a/main.cpp Fri Sep 20 00:40:08 2013 +0000 +++ b/main.cpp Fri Sep 20 01:48:26 2013 +0000 @@ -81,6 +81,7 @@ target_param *tpp; int data_size; int last_sector; + int transferred_size; int err; if ( NULL == (tpp = open_target( ISP_BAUD_RATE )) ) { @@ -109,14 +110,19 @@ printf( "\r\n ==== flash writing ====\r\n" ); - if ( err = write_flash( fp, tpp ) ) + if ( err = write_flash( fp, tpp, &transferred_size ) ) return ( err ); + + printf( " -- %d bytes data are written\r\n", transferred_size ); + printf( "\r\n ==== flash reading and verifying ====\r\n" ); - if ( err = verify_flash( fp, tpp ) ) + if ( err = verify_flash( fp, tpp, &transferred_size ) ) return ( err ); + printf( " -- %d bytes data are read and verified\r\n", transferred_size ); + fclose( fp ); post_writing_process( tpp );