ãã®èšäºã§ã¯ãé梱ããã¡ãŒã ãŠã§ã¢ããã䜿çšããDSPããã»ããµã«çµã¿èŸŒãŸããŠããNeuroMatrixã³ã¢ã®ãªãŒãã£ãªãšã³ãŒå¹æãŸã§ãããŒããŠã§ã¢ãšãœãããŠã§ã¢ã«ã€ããŠèª¬æããŸãã
ããã±ãŒãžãã³ãã«
ããŒãã¯ã«ã©ãŒããã¯ã¹ã«å ¥ã£ãŠããŸãã å éšã¯ïŒ
- ãã¶ãŒããŒãMB 77.07
- ã€ãŒãµããããããã³ãŒã
- 5V / 2Aé»æº
- çµã¿èŸŒã¿ã®äžçãåããŠç¥ã人ã®ããã®USB-UART
ããã§ã¯ãããããã¹ãŠãå¿ èŠãã©ããããŸãã¯ããŒãä»ãã®åž¯é»é²æ¢ããã°ã®åœ¢ã§éåžžã®OEMäŸçµŠã§ååã§ãããã©ãããè°è«ã§ããŸãã åå¿è ãããã«USB-UARTãå ¥æããã°ãŒã°ã«ãããã人ãå°ãªããªãããCOMããŒãã«æ¥ç¶ããŠãã ãããäœãèµ·ãããªãããšããæšæºçãªæªãã¢ããã€ã¹ãåããè³Œå ¥åŸåæ¥ã«ããŒããçŒãä»ãããšäŸ¿å©ã ãšæããŸãã
é
ä»ãããŒãèªäœãæ€èšãã䟡å€ããããŸãã ããŒãäžã®ããŒãã¯ARM1176ã§ãåãã³ã¢ãRaspberry Piã§äœ¿çšãããŠããŸãã ãã¡ãããããã»ããµã§äœ¿çšãããŠããããŒã«ã«IPã³ã¢ã®ãã©ã€ããŒãã¹ãªããããå¿ èŠããããšãã泚æãæã£ãŠãr-piã®ã·ã£ãŒããªé åžãå®è¡ã§ããŸãã ãã®ã¿ã¹ã¯ã容æã«ããããã«ãããã»ããµéçºè ã§ããSTCãã¢ãžã¥ãŒã«ãã¯ãDebian JessieãšRaspbian Wheezyã®æ¢è£œã®ã€ã¡ãŒãžãæäŸããããã±ãŒãžã¯å®æçã«æŽæ°ãããŸãã
K1879HB1YAã®è¿ãã«ã¯ã128MBã®2ã€ã®DDR2 RAMãããã1GB NANDã¡ã¢ãªã4ããŒãã®USBãããã€ãŒãµãããPHYãããã³ãã³ãã«ãã¯ãã ä»ããããŠããŸãã
ããŒãã®äž¡åŽã«ãããã³ã«ã¯ãããŸããŸãªå€éšã€ã³ã¿ãŒãã§ã€ã¹ããããŸãã
å³åŽïŒ
- JTAG
- 2xUSB-ãã³é åã¯ãã¶ãŒããŒããšãŸã£ããåãã§ãããã¯ã¹ããã¹ã©ãããåãå€ããŸã
- ããŒãã³ã³ãœãŒã«ãåããUART
å·ŠåŽãIDEã«äŒŒãé·ãã³ãã¯ã¿ïŒ
- 8x GPIO
- 1x ãã©ã³ã¹ããŒãã¹ããªãŒã ã€ã³ã¿ãŒãã§ã€ã¹ ïŒè©³çŽ°ã¯ãã¡ãïŒ
- 1x I2C
- 1x SPI
- 1x I2S
- 1x SPDIF
- 1xå€éšå²ã蟌ã¿
- 1.5x UART-1ã€ã®ãã«UARTã2çªç®ã®RX
- 1xãªã»ãã
- 5V
- 3.3V-ã¹ã€ããã³ã°é»æºã®å°çšãã£ã³ãã«ããã®ãã£ã³ãã«ãæ åœãã800mAãäŸçµŠããçŸä»£ã®äžåœã®ã³ã³ããŒãã³ããæ¬åœã«ç¥ã£ãŠããã®ã§ãããã«500mAãè¶ ããŠãã³ã°ã¢ããããŸãã
詳现ãªãã³é 眮ã¯ã http ïŒ //www.module.ru/mb7707/doc/MB77.07-X9-pinout.pdfã§å ¥æã§ããŸãã
ããã¯GPIOããã詳现ã«æ€èšããŠãã ãããããã¯ãããªããèªåã§è§Šãããæåã®å Žæã ããã§ãã GPIOã¯2ã€ã®ç°ãªãã¿ã€ãã§ãã æåã®ã¿ã€ãã¯ãæ«ã«è¡šç€ºããããã®ã§ãgpio-pl061ãã©ã€ããŒïŒIPã³ã¢ARM PrimeCellâ¢æ±çšå ¥åºåPL061 ïŒã«ãã£ãŠããã¯ã¢ãããããŸãã ãããã®GPIOã¯ãå²ã蟌ã¿ãARMã³ã¢ã«ãã«ããããšãã§ããŸããããã¯äŸ¿å©ãªå ŽåããããŸãã ããã«ããã©ã³ã¹ããŒãã¹ããªãŒã ãäžèŠãªå Žåã¯ã_D [0-7]ãã³ãGPIOã§å€éåã§ããããã16ã®å¶åŸ¡ãããã¬ãã°ãååŸã§ããŸãã
sysfsã®ã¬ãã°ã®GPIOçªå·ä»ãã¯ãåç §ã«ããäžèšã®ããã¥ã¡ã³ãã«èšèŒãããŠãããå¿ èŠã«å¿ããŠsysfsã䜿çšããŠãããã調æŽã§ããŸãã
# sysfs, , gpio cd /sys/class/gpio # 23- echo 23 > export # out echo out > gpio23/direction # echo 1 > gpio23/value
2çªç®ã®ã¿ã€ãã®GPIOã¯ããåçŽåãããç°ãªãIPã³ã¢ã«ãã£ãŠç®¡çãããå²ã蟌ã¿ããã«ã§ããŸããã 2ã€ã®ææLEDããããã®GPIOã«æ¥ç¶ããããã®ãã¡ã®1ã€ãLinuxã«ãŒãã«ã®Linuxãã¬ãŒã ã¯ãŒã¯ãä»ããŠããŒãããŒããšããŠç»é²ãããè² è·å¹³åã衚瀺ãããŸãã ãã¹ãŠããã³ã°ããŠãããã©ããããããã°ãããšãã«èŠèŠçã«ç¢ºèªãããšäŸ¿å©ã§ãã
ããŒãäžã®å¥ã®å Žæã«ã¯ãããŒããžã£ã³ãçšã®2ã€ã®ãã³ããããŸãã
ããŠã³ããŒãã¯ç°¡åãã€ç¢ºå®ã«è¡ãããŸãããžã£ã³ããŒããªãå Žå-NANDã¡ã¢ãªããã®èªã¿èŸŒã¿ãçºçãããžã£ã³ããŒããªã³ã®å Žå-ããŒãã¯JTAGãŸãã¯EDCLãä»ããèªã¿èŸŒã¿ãåŸ æ©ããŠããŸãã ããŒãããªã»ããããããšããžã£ã³ããŒã®äœçœ®ãèªã¿åãããŸãã åŸè ã®ã¢ãŒãã«ã€ããŠè©³ãã説æãã䟡å€ããããŸãããŸã ééããŠããªãå¯èœæ§ããããŸãã
Edcl
EDCLãŸãã¯ã€ãŒãµããããããã°éä¿¡ãªã³ã¯ã¯ãã€ãŒãµãããã³ã³ãããŒã©ã«çµã¿èŸŒãŸããããŒããŠã§ã¢æ©èœã§ãããé©åã«åœ¢æãããã€ãŒãµããããã±ãããéä¿¡ããããšã«ãããç©çã¡ã¢ãªã®æžã蟌ã¿ãšèªã¿åããå¯èœã«ããŸãã ãã®æ©èœã¯ã䜿çšãããŠããã€ãŒãµãããã³ã³ãããŒã©ãŒã®IPã³ã¢ã§ããgrethã«ãã³ãã«ãããŠããŸããã EDCLèªäœã¯éåžžã«äŸ¿å©ã§ãããæ¬çªç°å¢ã§æå¹ã«ãããŸãŸã«ããŠãããšãéåžžã«å€§ããªã»ãã¥ãªãã£ããŒã«ãçããŸãïŒæ¬çªç°å¢ã«å«ãŸããEDCLã§åãã€ãŒãµãããã³ã³ãããŒã©ãæèŒããããã»ããµãããã€åäœããã®ã§ããããïŒïŒã
EDCLã®äžã§ã奜å¥å¿ã®åŒ·ãedcltoolããŒã«ãå®è¡ããluaãã¹ãAPIãedclã«æäŸããŸãã ãã®ãã¯ãããžãŒã¯ããã¡ãŒã ãŠã§ã¢ããã³ãã¡ãŒã ãŠã§ã¢ããŒãã«äœ¿çšãããŸãã Edcltoolèªäœã¯ããšããšLinuxåãã«èšèšããããã®ã§ãããçš®ã®ã©ã€ãã¹ãŒã/ãã§ããã¯ã¹ã¹ãŒããŸãã¯rkbatchãæäŸãã人æ°ã®SoCã¡ãŒã«ãŒãšã¯ç°ãªããŸãã
Windowsçšã®ããŒãžã§ã³ããããŸãããããã¯å®éšçã§ãmingwã䜿çšããŠäœæãããWinPCAPã®ã€ã³ã¹ããŒã«ãå¿ èŠã§ãã ãŸããéåžžã«ãã£ãããšåäœããŸãã
LinuxããŒãžã§ã³ã¯æšæºã®./bootstrap && ./configure --prefix = / usr && make && sudo make installãšããŠèšå®ãããlua5.1-devãŸãã¯lua5.2-devãšlibelfã®ã¿ãèŠæ±ããŸãã NeuroMatrix DSPã䜿çšããå¿ èŠãããå Žåã¯ãåŸè ãå¿ èŠã§ããããã«ã€ããŠã¯ä»¥äžã§èª¬æããŸãã
Edcltoolèªäœãedclã¹ã¯ãªãããå®è¡ããŸããããã¯å®éã«ã¯éåžžã®luaã¹ã¯ãªããã§ãããéåžžã«ã·ã³ãã«ã§èªã¿ãããããã«èŠããŸãã ããšãã°ã裞ã®ARMã§ã³ãŒããå®è¡ããã¹ã¯ãªããã¯æ¬¡ã®ãšããã§ãã
fw = require("fw"); edcl_init(); fw.run_code("mboot-uemd.bin");
次ã«ãmbootããŒãããŒããŒãã¡ãŒã ãŠã§ã¢ã次ã«ç€ºããŸãã
fw = require("fw"); edcl_init(); fw.run_code("mboot-uemd.bin", true); -- start in slave mode fw.write_bootloader("mboot-signed.bin")
NANDã§ããŒãã£ã·ã§ã³ããŒãã«ãäœæããã«ãŒãã«ãdtbãããã³ã«ãŒããã¡ã€ã«ã·ã¹ãã ãèšè¿°ããŸãã
fw = require("fw"); edcl_init(); fw.run_code("mboot-uemd.bin",true); -- start in slave mode fw.write_bootloader("mboot-signed.bin") -- save signed loader in NAND -- all sizes are in bytes partition_table = { { "kernel", 4*1024*1024 }, { "rootfs", "-" }, } fw.partition(partition_table); -- prepare and erase all nand fw.mboot_cmd("parterase kernel y y") fw.mboot_cmd("parterase rootfs y y") fw.flash_part("kernel", "uImage", false); fw.flash_part("dtb", "mb77.07.dtb", false); fw.flash_part("rootfs", "filesystem.ubifs", false); fw.mboot_cmd("setenv bootargs console=ttyS0,38400n8 earlyprintk=serial ubi.mtd=4,2048 root=ubi0:rootfs rootfstype=ubifs"); fw.mboot_cmd("setenv bootfdt 1") fw.mboot_cmd("save");
ããã¯ã裞ã®NeuroMatrixïŒç¥ããŠNMCïŒã§ã®ã³ãŒãã®å®è¡æ¹æ³ã§ãã
nmc = require("easynmc"); nmc.debug = true; edcl_init(); nmc.init_core("ipl-K1879-nmc-debug.abs"); entry = nmc.upload("myfile.abs"); nmc.run(entry); -- Warning: nmc stdio, arguments and return code are NOT yet supported -- when running nmc prog via edcltool. Use linux libeasynmc. -- Expect these implemented in future updates. Sorry.
ã¹ã¯ãªããèªäœã®å®è¡ã¯éåžžã«ç°¡åã§ãã
edcltool -f script.edcl -i _
ã€ã³ã¿ãŒãã§ã€ã¹åãå¿ãããšãedcltoolã¯eth0ïŒWindowsã§ã¯0çªç®ã®ã€ã³ã¿ãŒãã§ã€ã¹ïŒã䜿çšããŸãã 䜿çšå¯èœãªã€ã³ã¿ãŒãã§ãŒã¹ããªã¹ãããedcltool âlã³ãã³ãã¯ãWindowsã§ç¹ã«åœ¹ç«ã¡ãŸããWindowsã§ã¯ãã©ã®ã€ã³ã¿ãŒãã§ãŒã¹ãã·ã¹ãã å ã®ã©ã®çªå·ã«ç»é²ãããŠããããã³ã³ãããŒã«ããã«ã§æ確ã«ãªããªãå ŽåããããŸãã
äžèšã«å ããŠãDSPçšã®ä»ã®ã¹ã¯ãªãããå«ãŸããŠããŸããå®éãLinuxãããŒãããŠDSPã³ãŒããéçºããããšã¯ã§ããŸããã edcltoolã䜿çšããŠã¢ãŒã«ã€ãã«ã¹ã¯ãªãããæžã蟌ãããã«ãSCRIPTING.TXTãã¡ã€ã«ããããŸãããã®ãã¡ã€ã«ã«ã¯ãedclç°å¢ã§äœ¿çšå¯èœãªæ©èœã®è©³çŽ°ãèšè¿°ãããŠããŸãã
ãã¡ãŒã ãŠã§ã¢
次ã«ããªãªãŒã¹åŸã«ããã»ããµéçºè ã«å¿ èŠãšãããäž»ãªãã®ãã€ãŸããã¡ãŒã ãŠã§ã¢ãšãã®é ä¿¡ãããã®ãµããŒãã«ã€ããŠè©±ããŸãããã å ¬åŒãµã€ãã®åãã¡ãŒã ãŠã§ã¢ã«ã¯ãããŒãããŒããŒãã«ãŒãã«ããã¡ãŒã ãŠã§ã¢çšã®edclã¹ã¯ãªããã念ã®ããã®win-versionãããã³READMEãå«ãå®å šãªç°å¢ãå«ãŸããŠããŸãã
çŸåšã®ãã¡ãŒã ãŠã§ã¢ããã±ãŒãžã®è©³çŽ°ãªæé ã¯åã¢ãŒã«ã€ãã«èšèŒãããŠããŸãããåŒçšããããšã¯æå³ããããŸããã
- ã·ã§ãŒãããŒã
- ããŒãäžã®ãªã»ãããæŒããŸã
- edcltool âf eupgrade.edclãå®è¡ããŸã
- ãè¶ã飲ã7-10å
- ãžã£ã³ããŒãåãå€ãããªã»ãããæŒããŸã
ç°å¢
ããŒããšã®æ¬æ Œçãªäœæ¥ã«ã¯ãããŒãããã»ããµãšãã®DSPçšã®ãœãããŠã§ã¢ãæ§ç¯ããããã®ç°å¢ãå¿ èŠã§ãããã®ã¢ãžã¥ãŒã«ã¯ãLinuxãšWindowsã®äž¡æ¹ã«å¯ŸããŠæ¢ã«æ§ç¯ãããããŒã«ãã§ãŒã³ãæäŸããŸãã ãããã®ã€ã³ã¹ããŒã«ã¯éåžžã«ç°¡åã§ããããšãã°ãããŒã«ãã§ãŒã³ãã/ x-toolsãšããååã§å€ãã®äººã«éŠŽæã¿ã®ããå Žæã«ä¿åãããŠãããšããŸãã 次ã«ãããããã¢ãžã¥ãŒã«ããããŠã³ããŒãããããŒã«ãã§ãŒã³ãé 眮ããå¿ èŠãããããã¹ã®æ¬¡ã®ãã³ãç»é²ããããšãå¿ããªãã§ãã ããïŒ
export PATH=$PATH:~/x-tools/arm-module-linux-gnueabi/bin
ååž
ããã»ããµã®è£œé å ã¯ããã£ã¹ããªãã¥ãŒã·ã§ã³ã®æ§ç¯ã«ãããŠæå°éã§ãããããã©ã«ãã§ã¯ãDebianããã³Raspbianã¯ãããã¯ãŒã¯ããã³sshããµããŒãããæå°éã®æ§æã§æäŸãããŸãã 324MHzã®X11ã¯ã©ãããããããã£ããåäœããŸãããããã«ãããŒãããŒããŒã¯ç»é¢ã«äœããæç»ããæ¹æ³ãç¥ããŸããã ããŒããšéä¿¡ããäž»ãªæ¹æ³ã¯ã·ãªã¢ã«ã³ã³ãœãŒã«ã§ãUARTãé ä¿¡ããã±ãŒãžã«å«ãŸããŠããŸãã ããã©ã«ãã§ã¯ã補é å ããã®é åžããããããã¯ãŒã¯ã¯ãããŒãã®ã¢ãã¬ã¹192.168.0.7ããã°ã€ã³ã«ãŒãããã¹ã¯ãŒã12345678ã§äžæããŸãã
補é å ãªããžããªã¯ãsources.listã§æ¬¡ã®ããã«å ¬éãããŠããŸãã
# RC Module's repository with MB77.07 packages deb http://www.module.ru/mb7707/ stable updates
ããŒãã·ã¹ãã
NANDã䜿çšããŠã·ã¹ãã ãèµ·åããæ¹æ³ã«ã€ããŠå°ã説æããŸãã IPLããŒããŒãæåã«å®è¡ãããããŒããžã£ã³ããŒã®äœçœ®ã確èªããŸãã
- ãžã£ã³ããŒãåãä»ããããŠããå Žåã«ãžã£ã³ãããedcl / jtag 32ãããã¢ãã¬ã¹ããã®ããžãã¯ã¢ãã¬ã¹0x00100000ïŒæåã®SRAMã¡ã¢ãªãã³ã¯IM0ã®éå§ã¢ãã¬ã¹ïŒãåŸ ã€
- NANDããIM0ã«ããŒãããŒããŒãããŒãããmd5ããã§ãã¯ãããžã£ã³ããŒãã€ã³ã¹ããŒã«ãããŠããªãå Žåã¯å®è¡ãéå§ããŸã
mbootããŒãããŒããŒãæåã«èµ·åããŸãã ããã¯u-bootã®ãã©ãŒã¯ã§ãå°ããªãã¡ã¯ã¿ãªã³ã°ãããŠããŸãã ããã¯ãSRAMã¡ã¢ãªããåäœããŸããSRAMã¡ã¢ãªã¯ãããã»ããµäžã§ã¯é©ãã»ã©å€ããIM [0-3]ãšããååã®4ã€ã®ãã³ã¯ã§ãã åãã³ã¯ã¯256ãããã€ãã§ãã å€æããããã«ã次ã®ããããã®ç®çïŒ
- IM0-ããŒãããŒããŒãæ©èœããã¡ã¢ãªã¯äœ¿çšããããããŒãåŸã«ã¢ã€ãã«ç¶æ ã«ãªããŸããå人ã®ç®çã«äœ¿çšã§ããŸãã
- IM1ãIM3-NeuroMatrixã¡ã¢ãªãNMCã³ãŒãã®å®è¡å ã§ããNMCã«ã¢ã¯ã»ã¹ããéã«ãNMCãåªå ãããŸãã
- IM2-h264ãã³ãŒããŒã«ãã£ãŠäœ¿çšãããŸãã ãã³ãŒããŒã䜿çšããªãå Žåã¯ãããŒãºã«åãããŠäœ¿çšââã§ããŸãã
ã¡ãªã¿ã«ãmbootã®å€ãããŒãžã§ã³ã¯googleã§èŠã€ããããšãã§ããŸããæ€çŽ¢æéãççž®ããããã®ãªã³ã¯ã§ããSergey Mironovã®githubã¢ã«ãŠã³ãã«ãããŸãïŒ github.com/ierton/mbootãã®ããã誰ã«ãšã£ãŠã圹ç«ã€ãšã¯èããããŸããã
ããŒãããŒããŒã«ã€ããŠæåŸã«èšããããšã¯ãpmgrã³ãã³ãã«å ããŠãããã€ãã®æŽæ°ã³ãã³ãããããŸã-fwupgradeããã³eupgradeã¯ãtftpã€ã¡ãŒãžããã©ãã·ã¥ããããã«èšèšãããŠãããDDRããŒãã§å©çšå¯èœãªã¡ã¢ãªã®ãµã€ãºãã倧ãããªãå¯èœæ§ãããããšã§ãã ãã以å€ã®å Žåãããã¯éåžžã®u-bootã§ãããå€ãã®ãŠãŒã¶ãŒãæ £ããŠããŸãã ããŒãããŒããŒããã¯ããããã¯ãŒã¯ãå©çšå¯èœã§ãNANDãSPIãã©ãã·ã¥ïŒæ®å¿µãªãããMB77.07ã«ã¯æèŒããŠããŸããã§ããïŒãããã³ãã¡ã€ã«ã·ã¹ãã ããµããŒãããªãå°ããªUSBã§åäœããŸãã
ã¡ã¢ãªã«æ»ããŸããããIM0ãIM1ã«ãªã£ãçŽåŸã®ã¢ãã¬ã¹ç©ºéã§ãããã«IM3ã«ãªããŸããSRAMã§åäœããäœã¬ãã«ã®ã³ãŒããæžããšãã¯èŠããŠãã䟡å€ããããŸãããã®ãããªã³ãŒããæžããšãã¯ãSRAMã¡ã¢ãªãããããããããšãèŠããŠãã䟡å€ããããŸããå€ãè¯ãAT91RM9200ã®ãªã³ãããã¡ã¢ãªââã¯ããã4Kã§ããã ãã®ãããããã®ããŒãããŒããŒã¯SPLãªãã§SRAMã§çŽæ¥åäœããŸãã ãã®ã¢ãããŒãã¯éåžžã«äŸ¿å©ã§ããããã¯ãDDRãARMãNeuroMatrixã®DDRãšã¯å¯Ÿç §çã«ãã¢ã¯ã»ã¹æéãæ°ãã£ãã¯ã«éããªãããã§ãã ã€ãŸããããããã®ã³ãŒãã¯éåžžã«é«éã«åäœããŸãã ããã«ãNMCã®ã³ãŒããDDRã«é ŒãããšãªããIM1 / IM3ããã®ã¿æ©èœããå ŽåãNMCã§éåžžã«é£ãããªã¢ã«ã¿ã€ã ããŒãããããããšãå¯èœã«ãªããŸãã
ããã«ãNANDããã詳现ã«æ€èšãã䟡å€ããããŸããNANDã¯ããŒãã£ã·ã§ã³åãããŠãããbootãenvãdtbãæåã§ãã ç®è©°ãŸãããŠããããããµã€ãºãå€æŽã§ããŸããã 1ã€ç®ã¯ããŒãããŒããŒã2ã€ç®ã¯ãã®ç°å¢ã3ã€ç®ã¯ã³ã³ãã€ã«ãããããã€ã¹ããªãŒBLOBã§ãã æ®ãã¯ãpmgrããŒãããŒããŒã³ãã³ãã䜿çšããŠã€ã³ã¿ã©ã¯ãã£ãã«å£ããããedclã¹ã¯ãªããããã€ã¡ãŒãžããã©ãã·ã¥ãããšãã«èªåçã«å£ããŸãã ããŒããŒã¯ãæå®ãããã»ã¯ã·ã§ã³ãã«ãŒãã«ã«æž¡ããæšæºã®mtdpartsãcmdlineã«è¿œå ããŸãã
NANDã䜿çšãããšãäžè¬çã«somethingç¶ãšããããšãäºæ³ãããŠããŸããã linux-sunxiãšlinux-rockchipã®çµéšãããNANDã¯ãã¡ãã¡ã§ã²ã©ãç¶æ ã«ãããŸããã Allwinnerã¯ãç¬èªã®åä»ãªãŠã§ã¢ã¬ããªã³ã°ã¢ã«ãŽãªãºã ãªã©ãåãããéšåçã«éããFTLïŒãã©ãã·ã¥å€æã¬ã€ã€ãŒïŒãåããNANDãç¬èªã®ãããã¯ããã€ã¹ã«ããŸããã ããã¯ãããã¯éåžžãã¯ããŒãºãã¢ãžã¥ãŒã«rknand.koã®åœ¢åŒã§ã®ã¿NANDãæäŸããŸãããã®ãœãŒã¹ã³ãŒãã¯ãïŒlinux-rockhip @ freenodeã§èª¬æããããã«ãNDAã®äžã§äŒç€Ÿã®ããŒãããŒã«ããæž¡ãããŸããã ããã§ãNANDã¯éåžžã®ã¹ã¿ã³ãã¢ãã³mtdããã€ã¹ã§ããããã®äžã«ãã§ã«æšæºã«ãªã£ãŠããUBIFSã䜿çšãããŠããŸãããããã¯åã°ããããšã§ãã
ããŒãèªäœã«ã€ããŠèª¬æããŸãã å€ãã®äººãdmesgãèŠãŠã¿ãããšæãã§ãããã
ããŒãã·ã¹ãã
MBOOT (K1879 and friends): Version mboot-00063-g9302e24-dirty (Built Thu Aug 21 17:10:13 MSK 2014) OTP info: boot_source 2 jtag_stop 0 words_len 1024 Maximum bank size: 0x10000000 bytes Detected 134217728 bytes of EM0 memory MEMORY: 40000000 -> 48000000 Memory layout 0x00100010 early 0x001001C8 text 0x0011E9BC data 0x00127D40 signature 0x00127D44 bss_start 0x00135EB4 stack_start 0x00137FF8^ stack_ptr 0x00138000 malloc 0x0017F000 env mnand_read_id: flash id 0xD3 mnand_read_id: flash ext_id 0x95 mnand_read_id: CS0 NAND 1GiB 3,3V 8-bit size(1024) writesize(2048) oobsize(64) erasesize(131072) mnand_read_id: flash id 0x00 mnand_read_id: WARNING: Unknown flash ID. Using default (0xF1) mnand_read_id: flash ext_id 0x00 mnand: Chip configurations differ, ignoring CS1 greth: Setting GRETH base addr to 0x20034000 greth: Found GRETH at 0x20034000, irq 255 greth: Resetting GRETH greth: greth: 'phyaddr' not set, fall back to built-in table greth: greth: using preset PHY addr: 1f greth: Resetting the PHY greth: write_mii: 0x20034010 < 0xF809F801 [p:31 a:0 d:0xF809] greth: write_mii: 0x20034010 < 0x0000F801 [p:31 a:0 d:0x0000] greth: 10/100 GRETH Ethermac at [0x20034000] irq 255. Running 10 Mbps half duplex PHY info not available greth: greth_init greth: greth_init: enabling receiver ETH new device: name GRETH_10/100 greth: GRETH: New MAC address: 02:00:f7:00:27:0f USB thresholds: in 0x20 out 0x7e Is there an EDCL emergency? Nope edcl: Ethernet debug disabled by environment MTD Partition: boot @ 0x00000000 size 0x00040000 MTD Partition: env @ 0x00040000 size 0x00020000 MTD Partition: dtb @ 0x00060000 size 0x00020000 MTD Partition: kernel @ 0x00080000 size 0x00400000 MTD Partition: rootfs @ 0x00480000 size 0x3FB80000 Hit any key (in 2 sec) to skip autoload... Running autoload command 'tftp;bootm;' TFTP Using GRETH_10/100 device TFTP params: server 192.168.0.1 our_ip 192.168.0.7 TFTP params: filename 'uImage-3' load_address 0x40100000 TFTP Loading: T ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################################################# ################################ TFTP done Linux preparing to boot the kernel: machid 0xcd1 Using Flatterned Device Tree boot method IMG moving image: type 2 from 0x40100040 to 0x40008000 HINT: To optimize boot time adjust loadaddr to: 0x40007fc0 Linux entry 0x40008000 USB thresholds: in 0x20 out 0x7e Uncompressing Linux... done, booting the kernel. [ 0.000000] Booting Linux on physical CPU 0x0 [ 0.000000] Linux version 3.10.28-shadow1-00032-gb8b1a50 (necromant@sylwer) (gcc version 4.8.1 (crosstool-NG 1.19.0) ) #141 Thu Aug 21 14:23:26 MSK 2014 [ 0.000000] CPU: ARMv6-compatible processor [410fb767] revision 7 (ARMv7), cr=00c5387d [ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT nonaliasing instruction cache [ 0.000000] Machine: Module MB77.07, model: Module MB77.07 [ 0.000000] bootconsole [earlycon0] enabled [ 0.000000] Memory policy: ECC disabled, Data cache writeback [ 0.000000] On node 0 totalpages: 24128 [ 0.000000] free_area_init_node: node 0, pgdat c050df84, node_mem_map c0596000 [ 0.000000] Normal zone: 288 pages used for memmap [ 0.000000] Normal zone: 0 pages reserved [ 0.000000] Normal zone: 24128 pages, LIFO batch:3 [ 0.000000] pcpu-alloc: s0 r0 d32768 u32768 alloc=1*32768 [ 0.000000] pcpu-alloc: [0] 0 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 23840 [ 0.000000] Kernel command line: debug console=ttyS0,38400n8 earlyprintk=serial ubi.mtd=4,2048 root=ubi0:rootfs rootfstype=ubifs mtdparts=mnand:0x40000@0x0(boot),0x20000@0x40000(env),0x20000@0x60000(dtb),0x400000@0x80000(kernel),0x3FB8000) [ 0.000000] PID hash table entries: 512 (order: -1, 2048 bytes) [ 0.000000] Dentry cache hash table entries: 16384 (order: 4, 65536 bytes) [ 0.000000] Inode-cache hash table entries: 8192 (order: 3, 32768 bytes) [ 0.000000] Memory: 94MB 0MB = 94MB total [ 0.000000] Memory: 89208k/89208k available, 41864k reserved, 0K highmem [ 0.000000] Virtual kernel memory layout: [ 0.000000] vector : 0xffff0000 - 0xffff1000 ( 4 kB) [ 0.000000] fixmap : 0xfff00000 - 0xfffe0000 ( 896 kB) [ 0.000000] vmalloc : 0xc8800000 - 0xff000000 ( 872 MB) [ 0.000000] lowmem : 0xc0000000 - 0xc8000000 ( 128 MB) [ 0.000000] modules : 0xbf000000 - 0xc0000000 ( 16 MB) [ 0.000000] .text : 0xc0008000 - 0xc04af9cc (4767 kB) [ 0.000000] .init : 0xc04b0000 - 0xc04d31d4 ( 141 kB) [ 0.000000] .data : 0xc04d4000 - 0xc0515d50 ( 264 kB) [ 0.000000] .bss : 0xc0515d50 - 0xc0595990 ( 512 kB) [ 0.000000] SLUB: HWalign=32, Order=0-3, MinObjects=0, CPUs=1, Nodes=1 [ 0.000000] NR_IRQS:128 [ 0.000000] regs = 0xf8000000, irq_start = 0 [ 0.000000] VIC @f8000000: id 0x00041192, vendor 0x41 [ 0.000000] regs = 0xf8010000, irq_start = 32 [ 0.000000] VIC @f8010000: id 0x00041192, vendor 0x41 [ 0.000000] UEMD: Firing up timer system [ 0.000000] Clocksource: rate 54000000 mult 19418074 shift 20 [ 0.000000] Clockevent: rate 54000000 mult 231928233 shift 32 [ 0.000000] sched_clock: 32 bits at 100 Hz, resolution 10000000ns, wraps every 4294967286ms [ 0.000000] Console: colour dummy device 80x30 [ 0.020000] Calibrating delay loop... 215.04 BogoMIPS (lpj=1075200) [ 0.100000] pid_max: default: 32768 minimum: 301 [ 0.110000] Mount-cache hash table entries: 512 [ 0.120000] CPU: Testing write buffer coherency: ok [ 0.130000] Setting up static identity map for 0xc03417b8 - 0xc03417f0 [ 0.150000] devtmpfs: initialized [ 0.160000] NET: Registered protocol family 16 [ 0.170000] DMA: preallocated 256 KiB pool for atomic coherent allocations [ 0.240000] OTP ROM is not flashed [ 0.250000] msvdhd: configuring memory [ 0.260000] hw-breakpoint: found 6 breakpoint and 1 watchpoint registers. [ 0.270000] hw-breakpoint: maximum watchpoint size is 4 bytes. [ 0.410000] bio: create slab <bio-0> at 0 [ 0.430000] SCSI subsystem initialized [ 0.440000] ssp-pl022 2002e000.ssp: ARM PL022 driver, device ID: 0x00041022 [ 0.450000] ssp-pl022 2002e000.ssp: BUSNO: 0 [ 0.460000] pl022: mapped registers from 0x2002e000 to f802e000 [ 0.470000] ssp-pl022 2002e000.ssp: registered master spi0 [ 0.480000] spi spi0.0: allocated memory for controller's runtime state [ 0.490000] ssp-pl022 2002e000.ssp: SSP Target Frequency is: 25000000, Effective Frequency is 13500000 [ 0.500000] ssp-pl022 2002e000.ssp: SSP cpsdvsr = 2, scr = 1 [ 0.510000] spi spi0.0: 4 <= n <=8 bits per word [ 0.520000] spi spi0.0: DMA mode NOT set in controller state [ 0.530000] spi spi0.0: setup mode 1, 8 bits/w, 25000000 Hz max --> 0 [ 0.540000] ssp-pl022 2002e000.ssp: registered child spi0.0 [ 0.550000] ssp-pl022 2002e000.ssp: probe succeeded [ 0.570000] usbcore: registered new interface driver usbfs [ 0.580000] usbcore: registered new interface driver hub [ 0.590000] usbcore: registered new device driver usb [ 0.600000] media: Linux media interface: v0.10 [ 0.610000] Linux video capture interface: v2.00 [ 0.620000] Advanced Linux Sound Architecture Driver Initialized. [ 0.630000] Switching to clocksource uemd_timer1 [ 0.730000] NET: Registered protocol family 2 [ 0.740000] TCP established hash table entries: 1024 (order: 1, 8192 bytes) [ 0.750000] TCP bind hash table entries: 1024 (order: 0, 4096 bytes) [ 0.760000] TCP: Hash tables configured (established 1024 bind 1024) [ 0.780000] TCP: reno registered [ 0.790000] UDP hash table entries: 256 (order: 0, 4096 bytes) [ 0.800000] UDP-Lite hash table entries: 256 (order: 0, 4096 bytes) [ 0.810000] NET: Registered protocol family 1 [ 0.820000] RPC: Registered named UNIX socket transport module. [ 0.830000] RPC: Registered udp transport module. [ 0.840000] RPC: Registered tcp transport module. [ 0.850000] RPC: Registered tcp NFSv4.1 backchannel transport module. [ 0.930000] squashfs: version 4.0 (2009/01/31) Phillip Lougher [ 0.950000] NFS: Registering the id_resolver key type [ 0.960000] Key type id_resolver registered [ 0.970000] Key type id_legacy registered [ 0.980000] msgmni has been set to 174 [ 1.000000] alg: No test for stdrng (krng) [ 1.010000] io scheduler noop registered (default) [ 1.020000] fj_gpio: Added 32 gpio lines at base -981095888 [ 1.040000] module_vdu 80173000.vdu: found VDU device at 80173000, id <ebebab01> [ 1.070000] Console: switching to colour frame buffer device 90x36 [ 1.090000] fb0: Module VDU frame buffer device [ 1.140000] Serial: 8250/16550 driver, 3 ports, IRQ sharing disabled [ 1.150000] 2002b000.uart: ttyS0 at MMIO 0x2002b000 (irq = 7) is a 8250 [ 1.160000] console [ttyS0] enabled, bootconsole disabled [ 1.160000] console [ttyS0] enabled, bootconsole disabled [ 1.170000] 20022000.uart: ttyS1 at MMIO 0x20022000 (irq = 9) is a 8250 [ 1.180000] 2002c000.uart: ttyS2 at MMIO 0x2002c000 (irq = 8) is a 8250 [ 1.200000] [drm] Initialized drm 1.1.0 20060810 [ 1.240000] loop: module loaded [ 1.250000] msvdhd 80180000.video_decoder: found device at 0x80180000, id 0x0025300b [ 1.300000] EasyNMC Unified DSP Framework. (c) RC Module 2014 [ 1.310000] easynmc-nmc3: imem at phys 0x140000 virt 0xc8900000 size 0x80000 bytes [ 1.320000] easynmc-nmc3: HP IRQ 14 LP IRQ 15 [ 1.330000] easynmc: registering core K1879-nmc (nmc3) with id 0 [ 1.350000] flash ext_id 0x95 [ 1.360000] mnand CS0 Samsung size(1024) writesize(2048) oobsize(64) erasesize(131072) [ 1.370000] mnand: Bad chip id or no chip at CS1 [ 1.380000] mnand: Detected 1073741824 bytes of NAND [ 1.390000] 5 cmdlinepart partitions found on MTD device mnand [ 1.400000] Creating 5 MTD partitions on "mnand": [ 1.410000] 0x000000000000-0x000000040000 : "boot" [ 1.430000] 0x000000040000-0x000000060000 : "env" [ 1.450000] 0x000000060000-0x000000080000 : "dtb" [ 1.470000] 0x000000080000-0x000000480000 : "kernel" [ 1.510000] 0x000000480000-0x000040000000 : "rootfs" [ 6.500000] libphy: greth-mdio: probed [ 9.590000] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver [ 9.600000] uemd-ehci 10040000.ehci: UEMD EHCI [ 9.610000] uemd-ehci 10040000.ehci: new USB bus registered, assigned bus number 1 [ 9.630000] uemd-ehci 10040000.ehci: irq 35, io mem 0x10040000 [ 9.660000] uemd-ehci 10040000.ehci: USB 2.0 started, EHCI 1.00 [ 9.680000] hub 1-0:1.0: USB hub found [ 9.690000] hub 1-0:1.0: 2 ports detected [ 9.700000] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver [ 9.710000] usbcore: registered new interface driver usb-storage [ 9.720000] usbcore: registered new interface driver usbserial [ 9.730000] mousedev: PS/2 mouse device common for all mice [ 9.740000] i2c /dev entries driver [ 9.770000] module_hdmi: module_hdmi: Device ID: 0x9132 [ 9.780000] usbcore: registered new interface driver i2c-tiny-usb [ 9.800000] ledtrig-cpu: registered to indicate activity on CPUs [ 9.850000] usbcore: registered new interface driver usbhid [ 9.860000] usbhid: USB HID core driver [ 9.900000] TCP: cubic registered [ 9.910000] Key type dns_resolver registered [ 9.920000] VFP support v0.3: implementor 41 architecture 1 part 20 variant b rev 5 [ 9.950000] UBI: attaching mtd4 to ubi0 [ 10.020000] usb 1-1: new high-speed USB device number 2 using uemd-ehci [ 10.180000] hub 1-1:1.0: USB hub found [ 10.190000] hub 1-1:1.0: 4 ports detected [ 25.560000] UBI: scanning is finished [ 25.640000] UBI: attached mtd4 (name "rootfs", size 1019 MiB) to ubi0 [ 25.650000] UBI: PEB size: 131072 bytes (128 KiB), LEB size: 126976 bytes [ 25.660000] UBI: min./max. I/O unit sizes: 2048/2048, sub-page size 2048 [ 25.670000] UBI: VID header offset: 2048 (aligned 2048), data offset: 4096 [ 25.680000] UBI: good PEBs: 8141, bad PEBs: 15, corrupted PEBs: 0 [ 25.690000] UBI: user volume: 1, internal volumes: 1, max. volumes count: 128 [ 25.700000] UBI: max/mean erase counter: 4/1, WL threshold: 4096, image sequence number: 23379108 [ 25.710000] UBI: available PEBs: 0, total reserved PEBs: 8141, PEBs reserved for bad PEB handling: 145 [ 25.720000] mvdu: will allocate buffers [ 25.730000] mvdu: did allocate buffers cc000000 [ 25.740000] UBI: background thread "ubi_bgt0d" started, PID 620 [ 25.750000] ALSA device list: [ 25.760000] #0: Module MB7707 [ 25.860000] UBIFS: recovery needed [ 26.940000] UBIFS: recovery deferred [ 26.950000] UBIFS: mounted UBI device 0, volume 0, name "rootfs", R/O mode [ 26.960000] UBIFS: LEB size: 126976 bytes (124 KiB), min./max. I/O unit sizes: 2048 bytes/2048 bytes [ 26.970000] UBIFS: FS size: 1013395456 bytes (966 MiB, 7981 LEBs), journal size 9023488 bytes (8 MiB, 72 LEBs) [ 26.980000] UBIFS: reserved for root: 0 bytes (0 KiB) [ 26.990000] UBIFS: media format: w4/r0 (latest is w4/r0), UUID D7B60B07-E5DE-408F-886D-5EACF67535FC, small LPT model [ 27.010000] VFS: Mounted root (ubifs filesystem) readonly on device 0:11. [ 27.020000] devtmpfs: mounted [ 27.030000] Freeing unused kernel memory: 140K (c04b0000 - c04d3000) Mount failed for selinuxfs on /sys/fs/selinux: No such file or directory INIT: version 2.88 booting [info] Using makefile-style concurrent boot in runlevel S. [info] Setting the system clock. head: cannot open '/etc/adjtime' for reading: No such file or directory hwclock: Cannot access the Hardware Clock via any known method. hwclock: Use the --debug option to see the details of our search for an access method. [....] Unable to set System Clock to: Thu Jan 1 00:00:33 UTC 1970 ... (warning). [....] Activating swap...done. [ 33.700000] UBIFS: completing deferred recovery [ 33.830000] UBIFS: background thread "ubifs_bgt0_0" started, PID 870 [ 33.850000] UBIFS: deferred recovery completed [....] Activating lvm and md swap...done. [....] Checking file systems...fsck from util-linux 2.20.1 done. [....] Cleaning up temporary files... /tmp. ok [....] Mounting local filesystems...done. [....] Activating swapfile swap...done. [....] Cleaning up temporary files.... ok [....] Setting kernel variables ...done. [....] Configuring network interfaces...done. [....] Cleaning up temporary files.... ok INIT: Entering runlevel: 2 [info] Using makefile-style concurrent boot in runlevel 2. [....] Starting OpenBSD Secure Shell server: sshd. ok Debian GNU/Linux jessie/sid shadow ttyS0 shadow login: root Password: Last login: Thu Jan 1 00:16:23 UTC 1970 from 192.168.0.1 on pts/0 Linux shadow 3.10.28-shadow1-00032-gb8b1a50 #141 Thu Aug 21 14:23:26 MSK 2014 armv6l The programs included with the Debian GNU/Linux system are free software; the exact distribution terms for each program are described in the individual files in /usr/share/doc/*/copyright. Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent permitted by applicable law. root@shadow:~# uname -a Linux shadow 3.10.28-shadow1-00032-gb8b1a50 #141 Thu Aug 21 14:23:26 MSK 2014 armv6l GNU/Linux root@shadow:~#
æåã«æ³šç®ãããã®ã¯ããEasyNMC DSP Framework©RC Module 2014ããšããè¡ã§ãã 次ã«ããã°ã«ã¯ãèŠã€ãã£ãNMCã³ã¢ã®æ°ãæžã蟌ãŸããŸããããã«åºã¥ããŠããã©ã€ããŒãšãŠãŒãã£ãªãã£ã¯ãNMCã³ã¢ãå€ããªããšããäºå®ã«å¯Ÿå¿ããŠãããšæ³å®ã§ããŸãã ãã®ããŒãã®ããã»ããµã«ã¯NMCã³ã¢ã1ã€ãããããŸããã
次ã®å€ãã®äººã¯ãNMCãLinuxãšå¯Ÿè©±ããæ¹æ³ãç¥ããããšæãã§ãããã 次ã®æ å ±ã¯éçºè ãããã¹ããããŸããã3ã€ã®å²ã蟌ã¿ãARMããNMCã«éãããŸãã ãã¹ã¯äžå¯ã®NMIãHPïŒé«åªå 床ïŒããã³LPïŒäœåªå 床ïŒã HPããã³LPãšã¯éã®æ¹åã«ã ã«ãŒãã«DSPãèµ·åããã«ã¯ãåæãªã»ãããæåºããNMIããã«ããå¿ èŠããããŸãã ããã«ãããNeuroMatrix IPLã³ãŒããèµ·åããŸããæåã®å®è¡åŸãNMCã¯ãã®åæã³ãŒãã§ã¹ãã³ããNMIå²ã蟌ã¿ãåŠçããŸãããã®åæã³ãŒããéããŠãã¢ããªã±ãŒã·ã§ã³ã®åèµ·åãç·šæãããŸãããã¹ãŠãéåžžã«ç°¡åã§ãã
DSPã®æé
èšäºã®ååã¯åžžã«DSPã«ã€ããŠèšåããŠããŸãããä»åºŠã¯DSPã®äœ¿çšæ¹æ³ã詳现ã«æ€èšãããšããæ¥ãŸãããããã䜿çšããã«ã¯ãnmc-utilsããã±ãŒãžãããã2ã€ã®ãŠãŒãã£ãªãã£ãšã©ã€ãã©ãªã§æ§æãããŠããŸãã
- nmctl
- nmrun
- libeasynmcïŒãŠãŒãã£ãªãã£èªäœã䜿çšïŒ
NeuroMatrixã®IPLãœãŒã¹ãäŸãããã³libeasynmc-nmcïŒnmcã§å®è¡ããããã®ã©ã€ãã©ãªã®äžéšïŒããœãŒã¹ããªãŒã§èŠã€ãããŸãããçºæäžã«ãã€ããªã®å¡ã¯èŠã€ãããŸããã§ãã;ããªãŒãœãããŠã§ã¢è²¡å£ã®ç§å¯ãšãŒãžã§ã³ãã¯å¹³åã«ç ãããšãã§ããŸãã
nmctl
ãŠãŒãã£ãªãã£ããå§ããŸããããæåã¯nmctlã§ãã圌女ã¯ããœãŒã¹ã³ãŒãã®èªã¿èŸŒã¿ãéå§ãåæ¢ãã€ãã³ãã®ç£èŠãå²ã蟌ã¿ã®éä¿¡ãªã©ã®æ¹æ³ãç¥ã£ãŠããŸãã
Nmctlãã«ã
root@shadow:~# nmctl --help
nmctl â The EasyNMC control utility
© 2014 RC Module | Andrew 'Necromant' Andrianov <andrew@ncrmnt.org>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
License: LGPLv2
Usage: ./nmctl [options] [actions] â operate on core 0 (default)
./nmctl --core=n [options] â operate on selected core
./nmctl --core=all [options] â operate all cores
Valid options are:
--core=id â Select a core to operate on (--core=all selects all cores)
--list â list available nmc cores in this system and their state
--help â Show this help
--force â Disable internal seatbelts (DANGEROUS!)
--nostdio â Do not auto-attach stdio
--debug â print lots of debugging info (nmctl)
--debug-lib â print lots of debugging info (libeasynmc)
Valid actions are:
--boot â Load initcode and boot a core (all cores)
--reset-stats â Reset driver statistics for core (all cores)
--load=file.abs â Load abs file to core internal memory
--start=file.abs â Load abs file to core internal memory and start it
--irq=[nmi,lp,hp] â Send an interrupt to NMC
--kill â Abort nmc program execution
--mon â Monitor IRQs from NMC
--dump-ldr-regs â Dump init code memory registers
ProTIP(tm): You can supply init code file to use via NMC_STARTUPCODE env var
When no env is set nmctl will search a set of predefined paths
nmctl â The EasyNMC control utility
© 2014 RC Module | Andrew 'Necromant' Andrianov <andrew@ncrmnt.org>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
License: LGPLv2
Usage: ./nmctl [options] [actions] â operate on core 0 (default)
./nmctl --core=n [options] â operate on selected core
./nmctl --core=all [options] â operate all cores
Valid options are:
--core=id â Select a core to operate on (--core=all selects all cores)
--list â list available nmc cores in this system and their state
--help â Show this help
--force â Disable internal seatbelts (DANGEROUS!)
--nostdio â Do not auto-attach stdio
--debug â print lots of debugging info (nmctl)
--debug-lib â print lots of debugging info (libeasynmc)
Valid actions are:
--boot â Load initcode and boot a core (all cores)
--reset-stats â Reset driver statistics for core (all cores)
--load=file.abs â Load abs file to core internal memory
--start=file.abs â Load abs file to core internal memory and start it
--irq=[nmi,lp,hp] â Send an interrupt to NMC
--kill â Abort nmc program execution
--mon â Monitor IRQs from NMC
--dump-ldr-regs â Dump init code memory registers
ProTIP(tm): You can supply init code file to use via NMC_STARTUPCODE env var
When no env is set nmctl will search a set of predefined paths
äž»ãªæ©èœã®1ã€ã§ãããã·ã¹ãã å ã®NMCã³ã¢ã®æ°ã«é¢ããæ å ±ã®åºåïŒ
nmctl --list
root@shadow:~# ./nmctl --list
0. name: K1879-nmc type: nmc3 (cold)
IRQs Recv: HP: 0 LP: 0
IRQs Sent: NMI: 0 HP: 0 LP: 0
0. name: K1879-nmc type: nmc3 (cold)
IRQs Recv: HP: 0 LP: 0
IRQs Sent: NMI: 0 HP: 0 LP: 0
nmrun
次ã«ãnmrunãæ€èšããŸãã
Nmrunãã«ã
root@shadow:~# ./nmrun --help
nmrun â The EasyNMC app runner wrapper
© 2014 RC Module | Andrew 'Necromant' Andrianov <andrew@ncrmnt.org>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
License: LGPLv2
Usage: ./nmrun [options] myapp.abs [arguments] â operate on core 0 (default)
Valid options are:
--help â Show this help
--core=id â Select a core to operate on (Default â use first usused core)
--force â Disable internal seatbelts (DANGEROUS!)
--nostdio â Do not auto-attach stdio
--nosigint â Do not catch SIGINT
--detach â Run app in background (do not attach console)
Debugging options:
--debug â Print lots of debugging info (nmctl)
--debug-lib â Print lots of debugging info (libeasynmc)
nmrun â The EasyNMC app runner wrapper
© 2014 RC Module | Andrew 'Necromant' Andrianov <andrew@ncrmnt.org>
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
License: LGPLv2
Usage: ./nmrun [options] myapp.abs [arguments] â operate on core 0 (default)
Valid options are:
--help â Show this help
--core=id â Select a core to operate on (Default â use first usused core)
--force â Disable internal seatbelts (DANGEROUS!)
--nostdio â Do not auto-attach stdio
--nosigint â Do not catch SIGINT
--detach â Run app in background (do not attach console)
Debugging options:
--debug â Print lots of debugging info (nmctl)
--debug-lib â Print lots of debugging info (libeasynmc)
ããã¯DSPã³ãŒãã®ã©ãããŒã§ããNMCã§.absãã¡ã€ã«ãå®è¡ããŠãNMCã䜿çšãããã¹ãŠã®printfããã®ã©ãããŒã®stdoutã§çºçããstdinã«éä¿¡ãããã¹ãŠãNMCãåä¿¡ããããã«ããŸãããã©ã¡ãŒã¿ãŒã®åãæž¡ãããµããŒããããŠããŸãã.absãã¡ã€ã«ã®åŸã«ãã©ã¡ãŒã¿ãŒããªã¹ããããšããã©ã¡ãŒã¿ãŒã¯åŒæ°argvãšããŠNMCã«æž¡ãããŸããNMCã§å®è¡ãããŠããmainïŒïŒããã®æ»ãå€ã¯nmrunã«æž¡ãããnmrunã¯éåžžã®æ»ãã³ãŒããšããŠã·ã¹ãã ã«æ»ããŸããããã«ãããè€éãªDSPããã°ã©ã ãéåžžã®ã³ãã³ãã©ã€ã³ãŠãŒãã£ãªãã£ã«å³åº§ã«å€ãããDSPã®åå¿è ã§ãåŠçã§ããŸãããšã³ããªã®ãããå€ãå€§å¹ ã«åæžãããå€æŽãç¹å¥ãªåŠçã¯å¿ èŠãããŸããã
æãç°¡åãªäŸãå®è¡ããŠã¿ãŸãããã
root@shadow:~# nmrun /usr/share/examples/easynmc-0.1/arguments.abs hello world Application now started, hit CTRL+C to stop it Hello world! I am the NMC blinking ledz! I have been given 3 arguments Argument 0 is nmrun Argument 1 is hello Argument 2 is world App terminated with result 3, exiting root@shadow:~# echo $? 3
NMCã³ã¢èªäœã¯ãã·ã¹ãã å ã«/ dev / nmc0ioããã³/ dev / nmc0memã®åœ¢åŒã§ååšããŸããããã§ã
- / dev / nmc0mem-NMCã¡ã¢ãªãåãSRAMãã³ã¯-IM1 + IM3ãäžèšã§èª¬æããŸãããcat / dev / nmc0mem> dump.binãå®è¡ããã ãã§ãDSPã¡ã¢ãªãã³ããåé€ã§ããŸãã
- / dev / nmc0io-ä»®æ³ã·ãªã¢ã«ããŒããstdioã®æžã蟌ã¿ãšèªã¿åããå¯èœãpoll/ epollãä»ããéããããã³ã°åœ¢åŒãå«ã
ä»ã®ãã¹ãŠã®æäœ-ioctlã¯ãäž¡æ¹ã®ããã€ã¹ã§åãã§ãããlibeasynmcã«ãã£ãŠäœ¿çšãããŸãã
ãŠãŒãã£ãªãã£èªäœã¯ãã®ã©ã€ãã©ãªã«åºã¥ããŠæ§ç¯ãããŠããããœãŒã¹ã³ãŒããLGPLv2ã§å®å šã«éãããŠããŸããç°¡åã«èª¿ã¹ãŠã¿ããšãå éšã«ã¯ããªãåçŽã§æ確ãªåæAPIãããããšãããããŸããnode.jsã®æ代ã«ãªãåæAPIãå¿ èŠãªã®ã§ããããïŒDSPãã©ã€ããŒã¯ãstdioã ãã§ãªãepoll / selectããµããŒãããNMCããã®ãã¹ãŠã®ã€ãã³ãïŒå²ã蟌ã¿ãNMIãå¥ã®ããã»ã¹ã«ãã£ãŠéä¿¡ããããšããäºå®ïŒãpoll / epollãä»ããŠåä¿¡ã§ããããšãå€æããŸããããããã£ãŠããã®èšè¿°åã¯ããæ°ã«å ¥ãã®libeventãlibuvãªã©ã«ãã£ãŠã¹ãªãããããå¯èœæ§ããããŸãã
ã¢ã¯ã·ã§ã³
次ã«ããããã®ã¢ã¯ãã£ããã£ã掻çšããŠãéçºç°å¢ãå±éããNMCåãã®äœããæ§ç¯ããŠã¿ãŸããããMB77.07ã§ãããŒã«ãã§ãŒã³ãã€ã³ã¹ããŒã«ããRaspbianããã©ãã·ã¥ãããšããŸãã
nmc-utilsããå§ããŸãããã
git clone github.com/RC-MODULE/nmc-utils.git cd nmc-utils
githubã§ã¯ããŒã³ãããã®ãèŠãŠã¿ãŸãããïŒ
- libeasynmcã®ãœãŒã¹ã¯ã«ãŒãã«ãããŸãããã©ã€ãã©ãªã¯éåžžã«åçŽãªã®ã§ãç¹ã«å€ãã¯ãããŸãããNmctlã®ãœãŒã¹ã³ãŒãã¯ããã¹ãŠã®ããªã¢ã³ãã§libeasynmcãæäœããç°¡åãªäŸãšããŠäœ¿çšã§ããŸãã
- libeasynmc-nmcã«ã¯ãNMCãããžã§ã¯ãã«æ¥ç¶ããã©ã€ãã©ãªã®NMCéšåã®ãœãŒã¹ã³ãŒããå«ãŸããŠããŸã
- doc /ã«ã¯ãã©ã€ãã©ãªã®æäœæ¹æ³ãšã³ã³ãã€ã«æ¹æ³ã®è©³çŽ°ãªèª¬æããããŸããåæ段éã§ç¹ã«åœ¹ç«ã€ã®ã¯ãnm *ãŠãŒãã£ãªãã£ã®éçã¢ã»ã³ããªã®å¯èœæ§ã§ãã
- IPLã«ã¯/ NMCããªã³ã«ããåæã³ãŒãã®ãœãŒã¹ã³ãŒãããããŸã
- äŸ/ç°¡åãªäŸããããããããŸã
ã¯ãã¹ã¢ã»ã³ããªã«ã¯ã次ã®éæ³ããããŸãã
GNU_TARGET_NAME=arm-module-linux-gnueabihf make
ãã¹ãŠã®ãŠãŒãã£ãªãã£ïŒnmctlãmnrunïŒãéçã«ã³ã³ãã€ã«ããå¿ èŠãããå ŽåïŒ
GNU_TARGET_NAME=arm-module-linux-gnueabihf make STATIC=y
ããŒããNFSãä»ããŠããŒããããã«ãŒããè¿ãã®ã©ããã«ããå Žåã¯ã次ãå®è¡ããŠããŒãã«ãã¹ãŠãã€ã³ã¹ããŒã«ã§ããŸãã
DESTDIR=/srv/rootfs/mb7707/ make install
ããã«ãå¿ èŠã«å¿ããŠã.debããŒã¹ã®ã·ã¹ãã ã§ãå€æ°ã®debããã±ãŒãžãåéã§ããŸãã
GNU_TARGET_NAME=arm-module-linux-gnueabihf ARCH=armhf make deb
debããã±ãŒãžããã«ããããšãã¯ãã·ã¹ãã ã«dpkg-debãå¿ èŠã§ãããããã±ãŒãžã«å«ãŸããdebã¢ãŒããã¯ãã£ãæå®ããå¿ èŠããããŸãïŒRaspbianã®armhfãDebianã®armelãåºåã§ã¯ããã¡ã€ã«ãååŸããŸãã
- nmc-utils-abs-0.1-armhf.deb-ãµã³ãã«ã®ãã€ããªã¯/usr/share/examples/easynmc-0.1ã«çœ®ãããŸã
- nmc-utils-bin-0.1-armhf.deb-nmctlãnmrunããã³libeasynmc.soã©ã€ãã©ãªèªäœ
- nmc-utils-dev-0.1-armhf.deb-ããããŒãã¡ã€ã«ãpkg-config .pcãã¡ã€ã«ãªã©
- nmc-utils-doc-0.1-armhf.deb-READMEããã³doc /ã®ãã¹ãŠã®å 容
- nmc-utils-ipl-0.1-armhf.deb-IPLã/ usr / share / easynmc-0.1 / ipl /ã«é 眮
ã¢ãžã¥ãŒã«ã®ãã¹ãŠã®ææ°ãã¡ãŒã ãŠã§ã¢ã«ã¯ããã©ã«ãã§ãããã®ããã±ãŒãžããã¹ãŠå«ãŸããŠãããããããããã¹ãŠãæã«å ¥ããå¿ èŠã¯ãããŸããã
圌ã®æåã®NMCããã°ã©ã ã§ã¯ããµãŠã³ããããã£ãŠãNMCã«ãšã³ãŒå¹æããªã¢ã«ã¿ã€ã ã§è¿œå ããäœããããããšã決å®ãããŸããã次ã®ãã€ãã©ã€ã³ã䜿çšã§ããŸãã
arecord | nmrun ./echo.abs | aplay
ã¬ã³ãŒãããã€ã¯ããã®ããŒã¿ãèšé²ããDSPã«çŽæ¥éä¿¡ããŸããDSPã¯ãšã³ãŒãšåºåãµã³ãã«ãåºåã«è¿œå ããããããåçäžã®ãã¬ã€ã«è»¢éããŸãããµãŠã³ãããã£ããã£ããããã«ãå®äŸ¡ãªäžåœè£œUSBãµãŠã³ãã«ãŒãã䜿çšãããäœå¹Žãæ£ã«çœ®ãããŠããŸããããã®äŸã§ã¯ãéåžžã®nmrunã ãã§libeasynmcã䜿çšããå¿ èŠã¯ãããŸããã
ç¶è¡ããåã«ããã®ãããªãœãªã¥ãŒã·ã§ã³ã®ããã©ãŒãã³ã¹ã«ã€ããŠäœãã説æããå¿ èŠããããŸãã stdin / stdoutã¯ãããŒã¿ã亀æããæãç°¡åãªæ¹æ³ã§ãããããã§ãããªãé ãã§ãããããã¯2ã€ã®ãªã³ã°ãããã¡ãŒã䜿çšããŸããåãã€ãã¯æåã«ARMã«ãŒãã«ã«ãã£ãŠãªã³ã°ãããã¡ãŒã«æžã蟌ãŸãã次ã«NMCã³ã¢ã«ãã£ãŠããããå¥ã®ãããã¡ãŒã«èªã¿èŸŒãŸããåŠçãããçµæãå¥ã®ãªã³ã°ãããã¡ãŒã«æžã蟌ãŸããããããARMãåã³ã³ããŒãããå¿ èŠããããŸããæ§ããã«èšã£ãŠãããªã³ã°ãããã¡ãSRAMã¡ã¢ãªã«ããå Žåã§ããããã¯ããã»ã©é«éã§ã¯ãããŸããããããã£ãŠãæ倧ã®ããã©ãŒãã³ã¹ãå¿ èŠãªå Žåã¯ãstdioãšã³ãã³ãã©ã€ã³ãå¿ããŠlibeasynmcã䜿çšããå¿ èŠããããŸãã
NeuroMatrixã®C / C ++ã§éçºããå ŽåãDSPããã»ããµã§äœãæžããããšããªã人ã®å€ããæåçã·ã§ãã¯ã«é¥ããå¯èœæ§ã®ããããã€ãã®æ©èœãèæ ®ããå¿ èŠããããŸãã以äžã¯ãèžãããšãã§ããã¬ãŒãã®ãªã¹ãã§ãã
- ãã€ãã¢ãã¬ã¹æå®ããããŸãããsizeofïŒcharïŒ== 1ãsizeofïŒshortïŒ==1ãNMCã®å Žåã®ãã€ã³ã¿ãŒã¯32ãããã¡ã¢ãªã»ã«ãæããŸãããããã£ãŠãNMC空éã®ã¢ãã¬ã¹ã¯ã2ããããå³ã«ã·ããããããšã§ååŸã§ããŸãã
- åã®æ®µèœããããã¹ãŠã®ASCIIã¯ãå¿ èŠãªåæåã®äžäœãã€ããäžäœãŒãã®uint32_t []ã®é åã§ãã
- nmrunã¯ããã©ã«ãã§ãstdinãšstdoutã®æååãååŸã«åãã©ãŒããããããããã©ã€ããŒã«æ瀺ããŸãïŒç¡å¹ã«ã§ããŸãïŒ
- NMCã«ã¯MMUããªããç©çã¡ã¢ãªãã¢ãã¬ã¹æå®ããŸãããããã£ãŠãã¢ããªã±ãŒã·ã§ã³ããã®ããŒã¿ãå«ããããã¡ãŒã«ãã€ã³ã¿ãŒãæž¡ãããšã¯ã§ããŸãã
- NMC - , Linux. , - ,
- ( , ) NMC. API nc_int_soc.h
- NeuroMatrix ,
- , , NMC, . /dev/nmc . Samsung /dev/exynos-mem
- NeuroMatrix RISC . , C, RISC , . DSP . , . ,
Cã§ãšã³ãŒãè¡ããŸããç°¡åã«ããããã«ãåãã©ãŒããããæå¹ã«ããŠãµã³ãã«ãããããNMC 8ãããã«ç§»åããDSPã§32ãããæ°ã®åœ¢åŒã§ååŸããŸãã
hello worldãããžã§ã¯ãã®äŸãåãäžãããã®å 容ãèŠãŠã¿ãŸãããã
- ã¡ã€ã¯ãã¡ã€ã«-ã¡ã€ã³ã®ã¡ã€ã¯ãã¡ã€ã«
- colorizer.mk-Makefileã«å«ãŸããŠããŸããåºåã®è²ä»ãå šäœãããã«ãããŸããã«ã©ãŒãªã³ã°ã¯Windows / Linux / Macåãã«ç§»æ€å¯èœã«å®è£ ãããŠãããããéåžžã«ããããŒã«èŠããŸããWindowsã§ã¯ãcechoã䜿çšããŸã
- easyconf.asm-io / argsæ§æã®ã¢ã»ã³ããªãã¡ã€ã«ãargc / argvã®é åã®ãµã€ãºãšstdioã®ãªã³ã°ãããã¡ã®ãµã€ãºãæå®ãããã¯ããããã€ãå«ãŸããŠããŸãã
- K1879.cfg-ãªã³ã«ã®æ§æãã¡ã€ã«ïŒä»¥äžã«ã€ããŠïŒ
- main.c-å®éã«ã¯mainïŒïŒãå«ããã¡ã€ã«
Makefile. - . , â EASYNMC_DIR, libeasynmc-nmc NMC libeasynmc. - , libs.
Makefile
# # This is a basic Makefile template for a Neuromatrix DSP project # to be run on Module MB77.07. To compile it you need: # * Latest NMSDK installed with utilities in your $PATH # * NEURO environment variable pointing to NMSDK directory # * Host GCC (Since nmcpp doesn't support generating deps, # we use gcc for that) # # For verbose build run 'make VERBOSE=y' # -include colorizer.mk -include *.dep .SUFFIXES: OBJECTS := \ main.o \ easyconf.o TARGET=helloworld # Set this to libeasynmc-nmc dir. Relative or absolute. # Make sure you build it prior to building the actual project. EASYNMC_DIR = ../../libeasynmc-nmc CROSS_COMPILE = NMCPP_FLAGS = -DNEURO -OPT2 -inline -I$(EASYNMC_DIR)/include ASM_FLAGS = -soc -Sc -Stmp -Xq -I$(EASYNMC_DIR)/include C2ASM_FLAGS = -soc -q #BIG FAT WARNING: easynmc.lib MUST go BEFORE libc #BIG FAT WARNING: Otherwise argc/argv won't work LIBS = easynmc.lib libc05.lib BUILDER_FLAGS = -cK1879.cfg -m -heap=0 -heap1=0 -heap2=0 -heap3=0 -stack=20000 \ -full_names IDIRS = -I. -I"$(NEURO)/include" LIBDIR = -l"$(NEURO)/lib" -l"$(EASYNMC_DIR)" .DEFAULT_GOAL=all all: $(TARGET).abs %.asmx: %.cpp $(SILENT_DEP)gcc -E -MM $(<) -o$(@).dep $(SILENT_NMCPP)$(CROSS_COMPILE)nmcpp -Tp $(NMCPP_FLAGS) $(<) -O$(@) $(IDIRS) %.asmx: %.c $(SILENT_DEP)gcc -E -MM $(<) -o$(@).dep $(SILENT_NMCPP)$(CROSS_COMPILE)nmcpp -Tc99 $(NMCPP_FLAGS) $(<) -O$(@) $(IDIRS) %.o: %.asmx $(SILENT_ASM)$(CROSS_COMPILE)asm $(C2ASM_FLAGS) $(<) -o$(@) %.o: %.asm $(SILENT_DEP)gcc -E -MM -xassembler-with-cpp $(<) -o$(@).dep $(SILENT_ASM)$(CROSS_COMPILE)nmcc $(ASM_FLAGS) $(<) -o$(@) $(TARGET).lib: $(OBJECTS) -$(SILENT_LIBRARIAN)$(CROSS_COMPILE)libr -c $(@) $(^) > /dev/null $(TARGET).abs: $(OBJECTS) -$(SILENT_LINKER)$(CROSS_COMPILE)linker $(BUILDER_FLAGS) -o$(@) $(^) $(LIBS) $(LIBDIR) $(TARGET).dump: $(TARGET).abs -$(SILENT_NMDUMP)$(CROSS_COMPILE)nmdump -f $(^) > $(@) run: $(TARGET).abs edcltool -f run_nmc_code.edcl -i eth1 clean: -$(SILENT_CLEAN)rm -f *.asmx; rm -f *.o; rm -f $(TARGET).abs $(TARGET).dump *.dep \ *.ac *.map *~ *.abs *.lib
easynmc.lib â stdin/stdout, argc/argv , , C.
â mb7707brd.cfg, NeuroMatrix , gcc LD . . :
.cfg
MEMORY { //-------------- NMC --------------------------------------- LOADERMEM: at 0x00000000, len = 0x00000200; IM1: at 0x00000200, len = 0x0000fe00; IM3: at 0x00010000, len = 0x00010000; //------------- ARM ---------------------------------------- INTERNAL_MEMORY0: at 0x00040000, len = 0x00010000; // 256K-IM0 ARM (ARM:0x00100000 0x0013ffff 0x4000(256kB)) INTERNAL_MEMORY2: at 0x20040000, len = 0x00010000; // 256K-IM2 ARM (ARM:0x80100000 0x8013ffff 0x4000(256kB)) //------------- DDR ---------------------------------------- EXTERNAL_MEMORY0: at 0x10000000, len = 0x10000000; // 16MB-EM0-DDR (ARM:0x40000000 0x7fffffff) EXTERNAL_MEMORY1: at 0x30000000, len = 0x10000000; // 16MB-EM1-DDR (ARM:0xc0000000 0xffffffff) } SEGMENTS { code : in IM3; data : in IM1; } SECTIONS { .text : in code; .init : in code; .fini : in code; .data : in code; .bss : in code; .stack : in code; .heap : in code; .heap1 : in code; .heap2 : in code; .heap3 : in code; }
ã¡ã¢ãªããããšããã°ãhttpïŒ//www.module.ru/mb7707/doc/K1879-memory-map.pdf ã§ååŸã§ããŸãã
ãã«ãã³ãã³ãããã«ããããåŸãåºåã¯2ã€ã®ãã¡ã€ã«hello.absãšhello.dumpãçæããŸãã absãã¡ã€ã«ã¯ãNMCã¢ãã¬ã¹ç©ºéã«çµ¶å¯Ÿã¢ãã¬ã¹ãæã€ELFã§ããããŒãäžã®Linuxããäœæ¥ããå ŽåãIM1ãŸãã¯IM3ãã³ã¯ã«ããŒãã§ããŸããããã¯ãLinuxã«ãŒãã«ãæ®ãã®ãã¹ãŠã®ã¡ã¢ãªãæ åœããããã§ããäžæ¹ãedclã䜿çšãããšãã«ãŒã«ãç°¡åã«ãªããã¢ãã¬ã¹ç©ºéå šäœã«ã»ã¯ã·ã§ã³ãé 眮ã§ããŸããã³ãã¯ãNMCã§ã¢ã»ã³ãã©ãŒãç¥ã£ãŠãã人ã«åœ¹ç«ã€ãããããªãéã¢ã»ã³ãã«ããããªã¹ãã§ãã
次ã«ã1ã€ã®ã¢ã»ã³ãã©ãã¡ã€ã«ããããžã§ã¯ãã«æ¥ç¶ãããŸã-easyconf.asmãããã®ã¢ã»ã³ãã©ã¯éåžžã«æŽç·ŽãããŠããããã¯ãããã®ä»ã®äººçã®åã³ããããŸããeasyconfã«ã¯ãstdioãšåŒæ°ã®èšå®ããããŸããããã¯ãæåéã2ã€ã®ãã¯ãã«ãã£ãŠè¡ãããŸãã
.asm
import from "easynmc/easynmc.mlb"; /* Declare 2 circular buffers for stdio */ const EASYNMC_IOBUFLEN = 128; EASYNMC_CBUF(".easynmc_stdin", _easynmc_stdin_hdr, _easynmc_stdin_data, EASYNMC_IOBUFLEN); EASYNMC_CBUF(".easynmc_stdout", _easynmc_stdout_hdr, _easynmc_stdout_data, EASYNMC_IOBUFLEN); /* Reserve 128 32-bit words for arguments */ EASYNMC_ARGS(128);
ãã®ã³ãŒãã¯ãåŒæ°ãšãªã³ã°ãããã¡çšã«absãã¡ã€ã«å ã®å ŽæãäºçŽããŸãã128ãã€ããstdioãšåŒæ°ã«åºåãããããšãããããŸãããã®ããã°ã©ã ã®èµ·åæã«nmrunã128æåãè¶ ããåŒæ°ãæž¡ããšãnmrunã¯ãšã©ãŒãã¹ããŒããŸãã
æåŸã«ãéåžžã«ã·ã³ãã«ã«èŠããmain.cãæ€èšããŸãã
main.c
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <easynmc/easynmc.h> int main(int argc, char** argv) { printf("Hello world from NeuroMatrix! I am the NMC printf'ing to you!\n"); return 0; }
ããã¯æšæºçãªHello Worldãããžã§ã¯ãã§ããããä»åºŠã¯ã¿ã¹ã¯ã«åãããŠå€æŽããŸãã次ã®ããã«é²ããŸããçŽ1600ãµã³ãã«ã®ãµã³ããªã³ã°åšæ³¢æ°ã§ãé 延ãããã¡ãŒã®ãµã€ãºãçŽ200msã®ã©ããã«æå®ããŸãã2ã®çŽ¯ä¹ã®æãè¿ãå€ã«åãäžããŠ2048ãååŸããŸããæµ®åå°æ°ç¹ã®NMCã¯ãããã匷åã§ã¯ãªãããïŒã³ã³ãã€ã©ã¯æµ®åå°æ°ç¹æ°ãæ¶è²»ããŸããïŒãæŽæ°ã§ãã¹ãŠãå®è¡ããæžè¡°ããããã·ããããŸãã
ããªãã¯ãã®ç²Ÿç¥ã§äœããåŸãŸãïŒ
main.c
#include <math.h> #include <stdio.h> #include <stdlib.h> #include <string.h> #include <easynmc/easynmc.h> #define SIZE 2048 static unsigned int delaybuf[SIZE]; static unsigned int pos; int main() { while(1) { unsigned int in = getc(); unsigned int out = in + (delaybuf[pos] >> 2); if (out >255) out = 255; delaybuf[pos++] = in; pos &= (SIZE -1); putc(out); } }
çµã¿ç«ãŠãabsãããŒãã«ã³ããŒããŸããããã©ã«ãã§ã¯ãããŒãã«ã¯1ã€ã®ALSAããã€ã¹ïŒHDMIïŒãããããŸãããUSBãµãŠã³ãã«ãŒãããã®åºå/å ¥åã䜿çšããŸããALSAã§ãã®ååãå¿ èŠã§ããããã¯éåžžã«ç°¡åã«è¡ããã-Lã䜿çšããŠèšé²ãŸãã¯åçããŸããçµæã¯æ¬¡ã®ããã«ãªããŸãã
arecord -D default:CARD=Device | nmrun echo.abs | aplay -D default:CARD=Device
ãã€ã¯ãšããããã©ã³ãæ¥ç¶ããŠæ¥œããã§ãåœå ã®DSPããã»ããµã®æåã®ã¢ããªã±ãŒã·ã§ã³ãäœæããŸããã
ãããã«
ãããããããä»æ¥ã®ãã¹ãŠã§ããçµè«ãåºãããã«æ®ã£ãŠããŸãããã¡ãããããªã匱ãARMã«ç®ãåãããšãMB77.07ã¯è¯å®çãªå°è±¡ãæ®ããŸããäžè¬çãªé·æãšçæããªã¹ãããŸãã
+ããŒãããŒããŒããDSPããã»ããµã®IPLã³ãŒããŸã§ãå¯èœãªãã¹ãŠã®å ¬åŒãªãªãŒãã³ãœãŒã¹ããããã¡ãŒã«ãŒã®githubã§ãä»ã®ã¡ãŒã«ãŒã®äžã§ããããã¯Freescaleããã³QualcommïŒCode AuroraïŒã§ã®ã¿å¯èœã§ããéåžžããã¹ãŠã¯ããããftpã§rar tar'ovã«è©°ã蟌ãŸãããµãŒããŒã®åœ¢ã§GPLãœãŒã¹ããããã®åœ¢ã§ãã³ããããŸãããããã¯ç¹å¥ãªåã³ã§ããããã§ãã巚倧ãªãã©ã«ããŒãš.gitã€ã³ããã¯ã¹ã䜿çšããŠãã¹ãŠãç Žæ£ããŸãã
+ DSPã«ãŒãã«ãã³ã³ãã€ã©ãŒãããã³ããŒã«ããããæåã¯ãåå¿è ã«ãšã£ãŠã¯éåžžã«ç°¡åã«äœæ¥ã§ããããã«èæ¡ãããŸãããæåã¯ãKïŒR察è§ç·ã§èªãã ãã§ååã§ããç¹ã«ããã®æ§æã®NMCã¯ã¿ããªãªã¢ã«ã¿ã€ã ãç°¡åã«æäŸã§ããããšãèæ ®ããŠãã ãããããããå·¥åŠãå·¥äœæ©æ¢°ã«ãšã£ãŠã¯ãããã¯å€©ã®æµã¿ã§ãã
+ãã©ã€ããŒã AllwinnerïŒlibnandïŒãRockchipïŒrk_fbãrknandïŒãMediatekïŒäžè¬çã«ã¯ãã¹ãŠïŒãªã©ã®çæ³çãªããããççŽãªææââã«æ°ã¥ããããã§ã¯ãããŸãããã©ãã§ããæšæºã®ã«ãŒãã«ãµãã·ã¹ãã ã䜿çšããããšããŸããã³ãã¥ããã£ãéçºè ã®èŠæãããå Žåããããã®ã»ãšãã©ã¯ç°¡åã«ã¡ã€ã³ã©ã€ã³ã«åå ã§ããŸããã³ã¢ã«ã¯ç¬èªã®ãããã¯ãããŸããã
+ã«ãŒãã«ããŒãžã§ã³ãçŸåšã3.10 LTSããããç§ã«ãéçºè ã¯æ¬¡ã®LTSã«ã€ããŠèããããšã«ããŸãããæ¯èŒã®ããã«ãlinux-sunxiã³ãã¥ããã£ã®ã«ãŒãã«ã¯3.4ã§ãããã¢ããã¹ããªãŒã ã«ã¯ã»ãšãã©ãã«ãã¡ãã£ã¢ããããŸããã Rockchipã¯ãéåžžã«å€§ããªããã¿é³ã§rk3288ã®ã¿ã察象ã«3.10.xãçµãåºããŸããã人æ°ã®rk3188ã§ãã®ããžãã¹ãéå§ããããšããŠã倱æããŸãã-MMCã³ã³ãããŒã©ãŒã¯åäœããŸããã HardKernel ODROIDã¯3.8.y linux-stable + ubuntu mergeã«ãããŸãããã¡ã€ã³ã©ã€ã³ã§ã®ãµããŒããžã®åãããããŸãã
+äžæ» ã NANDããã³ããç©ççã«æ®ºããŠããMB77.07ã¯åŸ©æŽ»ããEDCLçµç±ã§ããŠã³ããŒãã§ããŸãããããã£ãŠããã®ãããªããŒãã¯ããã¢ã¡ã¿ã«ã§ããŒãããŒããŒããªãã¬ãŒãã£ã³ã°ã·ã¹ãã ãªã©ãæã¡äžããæ¹æ³ãåŠç¿ãããåå¿è ã«åœ¹ç«ã¡ãŸããããªãã¯ããŒãã殺ãããšãæããããšã¯ã§ããŸããã RK3188ã®ãããªãžã£ã ã®å Žåãããã§ããŒãããŒããŒããã©ãã·ã¥ããããã«NANDã¬ãã°ãçãããå¿ èŠã¯ãããŸããã
+ debããã±ãŒãžããªããžããªãªã©ãã³ãã¥ããã£ã®ç»å ŽãåŸ ããã«å€ãã®ããšãè¡ãããŸãããããŸã å€ãã®ããšãè¡ãããŠããŸãã
+èå³æ·±ãããšã«ãçåŽã®ãã¹ãŠã®ã³ãã¯ã¿ã¯r-piãããã¯ããã«äŸ¿å©ã§ãã
-äŸ¡æ Œããã®äºå®ã¯ããã¡ãããã©ãºããªãŒãå°ç¡ãã«ããŸãïŒããããæå³ïŒ
-RTCãªããå€ãã®ãããžã§ã¯ãã§ã¯ãããã¯éèŠã§ã¯ãªããããããŸããããå¿ èŠãããããŸãããããã«ãã·ã¹ãã ã¯æåã«ntpãäžããå¿ èŠããããŸãã
-ããã©ãŒãã³ã¹ãã¯ãã324MHz ARM1176ã¯ç¹ã«æ¥œãããã®ã§ã¯ãããŸãããããã¯ãARMãšNMCã®äž¡æ¹ããªã³ãããã¡ã¢ãªââããã³ãŒããå®è¡ã§ãããšããäºå®ã«ãã£ãŠéšåçã«è£åãããŠããŸããåŸã§ãã£ãšé¢çœããªããã¢ãžã¥ãŒã«ãOpenSourceãçµäºããã次ã®ãããžã§ã¯ããæ¢ã«çç£çãªãœãªã¥ãŒã·ã§ã³ã§è¡ãããããšãæåŸ ããŸãããã
-泚æã®è€éããçŽç²ã«å©äŸ¿æ§ã®åé¡ããã§ã«ããããšã³ãžãã¢ãããããŒã±ãã£ã³ã°ã®æ¹ãåé¡ã§ããå¯èœæ§ãé«ãã§ããã¢ãžã¥ãŒã«ã®ãŠã§ããµã€ãã«ã¯ãåå²ç»é¢ã«å·šå€§ãªå€ªããã¿ã³ãè³Œå ¥ããšqiwiã«ããå³ææ¯æãããããŸããã
åç §è³æ
- githubã®ç§åŠæè¡ã»ã³ã¿ãŒãã¢ãžã¥ãŒã«ãCJSCã®å ¬åŒã¢ã«ãŠã³ãïŒgithub.com/RC-MODULE
- ã®è£œåããŒãžããŠã§ããµã€ãïŒwww.module.ru/catalog/micro/micro_pc
- . : www.module.ru/catalog/micro/mikroshema_dekodera_cifrovogo_televizionnogo_signala_sbis_k1879hb1ya
- «»: www.module.ru/mb7707
- Github ierton mboot: github.com/ierton
- barebox ( ): github.com/frantony/barebox/tree/next.mb7707.20140416