RL78マイコン基板(RL78/G13)|Internet Explorerからrl78flashを起動してフラッシュ書き込みする
前のエントリでInternet ExplorerからCOMポートをリード/ライトする方法を試した時、Internet Explorerから
Windowsのmodeコマンドを起動するなどということをやっていたのですが、それが出来たのですから、恐らく
rl78flash(オープンソースソフトウェアのRL78内蔵フラッシュメモリ書き換えツール)を起動することも出来る筈
だと思い、やってみました。(なお、以前のエントリに書いた通りrl78flashにはソフトウェア上の何かしらがある
ような気がしています(というか今は目星が付いています)が、その回避の為にmodeコマンドを実行しています。)
スクリプト: Script3.html
内容:
<script type="text/javascript">
var WshShell = new ActiveXObject('WScript.Shell');
document.open();
document.write('rl78flash -m 2 -b 1000000 -iewv COM14 cotton_sketch.mot' + '<br>');
document.close();
var oExec = WshShell.Exec('cmd /c cd /d "E:\\tools\\micom\\Renesas\\Programming Tools\\JScript" > nul & mode COM14 dtr=off > nul & rl78flash -m 2 -b 1000000 -iewv COM14 cotton_sketch.mot 2>&1');
document.open();
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.close();
while (oExec.Status == 0) {}
document.open();
document.write('Completed!' + '<br>');
document.close();
</script>
実行方法と実行結果は以下の通りです。
start "" /wait "c:\Program Files\Internet Explorer\iexplore.exe" -nohangrecovery -noframemerging -nosessionmerging "E:\tools\micom\Renesas\Programming Tools\JScript\Script3.html"




ただ、今回は前のエントリのRunメソッドでは無く、rl78flashのメッセージ出力を取得する為にExecメソッドを
使いましたが、以下のようにコマンドプロンプトが表示されてしまうのが、ちょっと残念なところではあります。

追記 : 補足
なお、modeコマンドを実行しなかった場合には、以下のようにエラーになることがあります。
スクリプト: Script3b.html
内容: 赤字の箇所を削除
<script type="text/javascript">
var WshShell = new ActiveXObject('WScript.Shell');
document.open();
document.write('rl78flash -m 2 -b 1000000 -iewv COM14 cotton_sketch.mot' + '<br>');
document.close();
var oExec = WshShell.Exec('cmd /c cd /d "E:\\tools\\micom\\Renesas\\Programming Tools\\JScript" > nul & mode COM14 dtr=off > nul & rl78flash -m 2 -b 1000000 -iewv COM14 cotton_sketch.mot 2>&1');
document.open();
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.close();
while (oExec.Status == 0) {}
document.open();
document.write('Completed!' + '<br>');
document.close();
</script>

追記 : メモ
Exec メソッド - MSDN
https://msdn.microsoft.com/ja-jp/library/cc364356.aspx
Status プロパティ (WshScriptExec) - MSDN
https://msdn.microsoft.com/ja-jp/library/cc364410.aspx
StdOut プロパティ (WshScriptExec) - MSDN
https://msdn.microsoft.com/ja-jp/library/cc364386.aspx
StdErr プロパティ (WshScriptExec) - MSDN
https://msdn.microsoft.com/ja-jp/library/cc364384.aspx
StdIn プロパティ (WshScriptExec) - MSDN
https://msdn.microsoft.com/ja-jp/library/cc364385.aspx
追記 : メモ
Arduino CreateではブラウザからArduinoへのスケッチの転送にはプラグイン(?)を使います、との記事を読んで、
(Internet Explorer限定で)それの真似事(?)をしようとしていたらしい、 ということに気付きました、、、
Arduino Createが正式リリースされました - スイッチサイエンス社ブログ
http://mag.switch-science.com/2016/08/16/arduino-create/
The Arduino Create Multi Platform Agent - GitHub
https://github.com/arduino/arduino-create-agent/
(これはプラグインとは呼ばないと思う、、、)
(追記 : HTML5でもなければJavaScriptでもなくて、Go言語で記述されたタスクトレイ常駐型アプリケーション?)
(追記 : Arduinoボードへの書き込みは内部で既存のavrdudeを起動して行っているらしい。)
追記 : 雑感
Arduino Create Multi Platform Agentを改造して、特定のフォルダのMOTファイルが更新されたらrl78flashを
自動的に起動して書き込むようにすれば、ルネサスWebコンパイラでも使えるような気が、、、
KurumiWriterに同様なMOTファイル監視機能を追加して、更に、タスクトレイに入れられるようにする手もあり?
追記 : 雑感その2
ブラウザの中で動作しているかどうかは重要ではなくて、ブラウザの中で操作しているという感覚が重要なのかな?
(スイッチサイエンス社のライターさんは、そこで錯覚したのかな?)
Windowsのmodeコマンドを起動するなどということをやっていたのですが、それが出来たのですから、恐らく
rl78flash(オープンソースソフトウェアのRL78内蔵フラッシュメモリ書き換えツール)を起動することも出来る筈
だと思い、やってみました。(なお、以前のエントリに書いた通りrl78flashにはソフトウェア上の何かしらがある
ような気がしています(というか今は目星が付いています)が、その回避の為にmodeコマンドを実行しています。)
スクリプト: Script3.html
内容:
<script type="text/javascript">
var WshShell = new ActiveXObject('WScript.Shell');
document.open();
document.write('rl78flash -m 2 -b 1000000 -iewv COM14 cotton_sketch.mot' + '<br>');
document.close();
var oExec = WshShell.Exec('cmd /c cd /d "E:\\tools\\micom\\Renesas\\Programming Tools\\JScript" > nul & mode COM14 dtr=off > nul & rl78flash -m 2 -b 1000000 -iewv COM14 cotton_sketch.mot 2>&1');
document.open();
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.close();
while (oExec.Status == 0) {}
document.open();
document.write('Completed!' + '<br>');
document.close();
</script>
実行方法と実行結果は以下の通りです。
start "" /wait "c:\Program Files\Internet Explorer\iexplore.exe" -nohangrecovery -noframemerging -nosessionmerging "E:\tools\micom\Renesas\Programming Tools\JScript\Script3.html"




ただ、今回は前のエントリのRunメソッドでは無く、rl78flashのメッセージ出力を取得する為にExecメソッドを
使いましたが、以下のようにコマンドプロンプトが表示されてしまうのが、ちょっと残念なところではあります。

追記 : 補足
なお、modeコマンドを実行しなかった場合には、以下のようにエラーになることがあります。
スクリプト: Script3b.html
内容: 赤字の箇所を削除
<script type="text/javascript">
var WshShell = new ActiveXObject('WScript.Shell');
document.open();
document.write('rl78flash -m 2 -b 1000000 -iewv COM14 cotton_sketch.mot' + '<br>');
document.close();
var oExec = WshShell.Exec('cmd /c cd /d "E:\\tools\\micom\\Renesas\\Programming Tools\\JScript" > nul &
document.open();
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.write(oExec.StdOut.ReadLine() + '<br>');
document.close();
while (oExec.Status == 0) {}
document.open();
document.write('Completed!' + '<br>');
document.close();
</script>

追記 : メモ
Exec メソッド - MSDN
https://msdn.microsoft.com/ja-jp/library/cc364356.aspx
Status プロパティ (WshScriptExec) - MSDN
https://msdn.microsoft.com/ja-jp/library/cc364410.aspx
StdOut プロパティ (WshScriptExec) - MSDN
https://msdn.microsoft.com/ja-jp/library/cc364386.aspx
StdErr プロパティ (WshScriptExec) - MSDN
https://msdn.microsoft.com/ja-jp/library/cc364384.aspx
StdIn プロパティ (WshScriptExec) - MSDN
https://msdn.microsoft.com/ja-jp/library/cc364385.aspx
追記 : メモ
Arduino CreateではブラウザからArduinoへのスケッチの転送にはプラグイン(?)を使います、との記事を読んで、
(Internet Explorer限定で)それの真似事(?)をしようとしていたらしい、 ということに気付きました、、、
Arduino Createが正式リリースされました - スイッチサイエンス社ブログ
http://mag.switch-science.com/2016/08/16/arduino-create/
The Arduino Create Multi Platform Agent - GitHub
https://github.com/arduino/arduino-create-agent/
(これはプラグインとは呼ばないと思う、、、)
(追記 : HTML5でもなければJavaScriptでもなくて、Go言語で記述されたタスクトレイ常駐型アプリケーション?)
(追記 : Arduinoボードへの書き込みは内部で既存のavrdudeを起動して行っているらしい。)
追記 : 雑感
Arduino Create Multi Platform Agentを改造して、特定のフォルダのMOTファイルが更新されたらrl78flashを
自動的に起動して書き込むようにすれば、ルネサスWebコンパイラでも使えるような気が、、、
KurumiWriterに同様なMOTファイル監視機能を追加して、更に、タスクトレイに入れられるようにする手もあり?
追記 : 雑感その2
ブラウザの中で動作しているかどうかは重要ではなくて、ブラウザの中で操作しているという感覚が重要なのかな?
(スイッチサイエンス社のライターさんは、そこで錯覚したのかな?)
- 関連記事
-
- RL78マイコン基板(RL78/G13)|Internet Explorerからrl78flashを起動して通信(シリアルモニタ)する
- RL78マイコン基板(RL78/G13)|Internet Explorerからrl78flashを起動してフラッシュ書き込みする
- RL78マイコン基板(RL78/G13)|Internet ExplorerからOCXを使わずにCOMポートを読み書きする
- RL78マイコン基板(RL78/G13)|KurumiWriter(改)で書き込んで自作utf8to932コマンドで日本語表示
- RL78マイコン基板(RL78/G13)|KurumiWriter(改)で書き込んでmoreコマンドでシリアル通信する設定
- RL78マイコン基板(RL78/G13)|KurumiWriter V1.00(ソース公開版)のフラッシュ書き込み時間の改善
- RL78マイコン基板(RL78/G13)|KurumiWriter V2.10とrl78flashの書き込み時間の比較 (CP2102編)
- RL78マイコン基板(RL78/G13)|CP2102+rl78flashで秋月のRL78搭載変換モジュールに書き込み
- RL78マイコン基板(RL78/G13)|CP2102+KurumiWriterで秋月のRL78搭載変換モジュールに書き込み
- RL78マイコン基板(RL78/G13)|rl78flashで書き込んでPython+pySerialでシリアル通信する設定
- RL78マイコン基板(RL78/G13)|TeraTermでログにタイムスタンプを付けて自動保存してくれる機能
- RL78マイコン基板(RL78/G13)|WebコンパイラのSerial.printに日本語出力させてTeraTermで表示
- RL78マイコン|日立/RSDの人のCC-RLの論文が情報処理学会の優秀論文(全54編)の1つに選ばれていた
- RL78マイコン基板(RL78/G13)|rl78flashで書き込んでTeraTermでシリアル通信する設定
- RL78マイコン基板(RL78/G13)|KurumiWriter V1.00(ソース公開版)とrl78flashの書き込み時間の比較
2016/10/03 blog-entry-824 category: RL78 /* 16bit,8bit CISC */
| h o m e |