è·å Žã§ãAT91SA7A3ã³ã³ãããŒã©ãŒã®ããã°ã©ãã³ã°ã«ééããŸãããããã«ã¯IARã䜿çšãããŠããŸãã ããããç§ã¯2çªç®ã®ã·ã¹ãã ãç¶æããã®ãé¢åãªã®ã§ãç§ã®ãæ°ã«å
¥ãã®Ubuntuã§ããã°ã©ãã³ã°ããããã°ããã¡ãŒã ãŠã§ã¢ã®å¯èœæ§ãæäŸããè©Šã¿ããªãããŸããã ãããŠããããã€ãªããã£ãã©ãªãŒãéããŠ2é±éã®å£ãšã®ã³ãã¥ãã±ãŒã·ã§ã³ã®åŸïŒå£çŽãåãå§ããã®ãšåããããïŒããã®çµæžããã¹ãŠã»ããã¢ããããããšãã§ããŸããã ãããŠããããããç§ã ãã§ã¯ãªãã®ã§ããããã©ã®ããã«è¡ãããããæžããŸãã
AT91SAM7A3-EKããŒããAtmel SAM-ICE JTAGã¢ããã¿ãŒãUbuntu 11.04ãæèŒããã³ã³ãã¥ãŒã¿ãŒãã¿ãã³1ããã¯ãšã³ãŒããŒãã°2æ¯ã çŽ æµãªãããã è¡ããïŒ
1ïŒEclipse Webãµã€ãïŒhttp://www.eclipse.orgïŒã«ã¢ã¯ã»ã¹ããã·ã¹ãã ã®C / C ++éçºè
åãã®Eclipse IDEãããŠã³ããŒãããŸãã ããã®ææ°ããŒãžã§ã³ã¯Eclipse 3.7 Indigoã§ãã
2ïŒOpenOCDãããžã§ã¯ãã®Webãµã€ãïŒhttp://developer.berlios.de/projects/openocd/ïŒã«ã¢ã¯ã»ã¹ããOpenOCD 0.5.0ãœãŒã¹ã³ãŒããåºåããŸãã
3ïŒã³ã³ãã€ã©ãŒã«è¡ããŸãã ARMGCCãšã¯ç°ãªããSourcery G ++ãéžæããŸããã IA32 GNU / Linux TARãããŠã³ããŒãããŠãã ããã
4ïŒãªãã·ã§ã³ïŒãããã¯ãã¹ãŠæåºãããŸãããç
ãåãããšãã§ããŸãã
5ïŒEclipseã¢ãŒã«ã€ããå¿
èŠãªãã£ã¬ã¯ããªã«è§£åããŸãïŒ/ home / user / armããããããeclipseãã©ã«ããŒã衚瀺ãããŸãïŒã
6ïŒã³ã³ãã€ã©ã¢ãŒã«ã€ããç®çã®ãã£ã¬ã¯ããªã«è§£åããŸãïŒ/ home / user / armãããå Žåãarm-2011.03ãã©ã«ããŒã衚瀺ãããããé¡äŒŒãããã®ã衚瀺ãããŸããæ°åã¯ç°ãªãå ŽåããããŸãïŒã
7ïŒSynapticã«ç§»åããusb-devããã±ãŒãžãã€ã³ã¹ããŒã«ããŸããåŸã§å¿
èŠã«ãªããŸãã
8ïŒOpenOCDã䜿çšããŠã¢ãŒã«ã€ãã解åããŸããããŒã ãã©ã«ããŒã«ä¿åãããšããã¹ãå°ãç°¡åã«ãªããŸãã
9ïŒã¿ãŒããã«ãå®è¡ããOpenOCDãœãŒã¹ãã©ã«ããŒïŒè§£åãããã©ã«ããŒïŒã«ãžã£ã³ãããŠã次ã®ã³ãã³ããèšè¿°ããŸãã
./configure --enable-jlink
sudo make
sudo make install
SAM-ICEã®ãµããŒããæå¹ã«ããã«ã¯ãããŒ--enable-jlinkãå¿
èŠã§ãããã®ãããusb-devããã±ãŒãžãã€ã³ã¹ããŒã«ããŸããã
10ïŒãªãã·ã§ã³ïŒããããã¹ãŠè¡ãããŠããéãã³ãŒããŒã飲ã¿ã«è¡ãããšãã§ããŸãã
11ïŒã³ã³ãœãŒã«ã§ã次ã®ããã«èšè¿°ããŸãïŒsudo gedit / etc / environmentã
éãããã¡ã€ã«ã§ãã³ã³ãã€ã©ãžã®ãã¹ãè¿œå ãããšã次ã®ãããªãã®ãåŸãããŸãã
PATH = "/ usr / local / sbinïŒ/ usr / local / binïŒ/ usr / sbinïŒ/ usr / binïŒ/ sbinïŒ/ binïŒ/ usr / gamesïŒ/home/user/arm/arm-2011.03/bin ã
è»ãåèµ·åããïŒãªãã·ã§ã³ã§ïŒå«ç
ããŸãã
12ïŒãã·ã³ãåèµ·åãããã©ã«ããŒããEclipseãèµ·åããã¯ãŒã¯ã¹ããŒã¹ãéžæããŠãããã¯ã¹ããã§ãã¯ããŠãã¯ããŒã«ããªãããã«ããŸãã ããã«ãã->ãæ°èŠãœãããŠã§ã¢ã®ã€ã³ã¹ããŒã«ãã«é²ã¿ããè¿œå ããã¿ã³ãã¯ãªãã¯ããŠãååZylincdtãã¢ãã¬ã¹
opensource.zylin.com/zylincdtãæžãããOKããã¯ãªãã¯ããZylin Embedded CDTãŠã£ã³ããŠã§å¯äžã®ããã±ãŒãžã«ãã§ãã¯ããŒã¯ãä»ããã€ã³ã¹ããŒã©ãŒã®æ瀺ã«åŸããŸããåèµ·åããŸãã ããã§æ°ãããããžã§ã¯ããäœæããŸãïŒãã¡ã€ã«->æ°èŠ-> Cãããžã§ã¯ãã«ç§»åããMakefileãããžã§ã¯ã->空ã®ãããžã§ã¯ããããã«ããããŒã«ãã§ãŒã³-ä»ã®ããŒã«ãã§ãŒã³ãéžæãããããžã§ã¯ãã«ååãä»ããŠçµäºãã¯ãªãã¯ããŸãã 次ã«ãäžæçã«Eclipseãæå°åããŸãã
13ïŒãã©ã«ããŒ/ usr / local / share / openocd / scripts / targetã«ç§»åããããã«ããååã®ã³ã³ãããŒã©ãŒã䜿çšããŠæ§æãã¡ã€ã«ãæ¢ããŸãã é±å±±ïŒAT91SAM7A3ïŒã¯ãããŸããã§ããããGoogleã§ããã«èŠã€ããããã³ãã«ãå°ã調æŽããŸããã ããã°ãçµæ§ã§ãã SAM-ICEãã³ã³ãã¥ãŒã¿ãŒãšããŒãã«æ¥ç¶ããããŒãã«é»æºãæå
¥ããŸãã ã¿ãŒããã«ãèµ·åããŠã次ã®ããã«èšè¿°ããŸãã
sudo openocd -f interface / jlink.cfg -c "jtag_rclk 30; gdb_flash_program enable; gdb_memory_map disable" -f target / at91sam7a3.cfg
泚æïŒ å¥ã®ã¢ããã¿ãŒãŸãã¯å¥ã®ããŒããããå Žåã¯ãjlink.cfgãšat91sam7a3.cfgãå¿
èŠãªãã¡ã€ã«ã«çœ®ãæããŸãã
OpenOCDãèµ·åãã倧éã®æ
å ±ã衚瀺ãããã¯ãã§ãããã®äžã«ã¯ããããã¢ãã«ããããŸãã ã¿ãŒããã«ãŠã£ã³ããŠããªãã«ããŸãã
14ïŒAtmelã®Webãµã€ãã«ã¢ã¯ã»ã¹ããŠããã©ã€ã¢ã«ãããžã§ã¯ããæ¢ããŸãã ããæ²ãã£ãã·ã¹ãã ãããã®ã§ãããã«AT91SAM7A3-EK
ããŒãã®ãããžã§ã¯ããžã®çŽæ¥ãªã³ã¯ã
æäŸããŸãïŒ
www.atmel.com/dyn/resources /
...ing_started.zip ã ããŠã³ããŒããã解åãã解åããå ŽæãèŠããŠãããŠãã ããã Eclipseã«æ»ãããããžã§ã¯ããå³ã¯ãªãã¯ããŠã[ã€ã³ããŒã]ãéžæããããã«General-File SystemãéžæããŸãã æ°ããããŠã³ããŒããããããžã§ã¯ãã解åããããã©ã«ããŒã圌ã«æ瀺ããå¿
èŠãªãã¡ã€ã«ãæå®ããŠïŒãã¹ãŠãéžæããã ãã§èŠããå¿
èŠã¯ãããŸããïŒã[å®äº]ãã¯ãªãã¯ããŸãã
15ïŒãããžã§ã¯ãã®Makefileã«ç§»åããCROSS_COMPILE = arm-elf-ã®è¡ãèŠã€ããŠCROSS_COMPILE = arm-none-eabi-Saveã«çœ®ãæããŸããMakefileãä¿åããProject-> Build Projectã«é²ã¿ããã¹ãŠãã³ã³ãã€ã«ããã³ã³ã³ãã€ã«ãããæ§åã確èªããŸãã ãã¹ãŠãæ£ããè¡ãããå Žåãåºåã¯2ã€ã®ãã¡ã€ã«* .elfããã³* .binã«ãªããŸãã
16ïŒgdbinit_sramãã¡ã€ã«ãšgdbinit_flashãã¡ã€ã«ãããŒã ãã©ã«ããŒïŒãŸãã¯ä»ã®å ŽæïŒã«äœæããŸããããã§ã次ã®ããã«èšè¿°ããŸãã
gdbinit_sramïŒ
ã¿ãŒã²ãããªã¢ãŒãlocalhostïŒ3333
ãªã»ããã®åæåãç£èŠãã
ã¢ãã¿ãŒåæ¢
printf "____ã¿ãŒã²ãããåæ¢ããŸãã____ \ n"
set $ mem_a = * 0x00000000
set $ mem_c = $ mem_a
set $ mem_a = $ mem_a + 1
ã»ãã* 0x00000000 = $ mem_a
set mem_b = * 0x00000000
ifïŒ$ mem_a == $ mem_bïŒ
ã»ãã* 0x00000000 = $ mem_c
printf "____ Remap_is_Done ____ \ n"
ä»ã«
printf "____ Remap_is_Not ____ \ n"
ã»ãã* 0xFFFFFF00 = 1
printf "____ Remap_is_Done ____ \ n"
çµãã
ã¢ãã¿ãŒreg pc 0x00000000
ã¢ãã¿ãŒarm7_9 dbgrq enable
gdb_breakpoint_overrideãããŒãã«ç£èŠ
ããŒã
hbreak / *ããã«ãã¬ãŒã¯ãã€ã³ãã®ãã€ã³ãã瀺ããŸã* /
ç¶ãã
æ¡ä»¶1
gdbinit_flashïŒ
ã¿ãŒã²ãããªã¢ãŒãlocalhostïŒ3333
ãªã»ããã®åæåãç£èŠãã
ã¢ãã¿ãŒåæ¢
printf "____ã¿ãŒã²ãããåæ¢ããŸãã____ \ n"
set $ mem_a = * 0x00000000
set $ mem_c = $ mem_a
set $ mem_a = $ mem_a + 1
ã»ãã* 0x00000000 = $ mem_a
set mem_b = * 0x00000000
ifïŒ$ mem_a == $ mem_bïŒ
printf "____ Remap_is_Not ____ \ n"
ã»ãã* 0x00000000 = $ mem_c
ã»ãã* 0xFFFFFF00 = 1
printf "____ Remap_is_Done ____ \ n"
ä»ã«
printf "____ Remap_is_Done ____ \ n"
çµãã
ã¢ãã¿ãŒarm7_9 dcc_downloads enable
ã¢ãã¿ãŒarm7_9 fast_memory_access enable
ãã©ãã·ã¥ã®æ¶å»erase_sector 0 0 15
ã¢ãã¿ãŒãã©ãã·ã¥ãããŒã0
monitor flash write_bank 0 / *ããã§ãã¡ãŒã ãŠã§ã¢ãã¡ã€ã«ãžã®ãã¹ã瀺ããŸã* / 0
ãªã»ããå®è¡ã®ç£èŠ
殺ã
17ïŒãããã¬ãŒãæ§æããŸãã Run-> Debug Configurationã«ç§»åããZylin Embedded DebugïŒNativeïŒsramïŒãããã°çšïŒãšZylin Embedded DebugïŒNativeïŒãã©ãã·ã¥ïŒãã¡ãŒã ãŠã§ã¢çšïŒã®2ã€ã®æ°ããæ§æãäœæããŸãã ã¿ãä»ãã«ãªããŸããã
ã¡ã€ã³ïŒC / C ++ã¢ããªã±ãŒã·ã§ã³ã¯ããã¹ãšãã¡ã€ã«åãæå®ããŸãã* .elfã¯ãããã°ã«å¿
èŠã* .bin-ã¯ãã¡ãŒã ãŠã§ã¢ã«å¿
èŠã§ãã
ãããã¬ãŒïŒGDBãããã¬ãŒ-ãããã¬ãŒãžã®ãã¹ãæå®ããŸãããã®å Žåãhome / user / arm / arm-2011.03 / bin / arm-none-eabi-gdbã®ããã«ãªããŸãã
GDBã³ãã³ããã¡ã€ã«-ããã§ã¯ã察å¿ããgdbinitãã¡ã€ã«ãžã®ãã¹ã瀺ããŸãã
ã³ãã³ãïŒ[åæåã³ãã³ã]ãã£ãŒã«ãã¯ç©ºã§ãã
[å
±é]ã¿ãïŒ[ãæ°ã«å
¥ãã¡ãã¥ãŒã«è¡šç€º]ã®[ãããã°]ããã¯ã¹ããªã³ã«ããŸãã
[é©çš]ãã¯ãªãã¯ããOpenOCDãå®è¡ãããŠããããšã確èªãã[ãããã°]ãã¯ãªãã¯ããŸãã sramæ§æãå®è¡ãããŠããå Žåããããã°æ
å ±ãå«ããŠã£ã³ããŠã衚瀺ãããŸãã ãªãã·ã§ã³ã§ãå€æ°ãã¡ã¢ãªãéã¢ã»ã³ããªãªã©ã®æŠèŠãå«ããŠã£ã³ããŠãè¿œå ã§ããŸãã
åºæ¥äžããããã¹ãŠãåäœããŸãã
ã¡ãã£ãšããè¿œå ã ããŠã³ããŒããããããžã§ã¯ããåé€ããªãããšããå§ãããŸã-ã¬ãžã¹ã¿ã®æäœã容æã«ããããã®å®æ°ãèšè¿°ããããããŒãã¡ã€ã«ãã¹ã¿ãŒãã¢ãããã¡ã€ã«ããªã³ã«ãŒã¹ã¯ãªããïŒéèŠïŒãæãéèŠãªããšã¯ããããã¬ãŒã®ãã¡ã€ã«ã«ã¡ã¢ãªãã©ã®ããã«å²ãåœãŠããããã説æããMakefileã§ãããã°ã©ããŒã ç§ã«ãšã£ãŠã¯ãããããããããã®æ°ãããããžã§ã¯ãã«è»¢éããMakefileãå°ãç·šéããæ¹ãè¯ãã§ãããã ãããŠäººçã¯çŸããã§ãããã
PSå°ãåŸã§ãé ãå°ãåããã°ãARMã®ããŒã«ãã§ãŒã³ã䜿çšããŠåãããšãã§ããããšã«æ°ä»ããŸãããããã®å¿
èŠæ§ã¯ãªããªããç§ã¯ãããå§ããŸããã§ããã