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.

debug_tools/mon_hw_STM32.h

Committer:
kenjiArai
Date:
2015-04-26
Revision:
4:02980a730cfb
Parent:
2:b96103f9270e

File content as of revision 4:02980a730cfb:

/*
 * mbed Application program for the ST NUCLEO Board
 *
 *  Copyright (c) 2010-2014 Kenji Arai / JH1PJL
 *  http://www.page.sannet.ne.jp/kenjia/index.html
 *  http://mbed.org/users/kenjiArai/
 *      Created: July       7th, 2014
 *      Revised: Nobember   2nd, 2014
 *
 * 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
 * AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
 * DAMAGES OR OTHER  LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 */

//  ROM / Constant data ---------------------------------------------------------------------------
char *const rgmsg0 = " 7, 6, 5, 4, 3, 2, 1, 0";
char *const rgmsg1 = "15,14,13,12,11,10, 9, 8,";

char *const cmsg0 = "Use MSI(internal RC)";
char *const cmsg1 = "freq=";
char *const cmsg2 = "Use HSI(internal RC/High speed)";
char *const cmsg3 = "Use HSE(External Xtal)";
char *const cmsg4 = "Use PLL with";
char *const cmsg5 = "??? following infromation is not valid !";
char *const cmsg6 = "clock freq. =";
char *const cmsg7 = "No clock";
char *const cmsg8 = "Use LSE(external Xtal)=32768Hz";
char *const cmsg9 = "Use LSI(internal RC/Low speed), RC=";
char *const cmsg10= "Use HSE(external Xtal & prescaler)";
char *const cmsg11= "Power Control";

char *const imsg2 = "-->Control Reg.";
char *const imsg3 = "-->Status Reg.";
char *const imsg4 = "-->Data Reg.";
char *const imsg5 = "-->Baud rate Reg.";
char *const imsg6 = "-->Own address Reg.";
char *const imsg7 = "-->Clock control Reg.";
char *const imsg8 = "-->TRISE Reg.";

char *const rnmsg0 = " CR1--";
char *const rnmsg1 = " CR2--";
char *const rnmsg2 = " DR---";
char *const rnmsg3 = " SR---";
char *const rnmsg4 = " BRR--";
char *const rnmsg5 = " SR1--";
char *const rnmsg6 = " SR2--";
char *const rnmsg7 = " OAR1-";
char *const rnmsg8 = " OAR2-";
char *const rnmsg9 = " CCR--";
char *const rnmsg10 = " TRISE";

char *const pnmsg0 = "Port  ";
//                    0x00000000 0x0000  0x00000000 0x00000000 0x0000 0x0000
char *const pnmsg1 = "Mode      Out-type Out-speed  Pup/dwn    Input  Output";
char *const pnmsga = "GPIOA";
char *const pnmsgb = "GPIOB";
char *const pnmsgc = "GPIOC";
char *const pnmsgd = "GPIOD";
char *const pnmsge = "GPIOE";
char *const pnmsgh = "GPIOH";
char *const pnmsg2 = "Select GPIO";
char *const pnmsg3 = " All";
char *const pnmsg4 = "-->Output";
char *const pnmsg5 = "-->Input";
char *const pnmsg6 = "data";

// Here is redefine part (ST Nucleo F401RE needs here definition)
#ifndef GPIO_Mode_IN
#define GPIO_Mode_IN    0
#define GPIO_Mode_OUT   1
#define GPIO_Mode_AF    2
#define GPIO_Mode_AN    3
#endif

#ifndef GPIO_Speed_400KHz
#define GPIO_Speed_400KHz   0
#define GPIO_Speed_2MHz     1
#define GPIO_Speed_10MHz    2
#define GPIO_Speed_40MHz    3
#endif

#ifndef GPIO_PuPd_NOPULL
#define GPIO_PuPd_NOPULL    0
#define GPIO_PuPd_UP        1
#define GPIO_PuPd_DOWN      2
#endif