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
_user_settings.h@42:2b40666d8177, 2014-10-18 (annotated)
- Committer:
- k4zuki
- Date:
- Sat Oct 18 07:36:54 2014 +0000
- Revision:
- 42:2b40666d8177
- Parent:
- 41:74b9ff21098f
- Child:
- 44:568799eac6df
LPC82x series supported (only 824 is tested)
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
okano | 29:96e28bc1bd99 | 1 | #ifndef MBED_ISP___USER_SETTINGS__ |
okano | 29:96e28bc1bd99 | 2 | #define MBED_ISP___USER_SETTINGS__ |
okano | 26:a63e73885b21 | 3 | |
k4zuki | 42:2b40666d8177 | 4 | /// file name for the binary data |
okano | 41:74b9ff21098f | 5 | // edit here if you need to use different file name or storage media |
okano | 41:74b9ff21098f | 6 | #define SOURCE_FILE "/local/bin" |
okano | 26:a63e73885b21 | 7 | |
okano | 25:33cb5ad8ae24 | 8 | |
okano | 25:33cb5ad8ae24 | 9 | // "ISP_BAUD_RATE" is baud rate for ISP operation |
okano | 25:33cb5ad8ae24 | 10 | #define ISP_BAUD_RATE 115200 |
okano | 25:33cb5ad8ae24 | 11 | |
okano | 33:ce9fff4cbf09 | 12 | |
okano | 25:33cb5ad8ae24 | 13 | // "TARGET_OPERATION_BAUD_RATE" is baud rate for USB-serial bridge operation after |
okano | 25:33cb5ad8ae24 | 14 | // ISP completion. |
okano | 25:33cb5ad8ae24 | 15 | // if the target application uses serial(UART) and you use the bridge feature, |
okano | 25:33cb5ad8ae24 | 16 | // please set this value correctly. |
okano | 26:a63e73885b21 | 17 | #define TARGET_OPERATION_BAUD_RATE 9600 |
okano | 25:33cb5ad8ae24 | 18 | |
okano | 33:ce9fff4cbf09 | 19 | |
okano | 41:74b9ff21098f | 20 | // suppress "command and result" monitoring output to terminal |
okano | 41:74b9ff21098f | 21 | // the "command and result" monitoring feature is made for debugging. |
okano | 41:74b9ff21098f | 22 | #define SUPPRESS_COMMAND_RESULT_MESSAGE |
okano | 41:74b9ff21098f | 23 | |
okano | 41:74b9ff21098f | 24 | |
okano | 26:a63e73885b21 | 25 | // enable "AUTO_PROGRAM_START" to let target starts the program after flash writing complete |
okano | 26:a63e73885b21 | 26 | #define AUTO_PROGRAM_START |
okano | 26:a63e73885b21 | 27 | |
okano | 26:a63e73885b21 | 28 | |
okano | 34:eaca33d3e632 | 29 | // disabling "ENABLE_WRITING" can be used for "verification only" operation. |
okano | 34:eaca33d3e632 | 30 | #define ENABLE_WRITING |
okano | 34:eaca33d3e632 | 31 | |
okano | 34:eaca33d3e632 | 32 | |
okano | 33:ce9fff4cbf09 | 33 | // enable "ENABLE_VERIFYING" to let perform verification by comparing "bin" file and flash read data. |
okano | 33:ce9fff4cbf09 | 34 | #define ENABLE_VERIFYING |
okano | 29:96e28bc1bd99 | 35 | |
okano | 33:ce9fff4cbf09 | 36 | |
okano | 33:ce9fff4cbf09 | 37 | // enable "CHECK_CRP_CODE" to check the CRP (Code Read Protection). The ISP writing will be ignored if "bin" file has CRP code. |
okano | 33:ce9fff4cbf09 | 38 | #define CHECK_CRP_CODE |
okano | 33:ce9fff4cbf09 | 39 | |
okano | 33:ce9fff4cbf09 | 40 | |
okano | 33:ce9fff4cbf09 | 41 | #endif // MBED_ISP___USER_SETTINGS__ |
okano | 33:ce9fff4cbf09 | 42 | |
okano | 35:0b434ef4af49 | 43 | |
okano | 35:0b434ef4af49 | 44 | |
okano | 35:0b434ef4af49 | 45 | |
okano | 35:0b434ef4af49 | 46 | //////////////////////////// |
okano | 35:0b434ef4af49 | 47 | // FOLLOWING IS MESSAGE THAT WILL BE SHOWN WHEN COMPILE THIS CODE |
okano | 35:0b434ef4af49 | 48 | // you can edit next lines if you want remove error/warning message |
okano | 35:0b434ef4af49 | 49 | /////////////////////////// |
okano | 35:0b434ef4af49 | 50 | |
okano | 35:0b434ef4af49 | 51 | #if defined( ENABLE_WRITING ) && defined( ENABLE_VERIFYING ) |
okano | 35:0b434ef4af49 | 52 | #define WHAT_WAS_DONE "written and verified" |
okano | 35:0b434ef4af49 | 53 | #elif defined( ENABLE_WRITING ) && !defined( ENABLE_VERIFYING ) |
okano | 35:0b434ef4af49 | 54 | #define WHAT_WAS_DONE "written" |
okano | 35:0b434ef4af49 | 55 | #warning "ENABLE_VERIFYING" in "_user_setting.h" is disabled. No verification will be performed. |
okano | 35:0b434ef4af49 | 56 | #elif !defined( ENABLE_WRITING ) && defined( ENABLE_VERIFYING ) |
okano | 35:0b434ef4af49 | 57 | #define WHAT_WAS_DONE "verified" |
okano | 35:0b434ef4af49 | 58 | #warning "ENABLE_WRITING" in "_user_setting.h" is disabled. No writing will be performed. |
okano | 35:0b434ef4af49 | 59 | #else |
okano | 35:0b434ef4af49 | 60 | #error both "ENABLE_WRITING" and "ENABLE_VERIFYING" are disabled ("in user_setting.h"). The program need to execute nothing |
okano | 35:0b434ef4af49 | 61 | #endif |
okano | 35:0b434ef4af49 | 62 |