TOP ARM NXP Transister Gijyutsu



feature

clock30MHz
IOスイッチ・マトリックスによるピン/ペリフェラルの高い自由度どのピンにどのペリフェラルを割り当てるかはツールで設定可
APIROM内のUART/I2C APIUART API:非同期モードで文字や文字列の送信/受信 など
I2C API :マスター/スレーブの送受信, ポーリング/割り込み など
Flash16KB max64バイト(1ページ)単位の書き込み/消去可能
RAM4KB 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 maxCortex-M0+コアのI/Oポートに繋がった高速GPIO
ピン割り込み:8つまでのピンを外部割り込みピンとして選択でき、それぞれのピンでエッジorレベルの割り込み発生可
パターン・マッチ・エンジン:外部割り込みに設定されたピンをモニタし、設定したブール代数演算(ピン毎にエッジ/レベル選択可)とマッチした時、割り込み/ピンから出力が可
プログラマブル・グリッチ・フィルタ
コンパレータ
デバッグ向けのMTB:マイクロ・トレース・バッファをサポート

LPC810

Part#Freq(MHz)Flash(KB)RAM(KB)USART
RS-485
I2C
FM+
SPI/SSPSCTコンパレータI/OPackage
LPC81030412
+Driver
1
+Driver
1116DIP8

datasheet

NXP

online manual

man

env

cygwin

  1. goto GCC ARM Embedded Maintainers team
  2. select recent update, such like gcc-arm-none-eabi-4_8-2014q1-20140314-win32.exe and install. /use/local/arm
  3. create shell to set the environment ~/bin/LPC810_env.sh
  4. $ chmod 755 ~/bin/LPC810_env.sh
  5. add alias in bashrc $ alias LPC810_env='source ~/bin/LPC810_env.sh'
  6. run script.
  7. test gcc $ arm-none-eabi-gcc --version
  8. for Cortex-M0+, use gcc option -mthumb -mcpu=cortex-m0plus

Blinky

cygwin

  1. get ZIP file from microbuilder/LPC810_CodeBase
  2. $ cd src
  3. $ make
  4. LPC810 をISPモードで起動したのち書き込み
  5. $ lpc21isp -term blinky.hex com7 115200 12000
  6. LPC210 リセット
  7. 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.

LPC810_env.sh

#!/bin/bash
# LPC810_env.sh
export GNUARM_DIR=/usr/local/arm
export PATH=$PATH:$GNUARM_DIR/bin

ISP

teraterm

  • ボーレイトは自動判別
  • 設定-シリアルポート 9600N81 フロー制御なし
  • 設定-端末で 改行:<CR><LF>
  1. USB接続 COM7で認識
  2. teraterm起動 改行等の設定を行う
  3. LPC810にRESET(1pin)とISP(5pin)のボタンを押下する
  4. RESETをはなす
  5. ISPをはなし、ISPモードに入る
  6. PCから?を送る (自動速度調整する)
  7. Synchronizedが返る
  8. Synchronizedを送る
  9. OKが返る
ISPコマンド
  • フラッシュの消去/ 書き込み操作を行うコマンドおよび「Go」コマンドを実行する前に、「Unlock」コマンドが必要
  • 「Unlock」コマンドは、ISP セッションごとに一度実行が必要
ISP CommandUsage
UnlockU <Unlock Code>U 23130
Set Baud RateB <Baud Rate> <stop bit>B 57600 1
EchoA <setting>ON = 1 , OFF = 0
Write to RAMW <start address> <number of bytes>CMD_SUCCESS リターンコードを受信した後データを送信
Read MemoryR <address> <number of bytes>
アドレス0x1000 0000から512バイト読み出す(UU-encode)R 268435456 512
Prepare sector(s) for write operationP <start sector number> <end sector number>
Copy RAM to flashC <Flash address> <RAM address> <number of bytes>
GoG <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 PartIDJ
Read Boot code versionK
CompareM <address1> <address2> <number of bytes>
ReadUIDN
UART ISP Return Codes Summary
Return CodeMnemonicDescription
0CMD_SUCCESSコマンドの実行に成功しました。ホストから発行されるコマンドが完全かつ正常に実行された場合にのみ、ISP ハンドラから送信されます。
1INVALID_COMMAND無効なコマンド。
2SRC_ADDR_ERRORソースアドレスがワード境界にありません。
3DST_ADDR_ERRORデスティネーションアドレスが正しい境界にありません。
4SRC_ADDR_NOT_MAPPEDソースアドレスが、メモリマップにマッピングされていません。適宜、カウントの値が考慮されます。
5DST_ADDR_NOT_MAPPEDデスティネーションアドレスが、メモリマップにマッピングされていません。適宜、カウントの値が考慮されます。
6COUNT_ERRORバイトカウントが4 の倍数ではない、または許可される値ではありません。
7INVALID_SECTORセクタ番号が無効であるか、終了セクタ番号が開始セクタ番号を上回っています。
8SECTOR_NOT_BLANKセクタがブランクではありません。
9SECTOR_NOT_PREPARED_FOR_WRITE_OPERATIONセクタの書き込み操作を準備するコマンドが、実行されていません。
10COMPARE_ERRORソースとデスティネーションのデータが一致しません。
11BUSYフラッシュプログラミングハードウェアインターフェースがビジー状態です。
12PARAM_ERRORパラメータの個数が不適切です。またはパラメータが無効です。
13ADDR_ERRORアドレスがワード境界にありません。
14ADDR_NOT_MAPPEDアドレスがメモリマップでマッピングされていません。適宜、カウントの値が考慮されます。
15CMD_LOCKEDコマンドがロックされています。
16INVALID_CODEアンロックコードが無効です。
17INVALID_BAUD_RATEボーレート設定が無効です。
18INVALID_STOP_BITストップビット設定が無効です。
19CODE_READ_PROTECTION_ENABLEDCRP がイネーブルです。

Flash Magic

lpc21isp

compile on cygwin

$ 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)



ref

[[
LPC810(1) 〜 LPC810とは>http://mits-whisper.info/tagged/LPC810/chrono]]

管理人/副管理人のみ編集できます