OpenOCD小ネタ4 -LPC810に書き込みできないの-
>8PinDIPのARMマイコンLPC810、ようやく一般市場に出回る!
あのさぁ…私がLPC812を最初に手に入れてからもう約1年たったんですよぅ約1年!
それを今更…
こんなのこうしてやる!
STM32F0Discoveryが放つprobeに捕えられDiscloseされる哀れな
LPC810の姿。
ぐへへ32bitマイコンのくせにこんなにいやらしく足広げ(間隔:2.54mm)やがって♥
はぁ…はぁ…でもあんまし攻めると某ウイルスバスターのweb広告に出てくる
コワモテ893に似たNxPの中の人にこのぶろぐ焼き討ちされちゃいますのでこの辺に
しておいてあげます…
…さて戯言はこの辺にしといてOpenOCDにおいては既にねむいさんがLPC800
シリーズ向けのぱっちを提供し、STLink/V2,Versaloon(※要パッチ),
CMSIS-DAP(※要パッチ)の各デバッガハードウエアからSWDで書き込み可能です。
一応購入したからせっかくだから上記
写真のようにちょっと通電してSTLink/V2で書き込んでやろうかなと
思ったのですが…
> "C:¥Devz¥Coreutils¥bin¥make.exe" program
openocd -s C:/Devz/ARM/OCD/tcl -f interface/stlink-v2.cfg -f target/lpc810_hla_flash.cfg -c "mt_flash main.elf"
Open On-Chip Debugger 0.8.0-dev-00269-g30fb9dd-dirty (2013-11-19-20:50)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
none separate
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : Target voltage: 2.891327
Info : lpc810.cpu: hardware has 4 breakpoints, 2 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x1fff0008 msp: 0x10000ffc
auto erase enabled
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
Warn : not enough working area available(requested 512)
Error: no working area specified, can't write LPC2000 internal flash
Error: error writing to flash at address 0x00000000 at offset 0x00000000
Runtime Error: C:/Devz/ARM/OCD/tcl/target/lpc810_hla_flash.cfg:112:
in procedure 'mt_flash'
in procedure 'flash' called at file "C:/Devz/ARM/OCD/tcl/target/lpc810_hla_flash.cfg", line 112
make: *** [program] エラー 1
> Process Exit Code: 2
> Time Taken: 00:01
↑あれれ…書けない…だめじゃん(LPC812は問題なし)
まさか…
lpc2000.c中でIAPコマンド51番を実行する時にバッファサイズを指定するの
ですがLPC800シリーズは一律1024Byteに減少させていました(LPC2000.cの
デフォルトは4096Byte)。
LPC810のSRAMサイズは1024Byteなのでこれでも足らないみたいです。
いろいろ試した結果、実サイズの4分1の256Byteまで落として成功しました。
> "C:¥Devz¥Coreutils¥bin¥make.exe" program
openocd -s C:/Devz/ARM/OCD/tcl -f interface/stlink-v2.cfg -f target/lpc810_hla_flash.cfg -c "mt_flash main.elf"
Open On-Chip Debugger 0.8.0-dev-00269-g30fb9dd-dirty (2013-11-19-20:50)
Licensed under GNU GPL v2
For bug reports, read
http://openocd.sourceforge.net/doc/doxygen/bugs.html
none separate
Info : This adapter doesn't support configurable speed
Info : STLINK v2 JTAG v17 API v2 SWIM v0 VID 0x0483 PID 0x3748
Info : Target voltage: 2.872920
Info : lpc810.cpu: hardware has 4 breakpoints, 2 watchpoints
target state: halted
target halted due to debug-request, current mode: Thread
xPSR: 0xf1000000 pc: 0x1fff0008 msp: 0x10000ffc
auto erase enabled
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x10000004 msp: 0x100000c8
wrote 3072 bytes from file main.elf in 0.749995s (4.000 KiB/s)
target state: halted
target halted due to breakpoint, current mode: Thread
xPSR: 0x61000000 pc: 0x1000002e msp: 0x10000ffc
verified 2400 bytes in 0.062500s (37.500 KiB/s)
shutdown command invoked
> Process Exit Code: 0
> Time Taken: 00:02
↑cmd51のバッファサイズを下げると書き込みパフォーマンスが下がって
しまうのですがLPC810はフラッシュのサイズも4096バイトしかないので
問題ないです。
なおLPC810は8PinDIPですがお外に出てない足がある模様です。ないはずの
ピンにアクセスするとちゃんと出力が変化しました。上画像のデバッグでは
LPC812のプロジェクトをスタックとチェックサムだけLPC810用に書き換えた
やっけつVerです。
そんなわけで今回の修正分を盛り込んだOpenOCDバイナリはおきぱに反映しました。
珍しくメールやコメントでバグのご指摘もらう前に自分で気づきましたよ!
OpenOCDのgerritにも今レビュー中のSTM32F4のパッチがマージされたら反映させます。
20140109追:
ぱっち提出しました。
20140112追:
マージされました♥
LPC810は同じ8ピンDIPマイコンのAVRの牙城を崩すことができるのか?
それは時間が経てばおのずとわかると思います。
20230903追:
LPC810は無かったことになり、202309現在ではSTM32G0,STM32C0が攻勢を
強めております。特にSTM32C0は8マイコンを駆逐する勢いです!
20230903追:
おまけ
STM32F429I-Discoveryいじりは基本のいつものが実装できるとこまで進みました。
あと数日くらいでファイル公開予定です。実物持ってる人はmakefileの定義を
429IDiscovery向けに変えててためしてみてください。ファイルの読み書きは
SPI接続のMMCなので別途sdカードスロット取付等の配線作業が必要です。
SPIの4つの信号線は22〜47kohmでプルアップを忘れずに!
また429I-Dsicoveryはオンボの+3.3Vレギュレーターが550mAまで出せるので
SDカード一枚程度なら別途3.3Vの電源を用意する必要もないです。
↑しかし液晶載せたおかげでSTM32F4Discoveryよりでかい…
その液晶がIPSやMVAじゃなく普通の視野角が狭い液晶なのは減点ポインツです#
なにはともあれこれをたたき台にしてSTM32F429I-Discovery専用に改造
しまくっていきましょう!
-
免責・連絡先は↑のリンクを
↓SNSもやってます↓
powered by まめわざ- ARM/STM32 (116)
- OpenOCD (27)
- ARM/NxP (34)
- ARM/Cypress (5)
- ARM/Others (3)
- ARM/Raspi (1)
- AVR (13)
- FPGA (4)
- GPS/GNSS (19)
- MISC (81)
- STM8 (2)
- Wirelessなアレ (16)
- おきぱ (1)
- ブラウザベンチマーク (28)
- 日本の自然歩道 (25)
- STM32U0はぢめました
⇒ ねむい (08/07) - STM32U0はぢめました
⇒ ひかわ (07/28) - STM32H5を使ってみる3 -待ち受ける初見殺しの罠たち-
⇒ ねむい (05/17) - STM32H5を使ってみる3 -待ち受ける初見殺しの罠たち-
⇒ どじょりん (05/16) - STM32H5を使ってみる3 -待ち受ける初見殺しの罠たち-
⇒ どじょりん (05/16) - いろいろ試す61(と今年の反省会)
⇒ ねむい (01/02) - いろいろ試す61(と今年の反省会)
⇒ ひかわ (01/02) - いろいろ試す61(と今年の反省会)
⇒ ひかわ (01/01) - STM32H5を使ってみる3 -待ち受ける初見殺しの罠たち-
⇒ ねむい (12/31) - STM32H5を使ってみる3 -待ち受ける初見殺しの罠たち-
⇒ ひかわ (12/31)
- October 2024 (1)
- September 2024 (1)
- August 2024 (1)
- July 2024 (1)
- June 2024 (1)
- May 2024 (1)
- April 2024 (1)
- March 2024 (1)
- February 2024 (2)
- January 2024 (1)
- December 2023 (4)
- November 2023 (2)
- October 2023 (2)
- September 2023 (1)
- August 2023 (2)
- July 2023 (1)
- June 2023 (2)
- May 2023 (3)
- April 2023 (1)
- March 2023 (1)
- February 2023 (1)
- January 2023 (1)
- December 2022 (2)
- November 2022 (1)
- October 2022 (1)
- September 2022 (1)
- August 2022 (1)
- July 2022 (1)
- June 2022 (1)
- May 2022 (1)
- April 2022 (1)
- March 2022 (1)
- February 2022 (1)
- January 2022 (1)
- December 2021 (2)
- November 2021 (2)
- October 2021 (1)
- September 2021 (1)
- August 2021 (1)
- July 2021 (1)
- June 2021 (1)
- May 2021 (1)
- April 2021 (1)
- March 2021 (1)
- February 2021 (1)
- January 2021 (1)
- December 2020 (3)
- November 2020 (1)
- October 2020 (1)
- September 2020 (1)
- August 2020 (1)
- July 2020 (1)
- June 2020 (2)
- May 2020 (1)
- April 2020 (1)
- March 2020 (1)
- February 2020 (1)
- January 2020 (1)
- December 2019 (3)
- November 2019 (1)
- October 2019 (1)
- September 2019 (2)
- August 2019 (1)
- July 2019 (1)
- June 2019 (1)
- May 2019 (1)
- April 2019 (1)
- March 2019 (1)
- February 2019 (1)
- January 2019 (1)
- December 2018 (3)
- November 2018 (2)
- October 2018 (1)
- September 2018 (1)
- August 2018 (1)
- July 2018 (1)
- June 2018 (1)
- May 2018 (1)
- April 2018 (2)
- March 2018 (1)
- February 2018 (1)
- January 2018 (1)
- December 2017 (2)
- November 2017 (2)
- October 2017 (1)
- September 2017 (1)
- August 2017 (1)
- July 2017 (1)
- June 2017 (1)
- May 2017 (1)
- April 2017 (1)
- March 2017 (2)
- February 2017 (2)
- January 2017 (2)
- December 2016 (7)
- November 2016 (2)
- October 2016 (2)
- September 2016 (1)
- August 2016 (1)
- July 2016 (1)
- June 2016 (1)
- May 2016 (2)
- April 2016 (1)
- March 2016 (2)
- February 2016 (1)
- January 2016 (1)
- December 2015 (3)
- November 2015 (1)
- October 2015 (3)
- September 2015 (2)
- August 2015 (2)
- July 2015 (3)
- June 2015 (3)
- May 2015 (4)
- April 2015 (2)
- March 2015 (4)
- February 2015 (1)
- January 2015 (3)
- December 2014 (3)
- November 2014 (2)
- October 2014 (1)
- September 2014 (2)
- August 2014 (2)
- July 2014 (3)
- June 2014 (2)
- May 2014 (1)
- April 2014 (1)
- March 2014 (4)
- February 2014 (4)
- January 2014 (3)
- December 2013 (5)
- November 2013 (4)
- October 2013 (3)
- September 2013 (2)
- August 2013 (2)
- July 2013 (2)
- June 2013 (3)
- May 2013 (2)
- April 2013 (2)
- March 2013 (2)
- February 2013 (2)
- January 2013 (3)
- December 2012 (4)
- November 2012 (2)
- October 2012 (2)
- September 2012 (4)
- August 2012 (1)
- July 2012 (3)
- June 2012 (2)
- May 2012 (3)
- April 2012 (3)
- March 2012 (2)
- February 2012 (3)
- January 2012 (3)
- December 2011 (5)
- November 2011 (3)
- October 2011 (2)
- September 2011 (2)
- August 2011 (2)
- July 2011 (2)
- June 2011 (2)
- May 2011 (2)
- April 2011 (2)
- March 2011 (2)
- February 2011 (2)
- January 2011 (3)
- December 2010 (7)
- November 2010 (1)
- October 2010 (1)
- September 2010 (1)
- August 2010 (3)
- July 2010 (4)
- May 2010 (1)
- April 2010 (2)
- March 2010 (2)
- February 2010 (2)
- January 2010 (3)
- December 2009 (3)
- November 2009 (8)
- October 2009 (7)
- September 2009 (5)
- August 2009 (4)
- July 2009 (6)
- June 2009 (6)
- May 2009 (14)
- January 1970 (1)
Copyright(C) B-Blog project All rights reserved.