æšå¹Žã®çµããã«ããã§ã«ããã©ãŒã¯ããšããã©ãã«ãååŸããã¯ãã ä»ãã¹ããŒã·ã§ã³ãè³Œå ¥ããŸããã ãã®å©ç¹ïŒäŸ¿å©ãªT12ãããã«ãŒããªããžããŸãšããªé»åïŒçè«çã«ã¯æ倧72WïŒãé«éå ç±ïŒç§åäœïŒãäœäŸ¡æ Œã ïŒãã®ã·ãã¯ãªã¬ãã¥ãŒã§é§ ã«æ £ããããšãã§ããŸã ïŒ
ææ°ããŒãžã§ã³ã®ããŒããŠã§ã¢2.1ãè³Œå ¥ããŸãããããã¡ãŒã ãŠã§ã¢ãå€ãããšãç¥ã£ãŠå°ãæ°ãå転ããŸããã ãã¡ããã圌ã®æã¯combãããŠæŽæ°ãããŸããã ã¯ãã ä»ãã¹ããŒã·ã§ã³ã®ãå¿èéšããSTM32F103C8ïŒSTMicroelectronics補ã®äººæ°ã®ARM Cortex-M3ãã€ã¯ãããã»ããµïŒã§ããããšãç¥ã£ãŠãã-æãäžããã®ããã£ãšé¢çœãã£ã STM32F4Discoveryã®LEDãäžåºŠç¹æ» ãããŸããã
ãã®åŸãSWDã€ã³ã¿ãŒãã§ãŒã¹ã®4æ¬ã®ã¯ã€ã€ãŒãã¯ãã ä»ããããããã°ã©ããŒãæ¥ç¶ããããã¡ãŒã ãŠã§ã¢ãã¢ããããŒããããŸããã
ãããŠ...ã¹ããŒã·ã§ã³ã¯ã¢ã¯ãã£ããŒã·ã§ã³ãèŠæ±ããŸããïŒ
ããããããããããã«ããã®ã¹ããŒã·ã§ã³ã®éçºè ã«ã€ããŠããã€ãã®èšèã話ããŸãã ãã¹ãŠã®æ å ±ã¯ã€ã³ã¿ãŒãããããååŸãããŸãïŒäžéšã¯ãã¡ãŒã ãŠã§ã¢èªäœããååŸãããŸãïŒã éãšãã¡ãŒã ãŠã§ã¢ã¯ã2014幎é ã«äžåœã®ç¹å®ã®å人ZhongGuoxinïŒ38827251@qq.comïŒã«ãã£ãŠéçºãããŸããã ããã€ãã®äžåœã®ãã©ãŒã©ã ã®éå ¬éã°ã«ãŒãã§æŽ»çºã«éçºãè¡ãããŠããŸããã 圌ã®ãã«ã³ããªãŒãã³ãã«ããã¯ããŒã³åããéçºãä¿è·ããè©Šã¿ã®ç¡çããèªèããŠããããã«ã圌ã¯ãã¡ãŒã ãŠã§ã¢ã§ä¿è·ãè¡ããŸããã ãã¡ãŒã ãŠã§ã¢ã¯ãã€ããªã¢ãžã¥ãŒã«ã®åœ¢åŒã§é åžãããã ãã§ããããã¯ãã ä»ãããã°ããã®ã¯ããŒã³ã§åããããšãã§ããŸããã
ãªãããã§ããïŒ çµå±ãæ¢ã«ãã©ãã·ã¥ãããMKãé åžããæå·åãããBLOBã§æŽæ°ãããã¯ããã«ä¿¡é Œæ§ã®é«ãã¹ããŒã ããããŸãã ç¥ããŸãã ã©ãããæéãå©äŸ¿æ§ã人æ°ãšåå ¥ã®éã®åŸ®åŠãªãã©ã³ã¹ã èµ·åæã«ããã¡ãŒã ãŠã§ã¢ã¯ã³ãŒãID1ãšID2ãçæããäœæè ã¯ã9å ïŒã80ã«ãŒãã«ïŒã®è±¡åŸŽçãªéã®ã¢ã¯ãã£ããŒã·ã§ã³ããŒRG1ãšRG2ãšäº€æããŸãã
ããããæ»æè ãã¢ã¯ã»ã¹ã§ããå Žåãã©ãããã°ãã¡ãŒã ãŠã§ã¢ãä¿è·ã§ããŸããïŒ ä»ãç§ãã¡ã¯èŠã€ããŸãã
æ®å¿µãªãããããã€ã¹ã§ã¢ã¯ãã£ããŒã·ã§ã³ã³ãŒããæ£çŽã«è³Œå ¥ããããšã¯ã§ããŸããã§ããã ä»åŸããããã®ã³ãŒãã¯ãæŽæ°ã«å ããŠããã€ã¯ãããã»ããµïŒèãç«å·ããå ŽåïŒãŸãã¯EEPROMã亀æããããšã§åã¯ãã ä»ãã§ããŸãã ãããŠããã®ãããªã±ãŒã¹ã¯ãã§ã«ç¹°ãè¿ãçºçããŠããŸãã
ãªããªã ç§ã¯èªåã®ã³ããŒãæ£åœã«ææãããã®åŸã¢ãŒãã«å®å šã«åŸã£ãŠããŸãã ãã·ã¢é£éŠæ°æ³å ž1280幎ããããã°ã©ã ã®æ©èœã«å¿ èŠãªè¡åãå®è¡ã§ããã
æåã®ãã³ã±ãŒãã¯ãŽããŽãããŠãã
ãã¡ãŒã ãŠã§ã¢ãIDAã«ããŠã³ããŒããããŸããã ã¢ã¯ãã£ããŒã·ã§ã³ã³ãŒããå ¥åãããå Žæãéåžžã«ãã°ããèŠã€ããŸããã ç§ãæ£ããè»éã«ä¹ã£ãŠããããšã確èªããããã«ãDisplayStringãšããé¢æ°ã®åŒæ°ã«ããããé©çšããŸããã ããããåœãŠãããŒãžã§ã³ãåããŸããã å§ãŸããªãïŒ
ãŸããããã¯å€§äžå€«ã§ããç§ã¯ããããæ©èœã®ç®çã誀解ããŸããã å€æŽãããŒã«ããã¯ããŸãã 衚瀺ãããããã¹ãã«ããããé©çšããŸãã å§ãŸããªãïŒ
ããã æŽåæ§ãã§ãã¯ããããŸãã ãããã¬ãå¿ èŠã§ãã ãããŠãããŒããŠã§ã¢ãã¬ãŒã¯ãã€ã³ãã§åœŒå¥³ããã£ããããŸãïŒ ãããã¬ãŒãšããŠããã€ãã®ãªãã·ã§ã³ãåé¡ããIDA gdb + OpenOCDã®æã«æ±ºããŸããã IDAãããã¬ãŒèªäœã¯äžäŸ¿ã§ãã°ããããŸããããããã¬ãŒã§çŽæ¥disasmãã€ã³ã¿ã©ã¯ãã£ãã«ç·šéããæ©èœã¯ããããã¬ãŒãäžåããŸããã
OpenOCDãèµ·åããå€æŽãããã³ãŒãã®ãã€ããèªã¿åãããã«ãŠã©ãããã€ã³ããèšå®ããŸãã ç§ã¯ãããå§ããŠããŸãã ãŠã©ãããã€ã³ããæ©èœããªã...ã©ãããŠïŒ çµå±ãå®å šãªæŽåæ§ãã§ãã¯ãååšããŸãïŒ
ãããŠãããã§ç§ã¯æ¬åœã«èå³ããããŸãã
ããŒã¿ã調æ»ããŸã
ãã¡ãŒã ãŠã§ã¢ã®ãã«ãµã€ãºã¯75,512ãã€ãã§ãã ããã¯ããªããããããããŸãã ããŒã¿ã®ã³ãŒãã¯ãã§ã«IDAã«ãã£ãŠåé¢ãããŠããŸãã ARM Thumbã®æ©èœã§ãããé¢æ°éã®ã³ãŒãã«ããããŒã«ã«ããŒã¿ã®å°ããªã¹ããããé€ãã48128ãã€ãã®ã³ãŒããš27384ãã€ãã®ããŒã¿ãå€æããŸããã
ããã§ããã®ããŒã¿ã®æå³ãç解ããŠãããšããã§ãããã
æãåçŽãªã®ã¯ããã¹ãããŒã¿ã§ãã ã¡ãã¥ãŒé ç®ã®ååããã³ããèäœæš©ã 圌ãã¯6kb以äžã§ããããšãå€æããŸããã ã¡ãã¥ãŒããã¹ãã®äžã«ãFLASHã»ã°ã¡ã³ãã®32ãããã¢ãã¬ã¹ã«éåžžã«é¡äŒŒãããã€ããèŠã€ãããŸããã ãããã®ã¢ãã¬ã¹ã«ã¯ã以åã«èŠã€ãã£ãDisplayStringãžã®åŒã³åºããå«ã倧éã®ã«ãŒãã³ããããŸããã ãããã£ãŠããããã¯ã¡ãã¥ãŒé ç®ãã³ãã©ãŒã§ãã é©åãªéââã®ã³ãŒããèªèãããŸãã
ç¶ããŸãã ã¹ããŒã·ã§ã³ç»é¢ã¯ã¢ãã¯ãã§ãããããã°ã©ãã£ãã¯ããŒã¿ã¯ãããïŒã¢ãã¯ãïŒåœ¢åŒã§è¡šç€ºããããšæ³å®ããã®ãè«ççã§ãã ZX-Spectrumã®åäŸæ代ãæãåºããŠ-åã«ãã€ãã衚瀺ããããšã決å®ãããŸããã90幎代ã«ã²ãŒã ã§ã°ã©ãã£ãã¯ãæ¢ããŠããŸããããããŒã¿ãã³ãŒããšã¯èããç°ãªããŸããã
Viewbinã¯pythonã§æžãããŠããŸãã 䟿å®äžã256ãã€ãã®åãããã¯ã¯é£æ¥ãããããã¯ããåé¢ãããŠããŸãã åèšã§ãæ£ç¢ºã«1ãããã€ãïŒ4ãããã¯ïŒã1åã«åçŽã«é 眮ãããŸãã 次ã®åã¯ã次ã®ãããã€ããæããŸãã
ã°ã©ãã£ãã¯ã®æ³¢ç·ãå³åŽã«ã¯ã£ãããšèŠããŸãã ããããåçã§ã¯åœŒãã¯ã²ã©ãåç®ããŸãã ãããŠãé ãå³ã«åŸãããšïŒ æåã«ããã©ã³ã8 * 16ïŒx * yïŒã«æ°ä»ãããšãã§ããŸããæåã®8ãã€ãã¯æåã®äžååã圢æãã2çªç®ã¯ãã®äžååã圢æããŸãã
æ®ãã®ãã£ã©ã¯ã¿ãŒã¯åãåçã§æ§ç¯ãããŠããŸãã 倧ããªãã©ã³ããµã€ãºã¯16 * 32ã象圢æåã®ã°ãªãã¯16 * 16
ããã«ãããã«ããã€ãã®ãµãŒãã¹ã·ã³ãã«ïŒææ°ã¢ã€ã³ã³ã枩床èšãç¢å°ããã§ãã¯ããã¯ã¹ïŒããããŸãã åèšã§çŽ16 kbãã°ã©ãã£ãã¯ã§å ããããŠããŸãã
27 kbã®ããŒã¿ã®ãã¡ã22 kbãããã«èªèãããŸããã æªããªãã
ã³ãŒãã«ç§»ããŸããã-48ãããã€ãã®ã¿ã€ããªTHUMBã³ãŒãã ãšãŠãã³ã³ãã¯ãã§ãã ããšãã°ãé »ç¹ã«çºçããæäœv1ïŒïŒãv2ïŒã¯ã1ã€ã®ãBTCãåœä»€ã§ãã
ARM Cortex M3ãšã¯äœã§ããïŒ
MKã«ã¯ãARMã³ã¢ã«å ããŠãå€æ°ã®åšèŸºã¢ãžã¥ãŒã«ãå«ãŸããŠããŸãã ãã®ãã¹ãŠã®çµæžã¯ãã¡ã¢ãªã«ããããããã¬ãžã¹ã¿ã«ãã£ãŠå¶åŸ¡ãããŸãã ãããã®ã¬ãžã¹ã¿ã¯æ°åãããŸãã ãããã¯æ©èœå±æ§ã«åŸã£ãŠã°ã«ãŒãåãããåã°ã«ãŒãã¯æŽåãããŸãã
ãã©ã¹ãããã BitBanding- ã¯ãŒã ïŒ32ãããïŒãžã®ã¢ã¯ã»ã¹ã¯ãåäžãããã®ã¢ãããã¯ã€ã³ã¹ããŒã«ãŸãã¯ãªã»ãããæå³ããŸã ã 1ã€ã®32ãããã¬ãžã¹ã¿ãBitBandé åã§128ãã€ããå æãããšæšå®ããã®ã¯ç°¡åã§ãã åèšã¬ãžã¹ã¿ã¯ãå®å šã«çã£ãéã®ã¢ãã¬ã¹ç©ºéãå æããŸãã
åšèŸºæ©åšã®æäœã¯ããããã®ã¬ãžã¹ã¿ã®æžã蟌ã¿ãŸãã¯èªã¿åãã§ãã ARMã®CMSISã©ã€ãã©ãªã¯ãSIã³ãŒãã®èãå±€ãåãã裞ã®ã¬ãžã¹ã¿ãšãåšèŸºæ©åšã®è£œé å ïŒãã®å Žåã¯STM32F10x_StdPeriph_DriverïŒã®ä»å±ã©ã€ãã©ãªãã«ããŒããŠããŸãã
Cã³ãŒããããåšèŸºæ©åšã®æäœã¯ãåšèŸºæ©åšã®ååä»ãã¬ãžã¹ã¿ãå€æŽããããã«èŠããŸãã
ã¢ã»ã³ãã©ãŒã§ã¯ããã®äœæ¥ã¯ããã€ãã®ã¬ãã«ã®éæ¥ã¢ãã¬ã¹æå®ã®ããã«èŠããŸãã éåžžã®CPUã¬ãžã¹ã¿ã r2ããr1ãååŸããããããå¥ã®r0ãååŸãããªãã»ãã0x0Cã§åã³r0ãååŸããŸããã ãããäœã§ãããã¯å®å šã«äžæã§ãã
ã³ãŒãã調ã¹ã
ç»é²ã³ãŒããå ¥åãããšãããã€ãã®é¢æ°ãåŒã³åºãããŸãã ç»é¢ãã¯ãªã¢ãããŸãã ç¢æã衚瀺ãããŸãïŒäžåœèªã§ïŒïŒã ãã®åŸãããã«ããã€ãã®é¢æ°ãåŒã³åºãããŸãã 2ã€ã®å€ããã§ãã¯ãããŸãã ãããŠãããããã®ã¡ãã»ãŒãžã衚瀺ãããŸãïŒäžåœèªã§ïŒïŒã ãã®åŸãã¹ããŒã·ã§ã³ããã³ã°ããŸãã
ãããã³ãŒããã§ãã¯ã§ãããšä»®å®ããŠãæ¡ä»¶ã眮ãæããŸããã äœãå€ãã£ãŠããŸããã åŒã³åºãããé¢æ°ãšãã®å éšã«ãã¬ãŒã¯ãã€ã³ããèšå®ããŸãã ãããã¯ããŸã£ããç°ãªãåŒæ°ã§å€æ°ã®å ŽæããåŒã³åºãããŸãã
æ確ã§ã¯ãããŸããã æåã«æ»ããŸãã ã§ã¯ããªãWatchPointã®æŽåæ§ç£èŠãæ©èœããªãã®ã§ããïŒ
çç±ã¯DMAïŒDirect Memory AccessïŒã³ã³ãããŒã©ãŒã«ãããšæšæž¬ããŸããã ããã«ãSTM32ã«ã¯ããŒããŠã§ã¢CRCã«ãŠã³ãã¢ãžã¥ãŒã«ããããŸã-ã¿ã¹ã¯ãäžãããšãDMAãä»ããŠã¡ã¢ãªãããã€ããèªã¿åããã¢ãã¬ã¹ãã€ã³ã¯ãªã¡ã³ããããã§ãã¯ãµã ãèªã¿åããŸãã å®è¡ãå®äºãããŸã§åŸ ã£ãŠãã¬ãžã¹ã¿ããçµæãèªã¿åãã ãã§ååã§ãã
ãã ããããªãã§ã©ã«ã®åäœã調æ»ããã«ã¯ããã¹ãŠã®ã¬ãžã¹ã¿ããã®çªå·ã§æ£ç¢ºã«å€æããå¿ èŠããããŸãã æ°åã®ã¬ãžã¹ã¿ãããããã®æ°å€åœ¢åŒã¯ã©ã€ãã©ãªã³ãŒãã®ã¬ã€ã€ãŒã«ãã£ãŠããã°ã©ãããé ãããŠããŸãã éã¢ã»ã³ãã©ã§å®æ°ãèŠã€ããŸãã-ãããã©ã®ãããªã¬ãžã¹ã¿ã§ããããèŠãŠãã ããã ãžã£ã³ãããŒã¿ã·ãŒãã®éã¢ã»ã³ãã©ãŒã¯ããã«éå±ããŸããã ãããŠãIDAçšã®Pythonã¹ã¯ãªããïŒ GitHubãžã®ãªã³ã¯ ïŒãäœæããŸãããããã¯ã倧éã®ã¬ãžã¹ã¿ãŒãçæããŸãã åæã«ãå²ã蟌ã¿ãã¯ã¿ãŒã®ããŒãã«ãå®çŸ©ãããã³ãã©ãŒã«ååãä»ããéå§ç¹ãäœæããSRAMã»ã°ã¡ã³ããäœæããŸãã
å°ãæ確ã«ãªããŸããã
äœæ¥ã®ããžãã¯ã埩å ããã«ã¯ãå°ããªæ©èœããå§ããããšã奜ã¿ãŸãã ãããã¯ç解ãããããæçšãªãã®ããã䜿çšãããŸãã
å€ãã®ãããæŒç®ã䜿çšããé¢æ°ã¯ãããã«ãŒããã©ãŒã¹ãã䜿çšããŠãæµ®åå°æ°ç¹ããšããŠå®çŸ©ãããŸãããåœä»€ãã€ã³ã¿ãŒã¯é¢æ°ã®å é ã«é 眮ãããŸããã æµ®åå°æ°ç¹ã®16é²è¡šèšãã¬ãžã¹ã¿ãŒã«å ¥åãããŸããïŒäŸãã°ãæ°åã100.0ãããã³ã30.0ãïŒã ïŒäŸ¿å©ãªãªã³ã©ã€ã³ã³ã³ããŒã¿ãŒãžã®ãªã³ã¯ïŒã é¢æ°ã®çµæã¯ããããŒãã£ã³ã°ãã¥ãŒã«å€æãããŸãã åºåã«ã70.0ããã3.3333ããªã©ãæå³ã®ãããã®ãããå Žåã¯ãå®å šã«ååãä»ããããšãã§ããŸãã é¢æ°ã®äžéšãfloatã§åäœããäžéšãdoubleã§ããããšãå€æããŸããã
ç§ã¯éåžžã«å¹žéã§ãåšèŸºæ©åšãæ±ãããã«ãèè ã¯æšæºã©ã€ãã©ãªã䜿çšããŸãããSIã³ãŒãã¯éã¢ã»ã³ãã©ãšå®å šã«äžèŽããŸããã
ç§ã¯ããã€ãã®noreturné¢æ°ã«ã€ãŸãããŸããããã®å ¥åã§ã¯ãlrã¯å€0xFFFFFFFFã§ãããŒãŠã§ã€ãã瀺ããã¹ã¿ãã¯ã¯0x12121212ã0x09090909ãªã©ã®å¥åŠãªå®æ°ã§æºããããŠããŸããã Googleã¯ãããFreeRTOSã ãšäž»åŒµããŸããïŒäœïŒïŒ
ãªã¢ã«ã¿ã€ã ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ... A SOLDER-INïŒïŒã
ãããããã€ããªã³ãŒãã¯ãœãŒã¹ãšæ¯èŒã§ããŸããã§ããã 10.0.0ïŒ2018ïŒãã3.2.4ïŒ2005ïŒãŸã§ã®10ããŒãžã§ã³ã確èªããŸããã ã©ãã§ããé¡äŒŒæ§ã¯è¡šé¢çãªãã®ã«ãããŸããã§ããã ãã®ããããã®ãããªé¢æ°ã®ååãTaskXXXXXã«éå®ããããããæž¡ãäžè¬çãªã³ãŒãã¯TaskCreateãšããŠå¶åŸ¡ããŸãã
åšèŸºæ©åšã®æ¢çŽ¢ãŸãã¯ãããã°ã®èªåå
æšæºã©ã€ãã©ãªã®èªèãããŠããé¢æ°ã«ã¯ãDMAInitãDMACmdãDMAGetCurrentDataCounterããããŸããã åé¡ã¯ã圌ããããŸãã«ãé »ç¹ã«åŒã°ããããšã§ããã ãããŠç§ã¯æ ãè ã§ãã
ãã®ãããOpenOCDé¢æ°ãæäœããããã®Python APIãäœæããŸããïŒ GitHubãžã®ãªã³ã¯ ã ã³ãã³ãã¯ãtelnetãããã³ã«ã䜿çšããŠOpenOCDãµãŒããŒã«éä¿¡ãããŸãã ãã£ã¬ã¯ããªãexamples / dbgbotãã§ã®äœ¿çšäŸãšããŠãããããã®ã³ãŒãããããŸããããã«ã€ããŠã¯ä»¥äžã§èª¬æããŸãã
ãã®APIã«åºã¥ããŠãDMAåŒã³åºãã調æ»ãããããããäœæããŸããã ããããã¯ãDMA_Inité¢æ°ã§DMAæäœã®åæåã«å¿çããŸãã ããªãã§ã©ã«ã®ã¢ãã¬ã¹ãã¡ã¢ãªãéä¿¡ã®æ¹åãéä¿¡ãããèŠçŽ ã®æ°ãšãµã€ãºãããã³ãœãŒã¹ãšåä¿¡è ã®ã¢ãã¬ã¹ã®èªåã€ã³ã¯ãªã¡ã³ãã®ãªãã·ã§ã³æ©èœãèšé²ããŸãã
ããããããã«å ããŠãåä¿¡ããããŒã¿ã確èªããããšæããŸããã ããšãã°ãCRCèšç®ãèŠæ±ãããå Žåãããã§æ£ç¢ºã«èšç®ããããã®ãç¥ãããã§ãã ãããè¡ãã«ã¯ãåŒã³åºãã®ãã§ãŒã³å šäœã調ã¹ãŸãïŒInit-> Command "enable"-> Waitã ã€ãŸã ç¶æ ãã·ã³ãå¿ èŠã§ãã ç¶æ éã®äœçœ®ã«å¿ããŠããã¬ãŒã¯ãã€ã³ããåçã«èšå®ããã³åé€ããŸãã
Waitã®å ŽåãããŒããŠã§ã¢ã«ãŠã³ã¿ãŒããªã»ããããããŸã§åŸ ã€å¿ èŠããããŸãã ïŒãŸã å²ã蟌ã¿ä¿¡å·ããããŸãããããã¯ç§ãã¡ã®å Žåã§ã¯ãããŸãããïŒã³ãã³ããå®è¡ãç¶ããŠããéãåŸ ããªããã°ãªããŸããã JTAGãããã°ã¯ããã€ã¯ãããã»ããµã³ã¢ãå®å šã«åæ¢ããŸãã
åé¡ã¯ãèè ãå°éã®ããŒã¿ã®ã³ãã³ããDMAã«äžããå ŽåãåŸ æ©ããããšã«ç ©ããããªãã£ãããšã§ããããšãå€æããŸãããå¿ èŠãªæãŸã§ã«ããããã¯ãã§ã«ãã¹ãŠãè¡ã£ãŠããŸããã ç§ã«ãšã£ãŠããã®æ±ºå®ã¯ã転éã®çµäºã远跡ããããã«DMAGetCurrentDataCounterãåŒã³åºãããšãæãã§ããªãã£ãããšãæå³ããŠããŸããã ãããŠã圌ãããããã®ããŒã¿ã®äœ¿çšãéå§ãããšããç§ãç¥ããŸããã§ãã-ããªããããããåä¿¡ããã®ãé ãããå Žåããããã¯ãã§ã«ã³ãŒãã®æ®ãã«ãã£ãŠç ŽæããŠãããããããŸããã
ãããã£ãŠããã¥ãŒãªã¹ãã£ãã¯ãé©çšããå¿ èŠããããŸããã転éãµã€ãºã32ãã€ããè¶ ããå Žåãæ瀺çãªãã§ãã¯ã䜿çšãããŸãã ãã以å€ã®å Žåã転éã³ãã³ããçºè¡ããåŸãéä¿¡ã®ããã«èŠæ±ããããã€ãæ°ãšåãæ°ã®æ瀺ã«åŸããŸãã
ãããå¯äžã®ãããã¯ãã§ã¯ãããŸãã-äºæ³ã®ã³ãŒãå šäœãæ€èšããçµæãDMAGetCurrentDataCounterãåŒã³åºããåŸã¯åžžã«4ãã€ãããããšããçµè«ã«éããŸããã
ãããã£ãŠããã®ãã¬ãŒã¯ãã€ã³ãã®æåã®æäœã®åŸãæ»ãã¢ãã¬ã¹ãååŸãããã¬ãŒã¯ãã€ã³ãã4ãã€ãåŸã«åé 眮ããŸãã åŸ ã¡æéã¯çµãããŸããïŒ
DMAæäœãã°
??? DMA LR:0x08000abf P:0x4001244c *(00000000) (=>) M:0x20000224 [0x000f] P2.M2+
-------------------------------------------------------------------------------------
MasterCRCtoRAM
M2M DMA LR:0x08002e81 P:0x080125bc *(145eac33) (=>) M:0x200000f0 [0x0002] P2+M2+
-------------------------------------------------------------------------------------
MasterCRCtoRAM
M2M DMA LR:0x08002e81 P:0x080125bc *(145eac33) (=>) M:0x20000020 [0x0002] P2+M2+
-------------------------------------------------------------------------------------
Calc_CRC_0_Wrap (Begin)
M2M DMA LR:0x08005001 P:0x200000f0 *(145eac33) (=>) M:0x20000010 [0x0002] P2+M2+
-------------------------------------------------------------------------------------
Calc_CRC_0
CRC DMA LR:0x080050d3 P:0x40023008 (<=) M:0x2000085c *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x08005127 P:0x40023000 (<=) M:0x20000010 *(145eac33) [0x0002] P4.M4.
CRC DMA LR:0x08005127 P:0x40023000 (<=) M:0x20000010 *(145eac33) [0x0002] P4.M4.
CRC DMA LR:0x08005177 P:0x40023000 *(abb10a5e) (=>) M:0x20000010 [0x0001] P4.M4.
-------------------------------------------------------------------------------------
Calc_CRC_0_Wrap (End)
M2M DMA LR:0x08005043 P:0x200000f0 *(145eac33) (=>) M:0x20000014 [0x0002] P2+M2+
-------------------------------------------------------------------------------------
Calc_CRC_1
CRC DMA LR:0x08005203 P:0x40023008 (<=) M:0x20000804 *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x08005257 P:0x40023000 (<=) M:0x20000014 *(145eac33) [0x0006] P4.M4.
CRC DMA LR:0x08005257 P:0x40023000 (<=) M:0x20000014 *(145eac33) [0x0006] P4.M4.
CRC DMA LR:0x08005257 P:0x40023000 (<=) M:0x20000014 *(145eac33) [0x0006] P4.M4.
CRC DMA LR:0x080052a7 P:0x40023000 *(4859bef2) (=>) M:0x20000014 [0x0001] P4.M4.
-------------------------------------------------------------------------------------
Calc_CRC_2
CRC DMA LR:0x08002359 P:0x40023008 (<=) M:0x20000954 *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x080023ad P:0x40023000 (<=) M:0x08000000 [0x496f] P4.M4+
CRC DMA LR:0x08002411 P:0x40023000 (<=) M:0x080125c0 [0x3690] P4.M4+
CRC DMA LR:0x08002463 P:0x40023000 *(145eac33) (=>) M:0x2000001c [0x0001] P4.M4.
CRC DMA LR:0x080024b5 P:0x40023000 *(145eac33) (=>) M:0x20000958 [0x0001] P4.M4.
-------------------------------------------------------------------------------------
Calc_CRC_3
CRC DMA LR:0x08002f07 P:0x40023008 (<=) M:0x2000095c *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x08002f5d P:0x40023000 (<=) M:0x08000000 [0x496f] P4.M4+
CRC DMA LR:0x08002fbf P:0x40023000 (<=) M:0x080125c0 [0x3690] P4.M4+
CRC DMA LR:0x08003011 P:0x40023000 *(145eac33) (=>) M:0x20000030 [0x0001] P4.M4.
-------------------------------------------------------------------------------------
Calc_CRC_4
CRC DMA LR:0x08002c17 P:0x40023008 (<=) M:0x20000854 *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x08002c6b P:0x40023000 (<=) M:0x20000030 *(145eac33) [0x0002] P4.M4.
CRC DMA LR:0x08002c6b P:0x40023000 (<=) M:0x20000030 *(145eac33) [0x0002] P4.M4.
CRC DMA LR:0x08002cbb P:0x40023000 *(abb10a5e) (=>) M:0x20000030 [0x0001] P4.M4.
-------------------------------------------------------------------------------------
Calc_CRC_5
CRC DMA LR:0x080030bb P:0x40023008 (<=) M:0x2000095c *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x08003111 P:0x40023000 (<=) M:0x08000000 [0x496f] P4.M4+
CRC DMA LR:0x08003173 P:0x40023000 (<=) M:0x080125c0 [0x3690] P4.M4+
CRC DMA LR:0x080031c5 P:0x40023000 *(145eac33) (=>) M:0x20000034 [0x0001] P4.M4.
-------------------------------------------------------------------------------------
Calc_CRC_6
CRC DMA LR:0x08002d47 P:0x40023008 (<=) M:0x200007fc *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x08002d9b P:0x40023000 (<=) M:0x20000034 *(145eac33) [0x0006] P4.M4.
CRC DMA LR:0x08002d9b P:0x40023000 (<=) M:0x20000034 *(145eac33) [0x0006] P4.M4.
CRC DMA LR:0x08002d9b P:0x40023000 (<=) M:0x20000034 *(145eac33) [0x0006] P4.M4.
CRC DMA LR:0x08002deb P:0x40023000 *(4859bef2) (=>) M:0x20000034 [0x0001] P4.M4.
-------------------------------------------------------------------------------------
Calc_CRC_2
CRC DMA LR:0x08002359 P:0x40023008 (<=) M:0x20000c64 *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x080023ad P:0x40023000 (<=) M:0x08000000 [0x496f] P4.M4+
CRC DMA LR:0x08002411 P:0x40023000 (<=) M:0x080125c0 [0x3690] P4.M4+
CRC DMA LR:0x08002463 P:0x40023000 *(145eac33) (=>) M:0x2000001c [0x0001] P4.M4.
CRC DMA LR:0x080024b5 P:0x40023000 *(145eac33) (=>) M:0x20000c68 [0x0001] P4.M4.
-------------------------------------------------------------------------------------
Calc_CRC_7
CRC DMA LR:0x08007a7d P:0x40023008 (<=) M:0x200008a0 *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x08007acd P:0x40023000 (<=) M:0x200000fc *(abcdfedc) [0x0076] P4.M4.
CRC DMA LR:0x08007acd P:0x40023000 (<=) M:0x200000fc *(abcdfedc) [0x0076] P4.M4.
CRC DMA LR:0x08007b1f P:0x40023000 *(80a34f2a) (=>) M:0x200000fc [0x0001] P4.M4.
-------------------------------------------------------------------------------------
DMACopyWord_0
M2M DMA LR:0x08002b09 P:0x200000fc *(80a34f2a) (=>) M:0x20000000 [0x0002] P2+M2+
-------------------------------------------------------------------------------------
DMACopyWord_1
M2M DMA LR:0x08002b91 P:0x200000fc *(80a34f2a) (=>) M:0x200000f4 [0x0002] P2+M2+
-------------------------------------------------------------------------------------
Get_DesignID_0
M2M DMA LR:0x080029f3 P:0x1ffff7e8 (=>) M:0x200021c0 [0x0006] P2+M2+
0x200021c0 56 ff 76 06 51 80 48 54 | 38 18 10 87 VvQHT8 ...
-------------------------------------------------------------------------------------
DMACopyWord_2
M2M DMA LR:0x08002a7f P:0x20000000 *(80a34f2a) (=>) M:0x200001b0 [0x0002] P2+M2+
-------------------------------------------------------------------------------------
Get_DesignID_1
M2M DMA LR:0x08001c61 P:0x1ffff7e8 (=>) M:0x20002dc0 [0x0006] P2+M2+
0x20002dc0 56 ff 76 06 51 80 48 54 | 38 18 10 87 VvQHT8 ...
M2M DMA LR:0x08001cc5 P:0x200001b0 *(80a34f2a) (=>) M:0x20002db8 [0x0002] P2+M2+
-------------------------------------------------------------------------------------
Calc_CRC_7_Wrap (Begin)
M2M DMA LR:0x08001d99 P:0x200030b8 *(5a92dc90) (=>) M:0x200030c4 [0x0002] P2+M2+
M2M DMA LR:0x08001dd5 P:0x0800f4bb (=>) M:0x20003098 [0x0010] P2+M2+
0x20003090 | 00 04 04 44 c4 4f 44 44 . ..D.ODD
0x200030a0 c4 24 24 2f b4 24 04 04 | 00 40 44 24 24 15 0c 04 .$$/.$... @D$$...
0x200030b0 fe 04 0c 15 24 24 44 40 | ....$$D@
M2M DMA LR:0x08001e2f P:0x0800f4fb (=>) M:0x20003098 [0x000e] P2+M2+
0x20003090 | 00 10 60 02 8c 00 00 fe . .`.....
0x200030a0 92 92 92 92 92 fe 00 00 | 00 04 04 7e 01 40 7e 42 ......... ..~.@~B
0x200030b0 42 7e 42 7e | B~B~
-------------------------------------------------------------------------------------
Calc_CRC_7
CRC DMA LR:0x08007a7d P:0x40023008 (<=) M:0x20002f84 *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x08007acd P:0x40023000 (<=) M:0x200030c8 *(a7894d6e) [0x0076] P4.M4.
CRC DMA LR:0x08007acd P:0x40023000 (<=) M:0x200030c8 *(a7894d6e) [0x0076] P4.M4.
CRC DMA LR:0x08007b1f P:0x40023000 *(fab893e0) (=>) M:0x200030c8 [0x0001] P4.M4.
-------------------------------------------------------------------------------------
Calc_CRC_7_Wrap (End)
M2M DMA LR:0x08001e81 P:0x200030c8 *(fab893e0) (=>) M:0x200000f8 [0x0002] P2+M2+
M2M DMA LR:0x08001ebd P:0x200030c8 *(fab893e0) (=>) M:0x200030bc [0x0002] P2+M2+
-------------------------------------------------------------------------------------
DMACopy_32bytes_0
M2M DMA LR:0x08001b73 P:0x0800f4bb (=>) M:0x20002778 [0x0010] P2+M2+
0x20002770 | 00 04 04 44 c4 4f 44 44 . ..D.ODD
0x20002780 c4 24 24 2f b4 24 04 04 | 00 40 44 24 24 15 0c 04 .$$/.$... @D$$...
0x20002790 fe 04 0c 15 24 24 44 40 | ....$$D@
-------------------------------------------------------------------------------------
DMACopy_32bytes_1
M2M DMA LR:0x08001be7 P:0x0800f4fb (=>) M:0x20002778 [0x0010] P2+M2+
0x20002770 | 00 10 60 02 8c 00 00 fe . .`.....
0x20002780 92 92 92 92 92 fe 00 00 | 00 04 04 7e 01 40 7e 42 ......... ..~.@~B
0x20002790 42 7e 42 7e 42 42 7e 40 | B~B~BB~@
-------------------------------------------------------------------------------------
Calc_CRC_7
CRC DMA LR:0x08007a7d P:0x40023008 (<=) M:0x200026bc *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x08007acd P:0x40023000 (<=) M:0x200027a4 *(a7894d6e) [0x0076] P4.M4.
CRC DMA LR:0x08007acd P:0x40023000 (<=) M:0x200027a4 *(a7894d6e) [0x0076] P4.M4.
CRC DMA LR:0x08007b1f P:0x40023000 *(fab893e0) (=>) M:0x200027a4 [0x0001] P4.M4.
-------------------------------------------------------------------------------------
DMACopy_32bytes_0
M2M DMA LR:0x08001b73 P:0x0800f4bb (=>) M:0x20002a80 [0x0010] P2+M2+
0x20002a80 00 04 04 44 c4 4f 44 44 | c4 24 24 2f b4 24 04 04 ...D.ODD. $$/.$..
0x20002a90 00 40 44 24 24 15 0c 04 | fe 04 0c 15 24 24 44 40 .@D$$.... ...$$D@
-------------------------------------------------------------------------------------
DMACopy_32bytes_1
M2M DMA LR:0x08001be7 P:0x0800f4fb (=>) M:0x20002a80 [0x0010] P2+M2+
0x20002a80 00 10 60 02 8c 00 00 fe 92 | 92 92 92 92 fe 00 00 ..`...... .......
0x20002a90 00 04 04 7e 01 40 7e 42 42 | 7e 42 7e 42 42 7e 40 ...~.@~BB ~B~BB~@
-------------------------------------------------------------------------------------
Calc_CRC_7
CRC DMA LR:0x08007a7d P:0x40023008 (<=) M:0x200029c4 *(00000001) [0x0001] P4.M4.
CRC DMA LR:0x08007acd P:0x40023000 (<=) M:0x20002aac *(a7894d6e) [0x0076] P4.M4.
CRC DMA LR:0x08007acd P:0x40023000 (<=) M:0x20002aac *(a7894d6e) [0x0076] P4.M4.
CRC DMA LR:0x08007b1f P:0x40023000 *(fab893e0) (=>) M:0x20002aac [0x0001] P4.M4.
DMAæäœã®åæãå«ãããããã®ãããªïŒ
8ã€ã®CRCé¢é£æ©èœããããŸããïŒEIGHTïŒïŒã ãããã®ãããã«ãæ瀺çãªãã©ã¡ãŒã¿ãŒã¯å«ãŸãããè¯ãããªèšç®ã䜿çšãããŸãã ãããã®é¢æ°ã®äžéšã§ã¯ãèšç®ã«ååž°ã䜿çšããŠãããããç解ãããã«è€éã«ãªã£ãŠããŸãã
ãããããäœæãããã³ããããå®æ°ïŒç§ã¯MasterCRCãšåŒã³ãŸãïŒããã©ãã·ã¥ããRAMã«ã³ããŒããã次ã«RAMããRAMã«ã³ããŒãããŠããããšãã¯ã£ãããšããããŸãã ãã©ãã·ã¥ã®2ã€ã®ååã®CRCãšèŠãªãããŸãïŒãã®å®æ°ã®åãšãã®å®æ°ã®åŸã®æåŸãã€ãŸã 空ããŠããå Žæã§ãã ãããŠãããã¯ããã©ãã·ã¥ããåã«ããããã¯ãªãŒãã³ã°ãããªãå Žåããã§ãã¯ãµã ãåæããªãããšãæå³ããŸãïŒ
å®å šãªCRCã«ãŠã³ãã4åå®è¡ãããŸãã ãã©ãŒïŒ 次ã«ãCRCããCRCãšèŠãªãããŸãã ãããŠãCRC to CRC to CRCã ãã©ãŒïŒ CRCã®æäœã«åŒ·ããç§ã¯æãäžããŸããã§ããã
DMAã¯æåã®æåããããããŸã
CRCãšã¡ã¢ãªããã¡ã¢ãªãžã®å¥åŠãªåãã®èšç®ã«å ããŠããã°ã¯äžæã®ãããIDãåãåãããšãå€æããŸããã DMAã䜿çšããŸãã ããã¯éåžžã«çããã ãããIDã¯çç£äžã«èšå®ãããã¯ãªã¹ã¿ã«ããšã«åºæã§ããããã¯ãregcodeãçæããããã®ããŒã¿ãœãŒã¹ã®åœ¹å²ã®åªããåè£ã§ãã
èå³æ·±ãæ å ±ïŒ12ãã€ãã®ãããIDã«ã¯ããããçªå·ããã¬ãŒãçªå·ïŒãŠã§ãŒãïŒãããã«ã¯ãã®ãŠã§ãŒãäžã®xyããã座æšããå«ãŸããŠããŸãïŒãããIDãåãåã£ãåŸã®ã³ãŒãã®åæã§ã¯ãåãé¢æ°ã2ååŒã³åºãããæåã¯IDã®æåã®6ãã€ãã§ã次ã«2åç®ã§åŒã³åºãããããšã瀺ãããŸããã ãã®é¢æ°ã¯ã256æ¡ã®é åã®ã€ã³ããã¯ã¹ãšããŠãã€ãã䜿çšããŠãæž¡ããããããã¡ãŒãåŠçããçµæãç Žæããã³ã·ããããŸãã
çãã確èªãããŸãã-ã³ãŒã«ã¯ç§ã®ID1ãšID2ã³ãŒããè¿ããŸããã
æ°å¹Ž
æšæºã®åšèŸºæ©åšã©ã€ãã©ãªããé¢æ°ãå®çŸ©ãããšãã¢ãã¬ã¹0x800C23Cã®å¥åŠãªããŒãã«ã®åŠçã«æ°ä»ããŸããã 7ã€ã®GPIOããŒããã¹ãŠã®16ãã³ã®ããããã®ç¶æ ã説æããŸããïŒåŒã³åºãã¯ã²ã©ãã³ããŒããŒã¹ãã§ãïŒã ã©ã®ãã³ãäœã®ããã«äœ¿çšãããŠããããèå³æ·±ããªããŸããã
ã¬ãã¥ãŒã®ã³ãŒããšå³ãæ¯èŒããŠãç§ã¯ãã®ãããªè¡šãæããŸãã
ãªããïŒ
IPU-ããã·ã¥ãµãã©ã€ïŒç¹ã«æå®ããªãéããããã©ã«ãïŒ
IPD-ããã·ã¥ã°ã©ãŠã³ã
AIN-ã¢ããã°å ¥å
Out_OD-ã¢ãŠããªãŒãã³ãã¬ã€ã³
Out_PP-ããã·ã¥ããã·ã¥ã¢ãŠã
åšæ³¢æ°50 mhzïŒç¹ã«æå®ããªãéããããã©ã«ãïŒ
GPIO_CããŒãã®äžéšã®èšå®ã¯ãæããã«å€ãããŒãžã§ã³/ãããã¿ã€ãããã®ãŽãã®ãŸãŸã§ããã é ç·ãå€æŽãããããŒããå®å šã«ãªãã«ãããäœããã®çç±ã§é床ãå€æŽãããŠããŸãã
IPU-ããã·ã¥ãµãã©ã€ïŒç¹ã«æå®ããªãéããããã©ã«ãïŒ
IPD-ããã·ã¥ã°ã©ãŠã³ã
AIN-ã¢ããã°å ¥å
Out_OD-ã¢ãŠããªãŒãã³ãã¬ã€ã³
Out_PP-ããã·ã¥ããã·ã¥ã¢ãŠã
åšæ³¢æ°50 mhzïŒç¹ã«æå®ããªãéããããã©ã«ãïŒ
GPIO_CããŒãã®äžéšã®èšå®ã¯ãæããã«å€ãããŒãžã§ã³/ãããã¿ã€ãããã®ãŽãã®ãŸãŸã§ããã é ç·ãå€æŽãããããŒããå®å šã«ãªãã«ãããäœããã®çç±ã§é床ãå€æŽãããŠããŸãã
EEPROMãã©ãã·ã¥æ¥ç¶ã«æ³šæããŠãã ããã I2Cã©ã€ã³ã¯è¶³ã«å·»ãä»ããããŠãããããŒããŠã§ã¢I2Cã¯ãããŸããã å¥åŠãªæ±ºæã§ããã
ãŸãããã¹ãŠãè¯ãã I2Cã§åããããšã¯ãããŸããã ãããŠãMKã®è¶³ã®ä¿¡å·ãæåã§å¶åŸ¡ããã¬ãã«ã§ãããæããæ©äŒããããŸããïŒ TIã®Webãµã€ãããããã¯ãããŠã³ããŒãããç¶æ ããŒãã«ãäœæããŠãããããã®ã³ãŒããã¹ã±ããããŸããã ãã®ããã圌ã¯è»¢éããã³ãŒãããããã«ãã³ãå€æŽããŸãã
ãããŠãæ®å¿µãªããšã«ç§ãåŸ ã£ãŠããŸããã EEPROMã¯ãããã¬ãŒã«ãã£ãŠåæ¢ãããŸããã ãããŠçè«çã«ã¯åœŒå¥³ã¯ãã¹ã¿ãŒãåŸ ã€ããšãã§ããŸããããå®éã«ã¯ãã¹ãŠãå®å šã«ãã©ãã©ã«ãªããŸãã
ãããã³ã«ã®åäœãç¥ã£ãŠããã®ã§ãé¢æ°ã«ååãä»ããŠãã¬ãã«ã®é«ãFlash_ReadData / Flash_WriteDataé¢æ°ã«ã¬ãã«ãäžããŠãããŸãã
ãªã³ã¯ãèŠãŠãã ãããèªã¿åããšæžã蟌ã¿ã¯ãã³ãŒãå ¥åã®å ŽæããåŒã³åºãããŸãã ãããããïŒ å ¥åããã©ãã·ã¥ã«ãã£ãŠæžã蟌ãŸããåŸã4ãã€ãã®å¿çã³ãŒããå€æããŸãã ãããŠãããããèªã¿åãããŸãã æ€èšŒã®ããã«ãããã®æäœãæåŸ ããŸããã ãããŠãäžåœèªã®2ã€ã®ç°ãªãã¡ãã»ãŒãž-ããªããæžãããã®ãèªãã å Žåãããã§ãªãå ŽåïŒããŒããŠã§ã¢ãšã©ãŒïŒïŒã
ã³ãŒããå ¥åããåŸããã§ãã¯ãããªãããšãããããŸãã ã¹ããŒã·ã§ã³ã®éå§æã«åžžã«ãã§ãã¯ãããŸãã æ€èšŒãšã©ãŒãçºçãããšãã¡ã€ã³ã®RTOSã¯ãã ããŠã¿ã¹ã¯ã®ä»£ããã«ãã³ãŒããå ¥åããŠãã©ãã·ã¥ã«æžã蟌ãå¥ã®RTOSã¿ã¹ã¯ãäœæãããŸãã ãŸããããã¯è«ççã§ãã
ããã«ãé£æ¥ãããã©ãã·ã¥æ©èœã§ã¯ãå åºãªããŒã¿ãèªã¿æžããããŸãã ãµã€ãºã¯0x3AEãã€ãã§ãã èšå®ã®ããã«èŠããŸãã ããããèªã¿åã£ãåŸãããŒã¿ãããã¡ã«ãã£ãŠã³ãŒããèšç®ããé¢æ°ãåŒã³åºãããŸãã æ¯ç£šãã«ãID1ãšID2ã®èšç®æ©èœãé£æ³ãããŸãã ããã«ãããŒã¿ããŒãã«ããŸã£ããåãã§ãã ãªããã®ãããªã³ãŒãã䜿çšããŠèšå®ã®æŽåæ§ãæ€èšŒããã®ã§ããïŒ ããè¯ãCRCãå¿ èŠã§ãïŒ åŸ ã£ãŠãã©ãããã...ïŒ ç§ã¯ããŒãã«ããGoogleå®æ°ãæäœããŸã-確ãã«ã ããã¯CRCã§ãã ããæ£ç¢ºã«ã¯CRC16_CCITã åãæ©èœã®2ã€ã®ã³ããŒã ããŒãã«ã®2ã€ã®ã³ããŒã æµã«ã¯æšæž¬ããŸããã§ããã
æåŸã®ã¹ããã
ãã®ããããã©ãã·ã¥ããã®èªã¿åããå¶åŸ¡ããŸãã ãåæåããªã»ãããã ãã¬ãŒã¯ãã€ã³ãã¯ãèšé²ãããã°ããã®åçãèªã¿åãããå Žæã«ããã«ã€ãªãããŸãã èªã¿åãããŒã¿ã«ãŠã©ãããã€ã³ãã眮ããŸãã ãåéãã¹ããŒã·ã§ã³ã¯ãäœãèµ·ãããªãã£ããã®ããã«ãã³ãŒãå ¥åã€ã³ã¿ãŒãã§ãŒã¹ã衚瀺ããŸãã
åã³DMAïŒ ãã°ã確èªããŸãã èªã¿åãã³ãŒãããã©ãã·ã¥ããã³ããŒããçŽåŸã«ã32ãã€ãã®2ã€ã®ãããã¯ãã³ããŒãããŸãã DMAæäœããã®ãªã¿ãŒã³ã¢ãã¬ã¹ã§éã¢ã»ã³ãã©ã確èªããŸãã ã³ãŒãã§32ãã€ããã³ããŒããåŸãå éšã«xorã®æãæã€å¥åŠãªé¢æ°åŒã³åºãããããŸãã ãã¬ãŒã¯ãã€ã³ããé 眮ããŸãã
ãã®é¢æ°ãåŒã³åºããšãããã€ãã®ããŒã¿ãå«ããããã¡ãŒã衚瀺ãããŸããæåŸã®4ãã€ãã¯ããã§ã«ããªãã¿ã®ID1ããã³ID2ã¹ããŒã·ã§ã³ã§ãã é¢æ°ã®çµäºæã«ã16ãããã®æ°å€ã衚瀺ãããŸãã å¥ã®åŒã³åºãã¯ä»ã®ããŒã¿ãå«ããããã¡ã§ãæåŸã«ã¯ID1ãšID2ããããŸãã
奜å¥å¿ã匷ãæ å ±ïŒå32ãã€ããããã¡ãŒã®ããŒã¿ã¯ã察å¿ããæåã®ç»åã§ãã ã€ã¡ãŒãžã®æåŸã®4ãã€ãã¯ããããã¡ãŒå ã§ID1 + ID2ã«çœ®ãæããããŸãã ãããã¯ã©ã®ãããªè±¡åœ¢æåã§ããïŒ ãã¶ãéçºè ã®ååïŒ ç§ã¯ç¥ããªããç§ã¯äžåœèªãèŠæã§ããããããé¢æ°ã®çµæãç®çã®å¿çã³ãŒãã§ããå Žåã¯ã©ãã§ããããïŒ ã¹ããŒã·ã§ã³ãèµ·åãããããã¬ã§åãåã£ãçªå·ãå ¥åããŠåèµ·åããŸã-ã³ãŒããåãå ¥ããããŸãïŒ
ãã®ç¥ç§çãªé¢æ°ãæ£ç¢ºã«èšç®ãããã®ãç解ããããšã¯æ®ã£ãŠããŸãã ãããŠåœŒå¥³ã¯ãããããŸãïŒ
- æ瀺çã«å®çŸ©ãããå®æ°éã®XORã®æã æçµçãªå€ãåããŸããã ããããmanyXorValueããšåŒã³ãŸãããã
- èªèº«ã®å é ããCRC16_CCITãèšç®ããŸãã ãŸãããã§ã«èšç®ãããå€ã䜿çšããŸãã ãxorCodeCrc16ããšåŒã³ãŸãããã
- CRC16ã¯ãçµæïŒmanyXorValue xor xorCodeCrc16ïŒãåæå€ãšã¿ãªããCRC16ããŒãã«ã®æ¢ã«ããç¥ãããŠãã2ã€ã®ã³ããŒã®ä»£ããã«ãå¥ã®ããŒãã«ãèæ ®ããŸãã éåžžã«äŒŒãŠããŸããããŸã ç°ãªããŸãã
å ã®ããŒãã«ã¯8ã€ã®èŠçŽ ã«åå²ãããæ··åãããåã³æ¥çãããããã§ãã ããšãã°ãæåã®ã¹ã©ã€ã¹ã0çªç®ã«ãªããŸããã 5çªç®ã¯ãŸã ããã«ãããŸãã ãããŠ4äœã¯çŸåš31äœã§ãã æ¯èŒã®ããã«çãã³ãŒããäœæããŸãããã®å¥åŠãªããŒãã«ãçµã¿ç«ãŠãããã«å¿ èŠãªé åã¯æ¬¡ã®ãšããã§ãïŒ1ã2ã3ã4ã31ã5ã6ã7ã8ã9ã10ã11ã12ã0ã13ã25ã14ã 15ã16ã17ã18ã19ã20ã21ã22ã23ã24ã26ã27ã28ã29ã30
Pythonã§ã®æžãæãã ãã§ãã¯-åäœããŸãã ãããã°ã®ããã«ãåãã¹ããŒã·ã§ã³ãæã€ã€ã³ã¿ãŒãããã®æ°äººã«IDãæž¡ããŠãçæãããRGããã§ãã¯ããããã«é Œã¿ãŸããã ããã«5é§ ã§ãã§ãã¯ã çµæã¯æ£ããã§ãã
ãããã«
- é²åŸ¡ã®åºç€ã¯ã倧éã®è€éã§è€éãªã³ãŒãã§ããããšãå€æããŸããïŒç¢ºãã«ãããæ°ããŸããã§ãããã10-15ïŒ ãå£éèŠããšïŒãéã®ä»äºã«æ·±ãé¢ãã£ãŠããŸãã RTOSãã«ãã¹ã¬ãããéèŠãªåœ¹å²ãæãããŠãé©ããªãã§ãããã 幞ããªããšã«ãå®è£ ã®åŸ®åŠãªç¹ããã¹ãŠç解ããã€ããã¯ãããŸããã§ããã
- ã¹ããŒã·ã§ã³ã¯æ°ãããã¡ãŒã ãŠã§ã¢ã§ç²åŸããŠããŸãã æçµçã«ç§ã¯åœŒå¥³ã®ããã«ã¿ãªãšäžç·ã«ã·ãã¯ãªã¢ã«ã補ã®ãã³ãã«ãçµã¿ç«ãŠãŸããã åãã¹ããŒã·ã§ã³ã§ã¯ãã ä»ãã
æŽæ°ïŒã³ã¡ã³ãã§ã¯ããã®ãã³ã«ã€ããŠæ¢ã«2å質åãããŠããŸãã ããã«çŽ æŽãããã¬ãã¥ãŒããããŸãã - ARM Cortex M3ããã³STM32åšèŸºæ©åšã«é¢ããå€ãã®æ°ããæ å ±ãåŠã³ãŸããã
- äžåœã®ãã¡ãŒã ãŠã§ã¢ã®å質ã«ççŽã«å€±æããŸããã ãŒãããæžãçŽããŠãªãŒãã³ããŸãã
ãããŠãé²åŸ¡ãç°¡åã ã£ããïŒ ç§ã¯ããããã³ãŒããå ¥åãããããå¿ããŠããã§ããã...
ã¹ããŒãªãŒã®ç¶ç¶ã«ã€ããŠåŠã¶ããšã«èå³ããããã©ãããã³ã¡ã³ããæžããŠãã ãããã¯ãã ä»ãã¹ããŒã·ã§ã³ã®åäœã¢ã«ãŽãªãºã ã®éãšãç§ã®ããŒãžã§ã³ã®éçºã®é²æã
PSïŒç¹ã«ãã®èšäºã§ã¯ãjavascriptã®ããŒçæã³ãŒããæžãçŽããŸããã ãªã³ã©ã€ã³ããŒãžã§ã³ ãPythonããŒãžã§ã³ãžã®ãªã³ã¯ããããŸãã 説æãã©ããç解ã§ããªãå Žå-ã³ãŒããã詳现ãæç»ã§ããŸãã ãããŠãã¡ãããéã®æŽæ°ãä¿®çã«ãã£ãŠãããã¯ãããèªåã®ã¹ããŒã·ã§ã³ã埩掻ãããŸãã