/* * uartm - easy uart logger * by uratan! 2020.6.18 */ /* * uartm とは? */ 何かのシリアル通信をモニターしなければならなくなったとき、簡易的に でっち上げた uart logger です。 LPC810 には USART モジュールが 2つしかなく、片方(uart0)はログ結果を PC に出力するために使いますので、残りの USART の RxD を PME を使って 2本に水増しし、対象のシリアル通信の往復の両方向をセンスします。 そのため対象のシリアル通信は、送信と受信が時間軸で完全に分離した 半二重方式でなければなりませんが、対象の通信内容に合わせて表示形式も 自由にプログラミングできますので それなりに頼りになるツールとなりました。 input: uart1-RxD-#1: (PIO0_2) uart1-RxD-#2: (PIO0_3) ... 共に 2400bps, parity-even, no pull-up-Rs output: uart0: 57600bps (PIO0_4, same as ISP) (input: pushSW: (PIO0_1) ... ) 対象の通信条件を Startup.S 末に定義しているのは、コンパイラのない現場で hex ファイルだけから通信条件を変えられるようにと思ってのことですが、 まあ勇み足ですね。また何かあると嫌なので内蔵プルアップも外してあります。 ファームウェアは my 60-LED clock 用の赤外線リモコンである irt-NN.zip を ベースに拡張して作成しています。そのため本機能とは関係のない機能も残って しまっていますが、必要に応じてその場で さっと こしらえたツールとして そのままにしてあります。 /* * FILES * ( irt-12.zip より派生) */ 00README.txt --- this file Makefile --- Makefile for make.exe link.awk --- a AWK script to generate linker script Startup.S --- CPU start up, target serial configuration main.c --- main entry common.h --- system shared difinitions common.c --- system shared functions (uart) rprintf.c --- simple printf() (from sample of WinARM_20060606.zip) uart1.c --- handle uart1 to peek target serial communication sctimer.c --- UNUSED (generate 38kHz to modulate Ir signal) uartm-NN.hex --- a hex file image made Compiler used is gcc-4.7.1(2012-0616) from yagarto You may need sh.exe and rm.exe, seek it from web please. (see also https://sourceforge.net/projects/yagarto/files/) Get LPC810 related definitions from: lpcopen_2_01_lpcxpresso_nxp_lpcxpresso_812.zip (LPCXpresso v6.1.0_164, LPCOpen 2.xx software package for LPCXpresso LPC812 boead) then place lpc_chip_8xx_lib/inc/ to ../chip-inc/. Don't you have GNU awk ? use this. -- uratan@miomio.jp