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_common.h

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

File content as of revision 4:02980a730cfb:

/*
 * mbed Headder file for Hardware Monitor
 *
 *  Copyright (c) 2014 Kenji Arai / JH1PJL
 *  http://www.page.sannet.ne.jp/kenjia/index.html
 *  http://mbed.org/users/kenjiArai/
 *      Created: June       1st, 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.
 */
 
 //  Object ----------------------------------------------------------------------------------------
extern Serial pch(USBTX, USBRX);

//  Definition ------------------------------------------------------------------------------------
#define BAUD_RATE 9600

#define BAUD(x)             pch.baud(x)
#define GETC(x)             pch.getc(x)
#define PUTC(x)             pch.putc(x)
#define PRINTF(...)         pch.printf(__VA_ARGS__)
#define READABLE(x)         pch.readable(x)

// Range check status
#define ERR_NOTHING         0
#define ERR_MODIFY_SIZ      1
#define ERR_OUT_OF_RANGE    2

// Reg. Size
#define SIZE8               8
#define SIZE16              16
#define SIZE32              32
#define SIZE_FULL           32
#define SIZE_X              32

//  RAM -------------------------------------------------------------------------------------------
extern char linebuf[];
extern int buf_size;

#if USE_MEM
typedef struct {
    int32_t mstr;
    int32_t msiz;
    int32_t mtmp;
    int32_t mold;
    uint8_t  mflg;
    uint8_t  mbhw;
} MEMO;
static MEMO mem;
#endif

//  Function prototypes ---------------------------------------------------------------------------
extern void put_rn ( void );
extern void put_r ( void );
extern void put_lin ( void );
extern void put_spc( uint8_t n);
extern void get_line (char *buff, int len);
extern int xatoi (char **str, int32_t *res);