Debug Printをシリアル経由で出力しようとしましたが、失敗しました。出直しです
データトレースを何処で取るかは、悩ましいです。出来れば一箇所で取りたいのですが、私は分散してしまいました。c_dataio.cには下記と類似の処理が沢山あるので、各所に入れています
c_dataio.c
メモリ中のメッセージ出力は、当初、別プログラムを用意しました。しかし、やはり面倒くさい
そもそも、私は何のプログラムを作っているのだろう。勿論、内部トレース用のプログラムを作っているのだけど、メインプログラムは何もやっていない。そうだ、メインで溜まったメッセージをだそう!!
p_main.c
2011.2.9 Wrap時の不良を修正
メインプログラムは(当初はHello World!を出していましたが)ただ、無為にループしているだけです。動いているのか止まっているのか分からないので、LEDを点滅させています。
あとは、偶に内部トレースが書き込まれたときにトレース出力します
Console_PutsはシリアルとUSBの両方に出力します。データトレースを取るとトレース自身が事象となり、USB出力がループしてしまいます。トレースはシリアルのみに出力するためSerial_Putsを追加しました
実行結果はすごく地味です
ただ、割り込みの延長でシリアル直接出力していた時には分からなかった、割り込みが沢山、発生していたことが分かります
bRequest=20,21って何?? ですが・・・
![](https://image02.seesaawiki.jp/h/8/h8h8h8/769421dc646734c5.jpg)
右のteraterm(COMポート4)はシリアル接続、左のteraterm(COMポート7)はUSB経由のシリアル接続です。左のteratermで入力した文字が右のteratermにもトレースと共に出力されます
ただ、それだけです(全角文字を入れると表示が変になりました)
データトレースでDevice Descriptorなどが取れているみたいですが、ちゃんと確認出来てません
今更ですが、USBを学習するならH8から初めた方が遥かに分かりやすいです。トラ技のサンプルには丁寧なコメントも付いています
SH-2Aはハードもドライバも難しすぎます
シリアル出力は115Kbpsだし、NAKでフロー制御もあるみたいなので大丈夫だろうと高を括っていました。実際、数レコードは上手く行ったのですが、出力メッセージが多くなると破綻しました
デバッグの基本はJTAGもあるみたいですが、私はprintf()だと考えています。ここは何とかDebug Printは出来るようにしておきたいです。シリアルより速いものとなると、USB。
USB? USBはイニシャライズ中でダメ
最後の手段として、in Core(メモリ中)にトレースを吐き出すことにしました
ただ、色々試行錯誤したので、どこを修正したかは正確には忘れてしまいました
せめて、ポイントだけを残しておきます
main.c
trace.h
p_usbint.c
2011.2.9 Wrap時の不良を修正
トレースの取り方は変わりません。Console_Puts(buff)をtrc_put(buff)にしただけ
trc_put(buff)はメモリに書込むだけです(シリアルより速い。RAMが1MBあるので出来る芸当です)
Cは初心者で、structを初めて書き(使い)ました
コンパイラーエラーのオンパレードで相当落ち込みました(エラーメッセージがセンス無さすぎ)
デバッグの基本はJTAGもあるみたいですが、私はprintf()だと考えています。ここは何とかDebug Printは出来るようにしておきたいです。シリアルより速いものとなると、USB。
USB? USBはイニシャライズ中でダメ
最後の手段として、in Core(メモリ中)にトレースを吐き出すことにしました
ただ、色々試行錯誤したので、どこを修正したかは正確には忘れてしまいました
せめて、ポイントだけを残しておきます
main.c
void main(void) { P_ModeInit(); io_init_scif2(); trc_init(); /* トレースの初期化 */ P_Main(); }
trace.h
/*******************************************/ /* 内部トレース定義 */ /*******************************************/ struct TRC { /* Trace managment table*/ struct TRCD * trcurp ; /* Trace Next pointer */ int trcwrap ; /* Wrap flag */ struct TRCD * trcprp ; /* Printed pointer */ struct TRCDI { _UWORD RYRCNT ; /* Year */ _UBYTE RMONCNT ; /* Month */ _UBYTE RDAYCNT ; /* Day */ _UBYTE RHRCNT ; /* Hour */ _UBYTE RMINCNT ; /* Minutes */ _UBYTE RSECCNT ; /* Second */ _UBYTE R64CNT ; /* 1/64 Sec */ } TTT ; } ; struct TRCD { /* Trace Data map */ struct TRCDT { _UBYTE RHRCNT ; /* Hour */ _UBYTE RMINCNT ; /* Minutes */ _UBYTE RSECCNT ; /* Second */ _UBYTE R64CNT ; /* 1/64 Sec */ _UBYTE MTYPE ; /* Message Type */ } TTT ; char trcd[122] ; /* Trace Data */ char rsv[1] ; /* */ } ; #define SOT (struct TRC *)0x1C080000 #define SOD (struct TRCD *)0x1C080080 #define EOT (struct TRCD *)0x1C0A0000
p_usbint.c
/****************************************************************************** * DISCLAIMER * This software is supplied by Renesas Technology Corp. and is only * intended for use with Renesas products. No other uses are authorized. * This software is owned by Renesas Technology Corp. and is protected under * all applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES * REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, * INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY * DISCLAIMED. * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS * TECHNOLOGY CORP. NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES * FOR ANY REASON RELATED TO THE THIS SOFTWARE, EVEN IF RENESAS OR ITS * AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * Renesas reserves the right, without notice, to make changes to this * software and to discontinue the availability of this software. * By using this software, you agree to the additional terms and * conditions found by accessing the following link: * http://www.renesas.com/disclaimer ******************************************************************************** * Copyright (C) 2009. Renesas Technology Corp., All Rights Reserved. * ********************************************************************************/ /*""FILE COMMENT""*********** Technical reference data ************************* * * System Name : SH7264 USB FUNCTION Sample Program * File Name : p_usbint.c * Abstract : Peripheral USB Interrupt * Version : 1.01.00 * Device : SH7264/SH7262 * Tool-Chain : High-performance Embedded Workshop (Ver.4.04.01). * : C/C++ compiler package for the SuperH RISC engine family * : (Ver.9.02 Release00). * OS : None * H/W Platform: M3A-HS64G50(CPU board) * * History : May.13.2009 ver.1.00.00 * : Sep.17.2009 ver.1.01.00 *""FILE COMMENT END""**********************************************************/ #include "usb.h" #include "trace.h" /*""FUNC COMMENT""************************************************************ * ID : * Outline : USB interrupt *----------------------------------------------------------------------------- * Include : *----------------------------------------------------------------------------- * Declaration : void P_USBInterrupt(void); *----------------------------------------------------------------------------- * Description : USB割り込み処理を実行します。 * : *----------------------------------------------------------------------------- * Argument : void *----------------------------------------------------------------------------- * Return Value: void *----------------------------------------------------------------------------- * Notice : * : *""FUNC COMMENT END""*********************************************************/ void trc_init() { struct TRC * trcp; char * p ; trcp = SOT; for ( p = (char *)trcp; p < (char *)EOT; p++) *p = ' '; /* All Space Clear */ trcp->trcurp = SOD; /* Top of Trace Area */ trcp->trcprp = SOD; /* All Printed */ trcp->trcwrap = 0 ; /* Do Not Wrap */ } void trc_put(char * inp) { int i; struct TRC * trcp; trcp = SOT; for (i=0; i<118; i++) { trcp->trcurp->trcd[i] = *inp; if ( (int)*inp++ == 0 ) break; } trcp->trcurp->trcd[i] = 0x00 ; trcp->trcurp++; if ( trcp->trcurp >= EOT ) /* Over ? */ { trcp->trcurp = SOD; /* Return to Top */ trcp->trcwrap = 1; /* Wrapped */ } } void h2c( char * inp, char * outp, int keta ) { int i; const char C[]="0123456789ABCDEF"; for (i=0; i<keta; i++,inp++) { *outp++ = C[(int)( *inp & 0xF0 ) / 16] ; *outp++ = C[(int)( *inp & 0x0F ) ] ; } } void P_USBInterrupt(void) { : 途中略 : } /*""FUNC COMMENT""************************************************************ * ID : * Outline : save request register *----------------------------------------------------------------------------- * Include : *----------------------------------------------------------------------------- * Declaration : void P_SaveRequest(void); *----------------------------------------------------------------------------- * Description : USBリクエスト情報を変数に保持します。 * : *----------------------------------------------------------------------------- * Argument : void *----------------------------------------------------------------------------- * Return Value: void *----------------------------------------------------------------------------- * Notice : * : *""FUNC COMMENT END""*********************************************************/ void P_SaveRequest(void) { int i; // Debug const char fmt[]= "\n--> bmRequestType=xx, bRequest=xx, wValue=xxxx, wIndex=xxxx, wLength=xxxx, INTSTS0=xxxx\n"; // 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 // 0 1 2 3 4 5 6 7 8 char buff[128]; // Debug USB_U16 buf, int_sts0; USB.INTSTS0.WORD = (USB_U16)~BITVALID; buf = USB.USBREQ.WORD; ReqType = (USB_U16)(buf & bmRequestType); ReqTypeType = (USB_U16)(buf & bmRequestTypeType); ReqTypeRecip = (USB_U16)(buf & bmRequestTypeRecip); ReqRequest = (USB_U16)((buf & bRequest) >> 8); ReqValue = USB.USBVAL; ReqIndex = USB.USBINDX; ReqLength = USB.USBLENG; // ***** Debug Print ***** for ( i=0; fmt[i] != 0x00; i++) buff[i] = fmt[i]; // Debug buff[i] = 0x00; // Debug int_sts0 = USB.INTSTS0.WORD; // Debug // Debug h2c( (char *)&ReqType+1, &buff[ 19], 1 ); // Debug h2c( (char *)&ReqRequest+1, &buff[ 32], 1 ); // Debug h2c( (char *)&ReqValue, &buff[ 43], 2 ); // Debug h2c( (char *)&ReqIndex, &buff[ 56], 2 ); // Debug h2c( (char *)&ReqLength, &buff[ 70], 2 ); // Debug h2c( (char *)&int_sts0, &buff[ 84], 2 ); // Debug // Console_Puts(buff); // Debug trc_put(buff); // Debug } /*===========================================================================*/ /* End of File */Copyright (C) 2009. Renesas Technology Corp., All Rights Reserved.
2011.2.9 Wrap時の不良を修正
トレースの取り方は変わりません。Console_Puts(buff)をtrc_put(buff)にしただけ
trc_put(buff)はメモリに書込むだけです(シリアルより速い。RAMが1MBあるので出来る芸当です)
Cは初心者で、structを初めて書き(使い)ました
コンパイラーエラーのオンパレードで相当落ち込みました(エラーメッセージがセンス無さすぎ)
データトレースを何処で取るかは、悩ましいです。出来れば一箇所で取りたいのですが、私は分散してしまいました。c_dataio.cには下記と類似の処理が沢山あるので、各所に入れています
c_dataio.c
/*""FUNC COMMENT""************************************************************ * ID : * Outline : D1FIFO read *----------------------------------------------------------------------------- * Include : *----------------------------------------------------------------------------- * Declaration : static void usb_read_d1_fifo(USB_U16 pipe,USB_U16 count); *----------------------------------------------------------------------------- * Description : D1FIFOからデータを読み出します。 * : 引数にて指定されたパイプに対するアクセスサイズに応じて * : BYTE/WORD/LONGにてデータを読み出します。 *----------------------------------------------------------------------------- * Argument : USB_U16 pipe ; Pipe Number * : USB_U16 count ; Data Size(Byte) *----------------------------------------------------------------------------- * Return Value: void *----------------------------------------------------------------------------- * Notice : 本関数実行前に引数にて指定されたパイプへのD1FIFOの割付が完了している * : 必要があります。 * : 本関数実行前に引数にて指定されてパイプに対するアクセスサイズが決定し、 * : USBmbw[]に設定が完了している必要があります。 *""FUNC COMMENT END""*********************************************************/ static void usb_read_d1_fifo(USB_U16 pipe,USB_U16 count) { struct TRC * trcp; // Debug const char fmt[]= "\n--> R1=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\n"; // 0123456789012345678901234567890123456789012345678901234567890123456789012345678901234567890 // 0 1 2 3 4 5 6 7 8 char buff[128], * cp; // Debug int i; // Debug register USB_U16 even; cp = (char *)USBDataPointer[pipe]; // Debug if( USBmbw[ pipe ] == BITMBW_8 ){ for( even = count; even; --even ) { *USBDataPointer[pipe] = USB.D1FIFO.BYTE; USBDataPointer[pipe] += 1; } } else if(USBmbw[ pipe ] == BITMBW_16){ for( even = (USB_U16)((count+1)/2); even; --even ) { *((USB_U16 *)USBDataPointer[pipe]) = USB.D1FIFO.WORD; USBDataPointer[pipe] += 2; } } else{ for( even = (USB_U16)((count+3)/4); even; --even ) { *((USB_U32 *)USBDataPointer[pipe]) = USB.D1FIFO.LONG; USBDataPointer[pipe] += 4; } } if (count>0) // Debug { // Debug trcp = SOT; // Debug for ( i=0; fmt[i] != 0x00; i++) buff[i] = fmt[i]; // Debug h2c( cp, &buff[ 8], count>16? 16:count ); // Debug buff[(count>16? 16:count)*2+8]='\n'; // Debug buff[(count>16? 16:count)*2+9]=0x00; // Debug trc_put(buff); // Debug } // Debug }Copyright (C) 2009. Renesas Technology Corp., All Rights Reserved.
メモリ中のメッセージ出力は、当初、別プログラムを用意しました。しかし、やはり面倒くさい
そもそも、私は何のプログラムを作っているのだろう。勿論、内部トレース用のプログラムを作っているのだけど、メインプログラムは何もやっていない。そうだ、メインで溜まったメッセージをだそう!!
p_main.c
/****************************************************************************** * DISCLAIMER * This software is supplied by Renesas Technology Corp. and is only * intended for use with Renesas products. No other uses are authorized. * This software is owned by Renesas Technology Corp. and is protected under * all applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES * REGARDING THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, * INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY * DISCLAIMED. * TO THE MAXIMUM EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS * TECHNOLOGY CORP. NOR ANY OF ITS AFFILIATED COMPANIES SHALL BE LIABLE * FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES * FOR ANY REASON RELATED TO THE THIS SOFTWARE, EVEN IF RENESAS OR ITS * AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * Renesas reserves the right, without notice, to make changes to this * software and to discontinue the availability of this software. * By using this software, you agree to the additional terms and * conditions found by accessing the following link: * http://www.renesas.com/disclaimer ******************************************************************************** * Copyright (C) 2009. Renesas Technology Corp., All Rights Reserved. * ********************************************************************************/ /*""FILE COMMENT""*********** Technical reference data ************************* * * System Name : SH7264 USB FUNCTION Sample Program * File Name : p_main.c * Abstract : Peripheral Sample Program Main * Version : 1.01.00 * Device : SH7264/SH7262 * Tool-Chain : High-performance Embedded Workshop (Ver.4.04.01). * : C/C++ compiler package for the SuperH RISC engine family * : (Ver.9.02 Release00). * OS : None * H/W Platform: M3A-HS64G50(CPU board) * * History : May.13,2009 ver.1.00.00 * : Dec.25,2009 ver.1.01.00 CDC対応 *""FILE COMMENT END""**********************************************************/ 略 #include "trace.h" 略 /* コンソール文字列出力(最新新-規追加) ******************************************/ void Serial_Puts(char *p) // Debug { // Debug unsigned char c; // Debug while( *p != 0) { // Debug c = *p++; // Debug if ( c == 0x0A ) { // Debug io_putchar( 0x0D ); // Debug io_putchar( 0x0A ); // Debug } else { // Debug io_putchar( c ); // Debug } // Debug } // Debug } // Debug 略 /*************************************/ /* メイン・ルーチン (新規作成) */ /*************************************/ void P_Main(void) { unsigned int adr, *j, jump; int i, f, l; unsigned char c, buff[256], *p; volatile int counter=0; struct TRC * trcp; trcp = SOT; /*=== LED初期化関数 ===*/ /*--- PCDR0設定 PC8のLEDを消灯 ---*/ PORT.PCDR0.BYTE.H |= 0x01u; /*--- PCIOR0設定 PC8のLEDをを出力に設定 ---*/ PORT.PCIOR0.WORD |= 0x0100u; /*--- PCCR2設定 PC8の制御設定 ---*/ PORT.PCCR2.WORD &= 0xFFF0; reset: Console_Puts("\nUSB Serial loop Test Start.\nConnect TeraTerm from USB Serial Port!!\n"); // Debug i = Console_Gets(buff); /* コンソール文字列入力 */ Console_Puts("\n"); while( !(CDC_check_complete(BULK_IN_PIPE)) ){ /* wait */ } loop: // Debug if (Console_RecvCheck()) { c = Console_Getch(); /* 1バイト取り出し */ if ( c == 0x0D ) { Console_Putch( 0x0A ); Console_Putch( 0x0D ); } Console_Putch(c); } if ( !(CDC_check_complete(BULK_IN_PIPE)) ) goto reset; if ( trcp->trcurp != trcp->trcprp ) { Serial_Puts(trcp->trcprp->trcd); trcp->trcprp++; if ( trcp->trcprp >= EOT ) trcp->trcprp = SOD; } if( ++ counter == 100000 ) { // Check Counter PORT.PCDR0.BYTE.H ^= 0x01; // LED Toggle counter = 0; } goto loop; // Debug 略 } 略 /* End of File */Copyright (C) 2009. Renesas Technology Corp., All Rights Reserved.
2011.2.9 Wrap時の不良を修正
メインプログラムは(当初はHello World!を出していましたが)ただ、無為にループしているだけです。動いているのか止まっているのか分からないので、LEDを点滅させています。
あとは、偶に内部トレースが書き込まれたときにトレース出力します
Console_PutsはシリアルとUSBの両方に出力します。データトレースを取るとトレース自身が事象となり、USB出力がループしてしまいます。トレースはシリアルのみに出力するためSerial_Putsを追加しました
実行結果はすごく地味です
ただ、割り込みの延長でシリアル直接出力していた時には分からなかった、割り込みが沢山、発生していたことが分かります
bRequest=20,21って何?? ですが・・・
Tiny Dump Monitor >ub Binaryimage download start! Download address = 1C000000h Binaryimage download start! ................................................................................. Download program size : 500Ch Jump address = 1C000500h Download program start!! @ USB Serial loop Test Start. Connect TeraTerm from USB Serial Port!! --> bmRequestType=80, bRequest=06, wValue=0100, wIndex=0000, wLength=0040, INTSTS0=6091 <-- CW=12010002020000405B04200000010000 --> bmRequestType=80, bRequest=06, wValue=0100, wIndex=0000, wLength=0012, INTSTS0=60A1 <-- CW=12010002020000405B04200000010000 --> bmRequestType=80, bRequest=06, wValue=0200, wIndex=0000, wLength=00FF, INTSTS0=60A1 <-- CW=09024300020100C01009040000010202 <-- CW=000200 --> bmRequestType=80, bRequest=06, wValue=0303, wIndex=0409, wLength=00FF, INTSTS0=60A1 <-- CW=1A033000300030003000300030003000 --> bmRequestType=80, bRequest=06, wValue=0100, wIndex=0000, wLength=0012, INTSTS0=60A1 <-- CW=12010002020000405B04200000010000 --> bmRequestType=80, bRequest=06, wValue=0200, wIndex=0000, wLength=0109, INTSTS0=60A1 <-- CW=09024300020100C01009040000010202 <-- CW=000200 --> bmRequestType=00, bRequest=09, wValue=0001, wIndex=0000, wLength=0000, INTSTS0=60A5 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=00C20100000008 --> bmRequestType=21, bRequest=22, wValue=0000, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0001, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=20, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B3 --> CR=B0040000000008 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=B0040000000008 --> bmRequestType=21, bRequest=20, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B3 --> CR=B0040000000007 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=B0040000000007 --> bmRequestType=21, bRequest=22, wValue=0000, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0001, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0002, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0001, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0003, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=20, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B3 --> CR=B0040000000007 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=B0040000000007 --> bmRequestType=21, bRequest=20, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B3 --> CR=B0040000000007 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=B0040000000007 --> bmRequestType=21, bRequest=22, wValue=0000, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0001, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0002, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0001, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0003, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=20, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B3 --> CR=B0040000000007 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=B0040000000007 --> bmRequestType=21, bRequest=20, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B3 --> CR=B0040000000007 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=B0040000000007 --> bmRequestType=21, bRequest=22, wValue=0000, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0001, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0002, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0001, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=22, wValue=0002, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=B0040000000007 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=B0040000000007 --> bmRequestType=21, bRequest=20, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B3 --> CR=00C20100000007 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=00C20100000007 --> bmRequestType=21, bRequest=22, wValue=0003, wIndex=0000, wLength=0000, INTSTS0=60B5 --> bmRequestType=21, bRequest=20, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B3 --> CR=00C20100000008 --> bmRequestType=A1, bRequest=21, wValue=0000, wIndex=0000, wLength=0007, INTSTS0=60B1 <-- CW=00C20100000008 <-- W1=0D <-- W1=0A <-- W1=0A <-- W1=0D <-- W1=0D a --> R0=61 <-- W1=61 b --> R0=62 <-- W1=62 c --> R0=63 <-- W1=63 --> R0=64 d <-- W1=64 e --> R0=65 <-- W1=65 f --> R0=66 <-- W1=66 g --> R0=67 <-- W1=67 --> R0=68 h <-- W1=68 i --> R0=69 <-- W1=69 --> R0=6A j <-- W1=6A k --> R0=6B <-- W1=6B --> R0=6C l <-- W1=6C m --> R0=6D <-- W1=6D n --> R0=6E <-- W1=6E o --> R0=6F <-- W1=6F --> R0=70 p <-- W1=70 q --> R0=71 <-- W1=71 r --> R0=72 <-- W1=72 --> R0=73 s <-- W1=73 --> R0=74 t <-- W1=74 u --> R0=75 <-- W1=75 --> R0=76 v <-- W1=76 w --> R0=77 <-- W1=77 x --> R0=78 <-- W1=78 --> R0=79 y <-- W1=79 z --> R0=7A <-- W1=7A --> R0=20 <-- W1=20 0 --> R0=30 <-- W1=30 1 --> R0=31 <-- W1=31 2 --> R0=32 <-- W1=32 --> R0=33 3 <-- W1=33 4 --> R0=34 <-- W1=34 5 --> R0=35 <-- W1=35 6 --> R0=36 <-- W1=36 7 --> R0=37 <-- W1=37 8 --> R0=38 <-- W1=38 --> R0=39 9 <-- W1=39 --> R0=0D <-- W1=0A <-- W1=0D <-- W1=0D A --> R0=41 <-- W1=41 B --> R0=42 <-- W1=42 C --> R0=43 <-- W1=43 --> R0=82A0 <-- 81=82 <-- W1=A0 --> 30=82A2 「 <-- W1=82 <-- W1=A2 --> 30=82A4 、 <-- W1=82 <-- W1=A4
![](https://image02.seesaawiki.jp/h/8/h8h8h8/769421dc646734c5.jpg)
右のteraterm(COMポート4)はシリアル接続、左のteraterm(COMポート7)はUSB経由のシリアル接続です。左のteratermで入力した文字が右のteratermにもトレースと共に出力されます
ただ、それだけです(全角文字を入れると表示が変になりました)
データトレースでDevice Descriptorなどが取れているみたいですが、ちゃんと確認出来てません
今更ですが、USBを学習するならH8から初めた方が遥かに分かりやすいです。トラ技のサンプルには丁寧なコメントも付いています
SH-2Aはハードもドライバも難しすぎます
コメントをかく