Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: DirectoryList MODSERIAL mbed
Fork of ika_shouyu_poppoyaki by
main.cpp
- Committer:
- okano
- Date:
- 2013-09-20
- Revision:
- 30:e0d7524661ca
- Parent:
- 29:96e28bc1bd99
- Child:
- 31:1a4d59d7bd72
File content as of revision 30:e0d7524661ca:
/**
* Sample of ISP operation for NXP MCUs
*
* @author Tedd OKANO
* @version 0.95
* @date Sep-2013
*
* This program programs MCU flash memory through UART. It uses
* "In-System Programming (ISP)" interface in target MCU (NXP LPC micro-
* controllers).
*
* The ISP is done by PC and serial cable normally. The ISP protocol is
* executed software on a PC. The software reads a data file and transfers
* the data with the ISP protocol.
* This program does same process of that. The mbed perform the function like
* "FlashMagic" and "lpc21isp".
* (This program not just copies the binary but also insert 4 byte checksum at
* address 0x1C.)
*
* This program currently supports LPC1114(LPC1114FN28/102 - DIP28-ARM) and
* LPC810(LPC810M021FN8 - DIP8-ARM).
*/
#include "mbed.h"
#include "isp.h"
#include "serial_utilities.h"
#include "_user_settings.h"
LocalFileSystem local( "local" );
int main()
{
int err;
printf( "\r\n\r\n\r\nmbed ISP program : programming LPC device from mbed (v0.95)\r\n" );
err = isp_flash_write( SOURCE_FILE );
printf( "\r\n %s\r\n\r\n",
err ?
"** The data could not be written :(" :
"** The data has been written successflly :)"
);
if ( err )
error( " ** ISP failed\r\n" );
#ifdef AUTO_PROGRAM_START
//set_target_baud_rate( TARGET_OPERATION_BAUD_RATE );
//reset_target( NO_ISP_MODE );
start_target_in_normal_mode( TARGET_OPERATION_BAUD_RATE );
printf( " ** The program in flash has been started!!\r\n" );
#endif
printf( " (now the mbed is working in \"serial through mode\")\r\n\r\n" );
// success.attach( &success_indicator, 0.1 );
start_success_indicator();
usb_serial_bridge_operation(); // doesn't return. infinite loop in this function
}
