Debug tools / show registers, memory and system clock data

Dependencies:   mbed CheckRTC

Target mbed board

LPC1768
LPC1114FN28
ST Nucleo L152RE
ST NUcleo F401RE
ST Nucleo F411RE

Command structure

Top

1 - goto step1 -> no connection all pins
2 - goto step2 -> connects pin_x and pin_y (not impliment yet)
t - Check and set RTC
x - Goto HW monitor
q - Return to main

>1

l - Check LED
b - Check button
s - CPU system info & clock
o - CPU clock output (Bug fix, port_mco1_mco2_set() function. Thanks Topi Makinen on April 25th, 2015)

>x(Hardware level monitor)

m - Entry Memory Mode
m>? -> Aditinal functions can see by ?
r - Entry Register Mode
r>? -> Aditinal functions can see by ?
s - System Clock -> sf, System / CPU information -> sc
q - Quit (back to called routine)
p - Entry Port Mode
p>? -> Aditinal functions can see by ?

Usage

Please modify "mon_hw_config.h" file for your purpose.
Especially LPC114FN28 has small memory, you cannot run your own program together with this program.
You don't need any additional HW. Just connect with PC via terminal software.

CAUTION

Due to several CPU's and short development time, I cannot grantee the quality level and several functions are not available yet.
If you found the bug, please let me know. Thanks in advance.

Revision:
3:455df34f7285
Parent:
2:b96103f9270e
--- a/debug_tools/debug_nucleo_F4x1RE.cpp	Sun Nov 02 09:28:26 2014 +0000
+++ b/debug_tools/debug_nucleo_F4x1RE.cpp	Sat Apr 25 04:23:59 2015 +0000
@@ -1,14 +1,14 @@
 /*
  * mbed Application program
  *
- *  Copyright (c) 2010-2014 Kenji Arai / JH1PJL
+ *  Copyright (c) 2010-2015 Kenji Arai / JH1PJL
  *  http://www.page.sannet.ne.jp/kenjia/index.html
  *  http://mbed.org/users/kenjiArai/
  *      Created:  May  	    15th, 2010
  *		Spareted: June		25th, 2014		mon() & mon_hw()
  *		Ported:   September 22nd, 2014		from L152RE, LP1114
  *      changed:  October   15th, 2014		mon.cpp to debug_xxx.cpp
- *      Revised:  Nobember   2nd, 2014
+ *      Revised:  April     25th, 2015		Bug fix ('o' command) pointed out by Topi Makinen
  *
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE
@@ -36,7 +36,7 @@
 
 //  Function prototypes ---------------------------------------------------------------------------
 extern void cpu_inf( char *ptr );
-extern void port_mco1_mco2_set(void);
+extern void port_mco1_mco2_set(uint8_t n);
 extern void port_mco1_mco2_recover(void);
 
 //-------------------------------------------------------------------------------------------------
@@ -147,30 +147,33 @@
                             cpu_inf(&c);
                             break;
 #if defined(TARGET_NUCLEO_F401RE) || defined(TARGET_NUCLEO_F411RE)
-                        case 'o' :
+                        case 'o' : // Bug fix on April 25, 2015
                             PRINTF("----- CPU CLOCK output from PA8 & PC9 -----");
                             put_rn();
-                            PRINTF("Please check carefully that PA8 & PC9 are no connection!!");
+                            PRINTF("Please check that both PA8 & PC9 ");
+                            PRINTF("are no connection with any peripheral I/O!!");
                             put_rn();
                             PRINTF("Are you okay? [y/n]");
                             put_rn();
                             c = GETC();
                             if (c == 'y') {
-                                port_mco1_mco2_set();
-                                PRINTF("Please measure PA8 & PC9 pins");
+                                port_mco1_mco2_set(0);
+                                port_mco1_mco2_set(1);
+                                PRINTF("Please measure frequency at PA8 & PC9 pins");
                                 put_rn();
-#if 0
                                 PRINTF("PA8: HSE/4");
                                 put_rn();
                                 PRINTF("PC9: SYSCLK/4");
                                 put_rn();
-#else
+                                PRINTF("Change requency (Please hit any key)");
+                                put_rn();
+								c = GETC();
+								port_mco1_mco2_set(2);
                                 PRINTF("PA8: HSE/1");
                                 put_rn();
                                 PRINTF("PC9: SYSCLK/2");
                                 put_rn();
-#endif
-                                PRINTF("If you finish, hit anykey");
+                                PRINTF("If you would like to finish, hit anykey");
                                 put_rn();
                                 c = GETC();
                                 port_mco1_mco2_recover();