TOP ARM NXP Transister Gijyutsu
(^^; failed:
First WriteToRam command won't succeed. Baud rate change didn't help.
4bytes are missing.
Here's a memo using -debug5 and grep Send|Answer
clock | 30MHz | |
IO | スイッチ・マトリックスによるピン/ペリフェラルの高い自由度 | どのピンにどのペリフェラルを割り当てるかはツールで設定可 |
API | ROM内のUART/I2C API | UART API:非同期モードで文字や文字列の送信/受信 など I2C API :マスター/スレーブの送受信, ポーリング/割り込み など |
Flash | 16KB max | 64バイト(1ページ)単位の書き込み/消去可能 |
RAM | 4KB max | |
ペリフェラル | USART x 3 max | 非同期送受信:1.875Mbit/s max 同期送受信 :30Mbit/s max |
SPI x 2 max | マスター/スレーブ・モード共:30Mbit/s max | |
I2C (Fm+) | ||
CRCエンジン | ||
SCT (ステート・コンフィギュアブル・タイマ) | SCTはステート・マシンとタイマーを組み合わせた自由度の高い入出力が可能。 タイマ:32-bit or 16-bit x 2, 入力:4, 出力:4, マッチ/キャプチャー:4, イベント:6, ステート:2 | |
タイマ x 6 (Max 8) | マルチレート・タイマ:24-bitタイマ x 4ch セルフ・ウェイクアップ・タイマ:32-bit(VDDがONであればこのタイマもON、ディープ・パワーダウン・モードからもWake-up可) systickタイマ, SCT内にタイマ x 2 max | |
独立した電源ドメイン:PMUとセルフ・ウェイクアップ・タイマ | この2つはVDDがONであればこのブロックの電源もON PMUにはディープ・パワーダウン・モードでもデータ保持するレジスタ16バイト | |
ウオッチドッグ | ||
GPIO:18 max | Cortex-M0+コアのI/Oポートに繋がった高速GPIO ピン割り込み:8つまでのピンを外部割り込みピンとして選択でき、それぞれのピンでエッジorレベルの割り込み発生可 パターン・マッチ・エンジン:外部割り込みに設定されたピンをモニタし、設定したブール代数演算(ピン毎にエッジ/レベル選択可)とマッチした時、割り込み/ピンから出力が可 プログラマブル・グリッチ・フィルタ | |
コンパレータ | ||
デバッグ向けのMTB:マイクロ・トレース・バッファをサポート |
Part# | Freq(MHz) | Flash(KB) | RAM(KB) | USART RS-485 | I2C FM+ | SPI/SSP | SCT | コンパレータ | I/O | Package |
LPC810 | 30 | 4 | 1 | 2 +Driver | 1 +Driver | 1 | 1 | 1 | 6 | DIP8 |
- goto GCC ARM Embedded Maintainers team
- select recent update, such like gcc-arm-none-eabi-4_8-2014q1-20140314-win32.exe and install. /use/local/arm
- create shell to set the environment ~/bin/LPC810_env.sh
- $ chmod 755 ~/bin/LPC810_env.sh
- add alias in bashrc $ alias LPC810_env='source ~/bin/LPC810_env.sh'
- run script.
- test gcc $ arm-none-eabi-gcc --version
- for Cortex-M0+, use gcc option -mthumb -mcpu=cortex-m0plus
- get ZIP file from microbuilder/LPC810_CodeBase
- $ cd src
- $ make
- LPC810 をISPモードで起動したのち書き込み
- $ lpc21isp -term blinky.hex com7 115200 12000
- LPC210 リセット
- ESCでlpc21isp終了
$ lpc21isp -term blinky.hex com7 115200 12000 lpc21isp version 1.97 File blinky.hex: loaded... converted to binary format... image size : 1648 Image size : 1648 Synchronizing (ESC to abort). OK Read bootcode version: 4 13 Read part ID: LPC810M021FN8, 4 kiB FLASH / 1 kiB SRAM (0x00008100) Will start programming at Sector 1 if possible, and conclude with Sector 0 to ensure that checksum is written last. Erasing sector 0 first, to invalidate checksum. OK Sector 1: ...
(^^; failed:
First WriteToRam command won't succeed. Baud rate change didn't help.
4bytes are missing.
Here's a memo using -debug5 and grep Send|Answer
$ cat log.txt | grep "Send\|Answer" Synchronizing (ESC to abort).Sending '?' Answer(Length=14): 'Synchronized(0D)(0A)' StrippedAnswer(Length=14): 'Synchronized(0D)(0A)' Sending 'Synchronized(0D)(0A)' Answer(Length=18): 'Synchronized(0D)(0A)OK(0D)(0A)' Sending '12000(0D)(0A)' Answer(Length=11): '12000(0D)(0A)OK(0D)(0A)' Sending 'U 23130(0D)(0A)' Answer(Length=12): 'U 23130(0D)(0A)0(0D)(0A)' Read bootcode version: Sending 'K(0D)(0A)' Answer(Length=13): 'K(0D)(0A)0(0D)(0A)4(0D)(0A)13(0D)(0A)' Read part ID: Sending 'J(0D)(0A)' Answer(Length=13): 'J(0D)(0A)0(0D)(0A)33024(0D)(0A)' Erasing sector 0 first, to invalidate checksum. Sending 'P 0 0(0D)(0A)' Answer(Length=10): 'P 0 0(0D)(0A)0(0D)(0A)' Sending 'E 0 0(0D)(0A)' Answer(Length=10): 'E 0 0(0D)(0A)0(0D)(0A)' Sector 1: Sending 'P 1 1(0D)(0A)' Answer(Length=10): 'P 1 1(0D)(0A)0(0D)(0A)' .Sending 'E 1 1(0D)(0A)' Answer(Length=10): 'E 1 1(0D)(0A)0(0D)(0A)' .Sending 'W 268436080 256(0D)(0A)' Answer(Length=20): 'W 268436080 256(0D)(0A)0(0D)(0A)' .Sending '-#+p(00)$8(1C))(1C)(0C)(9A)(0D)(9B)(FF)(F7)n(FF) (18)(07)(B0)(F0)(BD)(F0)(B5)(89)(B0)(06)(1C)(0D)(1C)(05)(92)(00)$+x(00)+(05)(D0)%+s(D1)ixj(1C)(00))(05)(D1)(00).t(D0)3h(00)"(1A)pp(E0)%)f(D0)(00)#-)(01)(D1)(AA)(1C)(01)#(15)(1C)*x0*(03)(D1)(02)"(01)5(13)C(F8)(E7)(00)")x(08)(1C)08(C7)(B2)(09)/(04)(D8)(0A)!JC(01)5(12)(18)(F4)(E7)s)(07)(D1)(05)(99)(08)(1D)(09)h(05)(90)(00))A(D1)(I?(E0)d)(0E)(D1)(05)(99)(08)(1D)(09)h(01)(93)a#(05)(90)(00)(92)(02)(93)0(1C)(0A)"(01)#(FF)(F7)b(FF)$(18)8(E0)x)(07)(D1)(05)(99)(08)(1D)(05)(90)(09)h(01)(93)(00)(92)a#(08)(E0)X)(0A)(D1)(05)(99)(08)(1D)(05)(90)(09)h(01)(93)(00)(92)A#(02)(93)0(1C)(10)"(0B)(E0)u)(0B)(D1)(05)(99)(08)(1D)(09)h(01)(93)a#(05)(90)(00)(92)(02)(93)0(1C)(0A)"(00)#(D6)(E7)c)(11)(D1)(05)(98)(01)(1D)' Answer(Length=252): '-#+p(00)$8(1C))(1C)(0C)(9A)(0D)(9B)(FF)(F7)n(FF) (18)(07)(B0)(F0)(BD)(F0)(B5)(89)(B0)(06)(1C)(0D)(1C)(05)(92)(00)$+x(00)+(05)(D0)%+s(D1)ixj(1C)(00))(05)(D1)(00).t(D0)3h(00)"(1A)pp(E0)%)f(D0)(00)#-)(D1)(AA)(1C)(01)#(15)(1C)*x0*(03)(D1)(02)"(01)5(13)C(F8)(E7)(00)")x(08)(1C)08(C7)(B2)(09)/(04)(D8)(0A)!JC(01)5(12)(18)(F4)(E7)s)(07)(D1)(05)(99)(08)(1D)(09)h(05)(90)(00))A(D1)(I(E0)d)(0E)(D1)(05)(99)(08)(1D)(09)h(01)(93)a#(05)(90)(00)(92)(02)(93)0(1C)(0A)"(01)#(FF)(F7)b(FF)$(18)8(E0)x)(07)(D1)(05)(99)(08)(1D)(05)(90)(09)h(01)(93)(00)(92)a#(08)(E0)X)(0A)(D1)(05)(99)(08)(1D)(09)h(01)(93)(00)(92)A#(02)(93)0(1C)(10)"(0B)(E0)u)(0B)(D1)(05)(99)(08)(1D)(09)h(01)(93)a#(05)(90)(00)(92)(02)(93)0(1C)(0A)"(00)#(D6)(E7)c)(11)(D1)(05)(98)(01)(1D)'Flash Magic works fine with the same hex file and the hardware.
#!/bin/bash # LPC810_env.sh export GNUARM_DIR=/usr/local/arm export PATH=$PATH:$GNUARM_DIR/bin
- ボーレイトは自動判別
- 設定-シリアルポート 9600N81 フロー制御なし
- 設定-端末で 改行:<CR><LF>
- USB接続 COM7で認識
- teraterm起動 改行等の設定を行う
- LPC810にRESET(1pin)とISP(5pin)のボタンを押下する
- RESETをはなす
- ISPをはなし、ISPモードに入る
- PCから?を送る (自動速度調整する)
- Synchronizedが返る
- Synchronizedを送る
- OKが返る
- フラッシュの消去/ 書き込み操作を行うコマンドおよび「Go」コマンドを実行する前に、「Unlock」コマンドが必要
- 「Unlock」コマンドは、ISP セッションごとに一度実行が必要
ISP Command | Usage | |
Unlock | U <Unlock Code> | U 23130 |
Set Baud Rate | B <Baud Rate> <stop bit> | B 57600 1 |
Echo | A <setting> | ON = 1 , OFF = 0 |
Write to RAM | W <start address> <number of bytes> | CMD_SUCCESS リターンコードを受信した後データを送信 |
Read Memory | R <address> <number of bytes> | |
アドレス0x1000 0000から512バイト読み出す(UU-encode) | R 268435456 512 | |
Prepare sector(s) for write operation | P <start sector number> <end sector number> | |
Copy RAM to flash | C <Flash address> <RAM address> <number of bytes> | |
Go | G <address> <Mode> | G 0 A //ARM モードでアドレス0x0000 0000 に分岐 |
Erase sector(s) | E <start sector number> <end sector number> | |
Blank check sector(s) | I <start sector number> <end sector number> | I 2 3 //フラッシュセクタ2から3 をブランクチェック |
Read PartID | J | |
Read Boot code version | K | |
Compare | M <address1> <address2> <number of bytes> | |
ReadUID | N |
Return Code | Mnemonic | Description |
0 | CMD_SUCCESS | コマンドの実行に成功しました。ホストから発行されるコマンドが完全かつ正常に実行された場合にのみ、ISP ハンドラから送信されます。 |
1 | INVALID_COMMAND | 無効なコマンド。 |
2 | SRC_ADDR_ERROR | ソースアドレスがワード境界にありません。 |
3 | DST_ADDR_ERROR | デスティネーションアドレスが正しい境界にありません。 |
4 | SRC_ADDR_NOT_MAPPED | ソースアドレスが、メモリマップにマッピングされていません。適宜、カウントの値が考慮されます。 |
5 | DST_ADDR_NOT_MAPPED | デスティネーションアドレスが、メモリマップにマッピングされていません。適宜、カウントの値が考慮されます。 |
6 | COUNT_ERROR | バイトカウントが4 の倍数ではない、または許可される値ではありません。 |
7 | INVALID_SECTOR | セクタ番号が無効であるか、終了セクタ番号が開始セクタ番号を上回っています。 |
8 | SECTOR_NOT_BLANK | セクタがブランクではありません。 |
9 | SECTOR_NOT_PREPARED_FOR_WRITE_OPERATION | セクタの書き込み操作を準備するコマンドが、実行されていません。 |
10 | COMPARE_ERROR | ソースとデスティネーションのデータが一致しません。 |
11 | BUSY | フラッシュプログラミングハードウェアインターフェースがビジー状態です。 |
12 | PARAM_ERROR | パラメータの個数が不適切です。またはパラメータが無効です。 |
13 | ADDR_ERROR | アドレスがワード境界にありません。 |
14 | ADDR_NOT_MAPPED | アドレスがメモリマップでマッピングされていません。適宜、カウントの値が考慮されます。 |
15 | CMD_LOCKED | コマンドがロックされています。 |
16 | INVALID_CODE | アンロックコードが無効です。 |
17 | INVALID_BAUD_RATE | ボーレート設定が無効です。 |
18 | INVALID_STOP_BIT | ストップビット設定が無効です。 |
19 | CODE_READ_PROTECTION_ENABLED | CRP がイネーブルです。 |
$ unzip lpc21isp_197.zip $ cd lpc21isp_197/ $ ls adprog.c lgpl-3.0.txt lpc21isp.h lpcprog.dsw lpcterm.h README adprog.h lpc21isp.c lpcprog.c lpcprog.h Makefile StdAfx.h gpl.txt lpc21isp.cbp lpcprog.dsp lpcterm.c Makefile.vc $ make -f Makefile clean all rm -f adprog.o lpcprog.o lpcterm.o lpc21isp gcc -Wall -static -c -o adprog.o adprog.c gcc -Wall -static -c -o lpcprog.o lpcprog.c gcc -Wall -static -c -o lpcterm.o lpcterm.c gcc -Wall -static -o lpc21isp lpc21isp.c adprog.o lpcprog.o lpcterm.o lpc21isp.c: 関数 ‘ReadArguments’ 内: lpc21isp.c:1399:17: 警告: 配列の添字が ‘char’ 型です [-Wchar-subscripts] while(*num && isdigit(*num) == 0) num++; ^ lpc21isp.c:1400:17: 警告: 配列の添字が ‘char’ 型です [-Wchar-subscripts] if(isdigit(*num) != 0) debug_level = atoi( num); ^ $ ./lpc21isp.exe Portable command line ISP for NXP LPC family and Analog Devices ADUC 70xx Version 1.97 compiled for Cygwin: Jun 29 2014, 17:28:28 Copyright (c) by Martin Maurer, 2003-2013, Email: Martin.Maurer@clibb.de Portions Copyright (c) by Aeolus Development 2004, www.aeolusdevelopment.com Syntax: lpc21isp [Options] file[ file[ ...]] comport baudrate Oscillator_in_kHz Example: lpc21isp test.hex com1 115200 14746 Options: -bin for uploading binary file -hex for uploading file in intel hex format (default) -term for starting terminal after upload -termonly for starting terminal without an upload -localecho for local echo in terminal -detectonly detect only used LPC chiptype (NXPARM only) -debug0 for no debug -debug3 for progress info only -debug5 for full debug -donotstart do not start MCU after download -try<n> try n times to synchronise -wipe Erase entire device before upload -control for controlling RS232 lines for easier booting (Reset = DTR, EnableBootLoader = RTS) -boothold hold EnableBootLoader asserted throughout sequence -controlswap swap RS232 control lines (Reset = RTS, EnableBootLoader = DTR) -controlinv Invert state of RTS & DTR (0=true/assert/set, 1=false/deassert/clear). -verify Verify the data in Flash after every writes to sector. To detect errors in writing to Flash ROM -logfile for enabling logging of terminal output to lpc21isp.log -halfduplex use halfduplex serial communication (i.e. with K-Line) -writedelay Add delay after serial port writes (for compatibility) -ADARM for downloading to an Analog Devices ARM microcontroller ADUC70xx -NXPARM for downloading to a chip of NXP LPC family (default)
[[
LPC810(1) 〜 LPC810とは>http://mits-whisper.info/tagged/LPC810/chrono]]
LPC810(1) 〜 LPC810とは>http://mits-whisper.info/tagged/LPC810/chrono]]
最新コメント