Arm Mbed OSã¯ãã¢ãã®ã€ã³ã¿ãŒãããïŒIoTïŒçšã®ããã€ã¹ã®éçºãä¿é²ãã人æ°ã®ãããªãŒãã³ãœãŒã¹ãããžã§ã¯ãã§ãã ç¬èªã®äžæã®ããã»ããµããã€ã¹ãäœæããå Žåãæåã®ã¿ã¹ã¯ã¯ããã«äœããã®ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ïŒOSïŒã移æ€ããããšã§ãã
NXP Kinetisãã¡ããªã®ãã€ã¯ãã³ã³ãããŒã©ãæèŒããããŒãã§Arm Mbed OSãèµ·åããæ¹æ³ãé ãè¿œã£ãŠèª¬æããŸãã
Arm Mbed OSãããžã§ã¯ã
ARMã®ããããã£ã§ãããARMã¢ãŒããã¯ãã£å°çšã§ãã äžè¬çãªä¿¡å¿µã«åããŠã Mbedã¯å®å šã«C ++ã§æžãããŠããããã§ã¯ãªãã Cortex-Må°çšã«èª¿æŽãããŠããããããã»ã©æ°ããããããŸããã ãã®èµ·æºã¯ã KeilãI8051ã®ãªã¢ã«ã¿ã€ã ãªãã¬ãŒãã£ã³ã°ã·ã¹ãã ïŒRTOSïŒã§ããRTXãäœæãã90幎代ã«é¡ããŸãã ãã®åŸã RTXã¯Keilã«ãã£ãŠARM7ããã³ARM9ã«è»¢éãããCortexãç»å ŽããŸãããARMã¯Keilãè²·åããRTOSã¯CMSIS-RTOSãšåä»ããããŸãã ã ãŸã å®å šã«Cã§æžãããŠããŸããã æåŸã«ã IoTãšArduino ããŒã ã®å°æ¥ã«ããã Mbedãç»å ŽããŸããã Arduinoã®åãã¯ã C ++ã·ã§ã«ãšãæ°åæ¬ã®ãã³ãUARTãLEDã®äœ¿ãæ £ããã»ããã§ç°¡çŽ åãããAPIã«åœ±é¿ãäžããŸãããäžæ¹ãIoTã¯ããããžã§ã¯ããTCP / IPãBluetooth Low Energyã6LoWPANãThread ... OS
Keilãã©ã³ãã¯åŒãç¶ãååšããKeiléçºãããã®é åžã§ã¯ãMbedãæäŸãããããå¹ åºããã€ã¯ãã³ã³ãããŒã©ãã¡ããªãžã®ããã«ãŠã§ã¢ãšç§»æ€äŸãè±å¯ã«åãæããCMSIS-RTOSãèŠã€ããããšãã§ããŸãã ãã ããããã¯éå ¬éã®åæ¥ãããžã§ã¯ãã§ãã
å°éå§å¡äŒ
ããã§ã®ç§»æ€ã¯äžäŸã§ããããã®ã¹ããŒã ã¯ããã»ã©éèŠã§ã¯ãããŸããã ããã«éèŠãªã®ã¯ãã€ã³ã¹ããŒã«ãããŠãããã€ã¯ãã³ã³ãããŒã©ãŒã§ãã ããã¯ã NXPã®MKE18F512VLL16 Kinetisãã¡ããªã§ãã äž»ãªãã©ã¡ãŒã¿ãŒïŒ
ã«ãŒãã«-ARM Cortex-M4F 32ããã
æ倧ã³ã¢åšæ³¢æ°-168MHz
ãã©ãã·ã¥512KBïŒ512K x 8ïŒ
RAM 64 KB
100-LQFPïŒ14x14ïŒ
ãã€ã¯ãã³ã³ãããŒã©ãŒã®å 容
ãã®ãã€ã¯ãã³ã³ãããŒã©ãŒã¯ããµããŒããããŠããARM Mbed OSã®ãªã¹ãã«å«ãŸããŠããŸããã ããã¯æ¯èŒçæ°ãããšããäºå®ã«ãã£ãŠèª¬æããããšãã§ããŸãã
ãã€ã¯ãã³ã³ãããŒã©ãŒã¯ãããªãæé ãªäŸ¡æ Œãšé«ãã³ã¢åšæ³¢æ°ã§åªããåšèŸºæ©åšãåããŠãããããèå³æ·±ããã®ã§ãã FlexIOã¢ãžã¥ãŒã«ã䜿çšãããšãåŸæ¥ã®ãã€ã¯ãã³ã³ãããŒã©ãŒã§ã¯å©çšã§ããªãéæšæºã€ã³ã¿ãŒãã§ãŒã¹ãäœæã§ããŸãã
ã¹ããã1. NXPããŒã«ãããŠã³ããŒããã
- MKE18F512xxx16ãã¡ããªåãã«MCUXpressoãœãããŠã§ã¢éçºãããïŒSDKïŒã®ããŒãžã§ã³ãwww.nxp.comã§ãªã³ã©ã€ã³ã§æ§æããŸãã
- Toolchain / IDEãæå®ããå¿ èŠãããå Žåã¯ã IAR IDEãéžæããŸãã IAR IDEã§ã¯ãããªãäœæ¥ãæ€èšãããŸãã
- 䜿çšå¯èœãªãã¹ãŠã®ãœãããŠã§ã¢ã³ã³ããŒãã³ããéžæããŸãã
- çµæã®MCUXpressoæ§æããŒã«ãWindows 64ãããããã±ãŒãžããµã€ãããããŠã³ããŒãããŸãã
ããã¯ã次ã®ã³ã³ãã³ããå«ã30ã¡ã¬ãã€ãã®ã¢ãŒã«ã€ãMKE18F512xxx16.zipã§ãã
- -MCUXpresso Config Tools v4.1 for WindowsãããŠã³ããŒãããŠãã ããã ããã䜿çšããŠããã€ã¯ãã³ã³ãããŒã©ãŒã®ã¯ããã¯ãµãã·ã¹ãã ãæ§æããŸãã
ã¹ããã2. RTOSãªãã§ã¢ããªã±ãŒã·ã§ã³ãããžã§ã¯ããååŸãã
- MCUXpresso Config Tools v4.1 for Windowsãèµ·åããŸã
- ãã³ãã¬ãŒããšããŠãæãåçŽãªãã¢ãããžã§ã¯ãã®1ã€ã§ããled_blinkyãéžæããŸãã
- ã¯ãããã³ã°ã¹ããŒã ãèšå®ããã¯ããã¯åæåãœãŒã¹ãçæããã³ãã³ããæäŸããŸãã åæåãœãŒã¹ã¯ããããžã§ã¯ããã£ã¬ã¯ããªã§çŽæ¥æŽæ°ãããŸãã
- IDE IARã®äžã®ãœãŒã¹ã䜿çšããŠãåãåã£ããããžã§ã¯ãããã£ã¬ã¯ããªã«ã³ããŒããŸãã ãããžã§ã¯ãã§ã SWDã€ã³ã¿ãŒãã§ã€ã¹ãä»ããŠJ-Linkãããã¬ãŒããããã°ãã£ãã«ãéžæããŸãã LEDããŒããžã®æžã蟌ã¿ã³ãã³ããå€æŽããããŒãäžã§ã³ã³ãã€ã«ããŠå
¥åããŸãã
ã¹ããã3. Mbedãããžã§ã¯ããæ§æããã³å€æãã
- ãã©ãããã©ãŒã ã»ã¯ã·ã§ã³ã®os.mbed.com/platformsã«ããMbedãããžã§ã¯ãã®Webãµã€ãã«ã¢ã¯ã»ã¹ããŸãã
ããã§ãéžæãããã®ãšå¯èœãªéãé¡äŒŒãããã€ã¯ãã³ã³ãããŒã©ãåããããŒããæ¢ããŠããŸãã - FRDM-K66FããŒã-os.mbed.com/platforms/FRDM-K66FãéžæããŸãã éžæã¯å¶ç¶ã§ã¯ãªãããã®ãããªãã€ã¯ãã³ã³ãããŒã©ãŒã§ã¯å®åçµéšããããŸãã
- ããŒãã®ãã¬ãŒã³ããŒã·ã§ã³ããŒãžã§ããã¢ãéžæããŸã-mbed-os-example-blinky-os.mbed.com/teams/mbed-os-examples/code/mbed-os-example-blinky/?platform=FRDM-K66F
ããã¯æãåçŽãªäŸã§ãããå¥ã®ããŒãã«é©åãããã®ãæãç°¡åã§ãã - ç»é²ããŠãã³ã³ãã€ã©ã®ãªã³ã©ã€ã³ã»ã¯ã·ã§ã³ïŒ os.mbed.com/compilerïŒã«ã¢ã¯ã»ã¹ããŸãã
- ãŸãããã©ãããã©ãŒã -FRDM-K66FãéžæããŠãããus- mbed-os-example-blinkyãéžæãããã¢ãã€ã³ããŒãããŸãã ããã°ã©ã ããã«ã§ã¯ããã®ãã¢ã¯mbed_blinkyãšåŒã°ããŸã ã
- ãã®äŸãã³ã³ãã€ã«ããŠæ€èšŒãããšã¯ã¹ããŒãããŸãã
IDE IARåãã®åœ¢åŒã§ãšã¯ã¹ããŒãããŸã
ããã§ã IARã® Mbedéçºãããžã§ã¯ãã®ãœãŒã¹ã³ãŒããã§ããŸããã ãã ããçµæã®ãããžã§ã¯ãã¯äœæ¥ã«äžäŸ¿ã§ãã
ãããžã§ã¯ãå ã®ãã¹ãŠã®ãã¡ã€ã«ã1ã€ã®ã°ã«ãŒãã«åéãããæ··åãããŸããã ã©ã®ãã¡ã€ã«ãã©ã®æ©èœããã±ãŒãžã«å±ããŠããããæ€çŽ¢ããŠèå¥ããããšã¯äžå¯èœã§ãã ãã®ãããžã§ã¯ãã«ã¯ã Mbedãããžã§ã¯ãã®ã»ãŒãã¹ãŠã®ããã«ãŠã§ã¢ã®ãœãŒã¹ãå«ãŸããŸãã ããããã®ã»ãšãã©ã¯çŸåšå¿ èŠãããŸããã
ã¹ããã4. IARãããžã§ã¯ããæšæºåœ¢åŒã«å€æãã
-Pythonã§ç¹å¥ã«äœæããããŠãŒãã£ãªãã£ã䜿çšããŠãããã€ãã®å€ææäœãå®è¡ããŸãã
ãŸãããã¢ãããžã§ã¯ãã®ãã£ã¬ã¯ããªããããããžã§ã¯ãã«åé¡ãããªãã£ããã¹ãŠã®ãœãŒã¹ãåé€ããŸãã ãœãŒã¹ãªã¹ãã¯ããã¡ã€ã«mbed-os-example-blinky.ewpããååŸãããŸãã ãã®ãŠãŒãã£ãªãã£ã¯Clear_from_unused_files_and_dirs.pyãšåŒã°ããŸã ã ãŸãããã¡ã€ã«ãåé€ããåŸã«äœæããã空ã®ãã£ã¬ã¯ããªãåé€ããŸãã
次ã«ã Convert_ewp_file.pyãŠãŒãã£ãªãã£ã䜿çšããŠããããžã§ã¯ããã¡ã€ã«mbed-os-example-blinky.ewpãåæ§æãããã®äžã®ã°ã«ãŒãããããžã§ã¯ããã£ã¬ã¯ããªã«å¯Ÿå¿ããããã«ããŸãã ããã±ãŒãžãåé€ãŸãã¯è¿œå ã§ãããããç解ããããæ§é ã®ãããžã§ã¯ããååŸããŸãã ããã§ããããžã§ã¯ãã®ååãå€æŽã§ããŸãã ãããè¡ãã«ã¯ãã¿ã°ãç·šéããŸã
<configuration> <name>mbed-os-example-blinky</name>
mbed-os-example-blinky.ewpãã¡ã€ã«å
ã ãã¡ã€ã«mbed-os-example-blinky.ewp ïŒãã®å Žåã¯Test_proj.ewp ïŒã®ååãå€æŽããã¿ã°ãä¿®æ£ããŸã <path>$WS_DIR$/mbed-os-example-blinky.ewp</path>
ãã¡ã€ã«mbed-os-example-blinky.eww ïŒãã®å Žåã Test_proj.ewp ïŒã§ãã¡ã€ã«mbed-os-example-blinky.ewwã®ååãéžæãããã®ïŒãã®å ŽåTest_proj.eww ïŒã«å€æŽããŸã
ãã®çµæããã®ãããªãããžã§ã¯ãæ§é ãæã£ãŠããŸã
-ãœãŒã¹ã³ãŒãã調ã¹ãŠããã€ã¯ãã³ã³ãããŒã©ãŒã®æ©èœã«äŸåãããœãŒã¹ã³ãŒããç¹å®ããŸãã ãã®ãããSlickEditãEclipseãªã©ã®ããå°éçãªãšãã£ã¿ãŒã䜿çšããæ¹ã䟿å©ã§ãã ãšãã£ã¿ãŒã¯ã IDEèšå®ã§å®£èšããããã¯ãã«ã€ããŠãéç¥ããå¿ èŠããããŸãã ãããè¡ãã«ã¯ãè¿œå ã®ããããŒãã¡ã€ã«Extra_options.hãäœæãã IDE IARããExtra Optionsã®å 容ãã³ããŒããŸãã
ã¹ããã5. Mbedãããžã§ã¯ãã®ç·šé
ãããžã§ã¯ããç·šéããæºåãã§ããŸããã Extra_options.hãã¡ã€ã«å ã®ãã¯ããåæããããšããå§ããŸãããã 察å¿ããæ©èœãåãããšãã£ã¿ãŒã§ãããè¡ããIARç°å¢ã§è¡ãããšãã§ããŸãã
-æªäœ¿çšã®ãã¯ããåé€ããŠããããªãåæäžã«æ³šæãããããªãããã«ããŸãã æ®ãããœãŒãããŸãã ãã¯ãã®çŽååã¯æªäœ¿çšã§ããããšãå€æããŸããã
-[ è¿œå ãªãã·ã§ã³]ã«æ°ãããã¯ãTARGET_MKE18Fãå°å ¥ãããŸããã mbed_rtx.hãã¡ã€ã«ã§ã¹ã¿ãã¯ã®éå§ã¢ãã¬ã¹ãå®çŸ©ããŸãã ã¹ã¿ãã¯ã¯ã¢ãã¬ã¹ãæžããæ¹åã«æé·ããŠããŸãã Mbedã§ã¯ã䜿çšå¯èœãªRAMã®äžéããã¹ã¿ãã¯ãéå§ããã®ãäžè¬çã§ãã MKE18Fã®å Žåããã®å¢çç·ã0x20008000ULã«èšå®ããŸã
-ãã£ã¬ã¯ããªTARGET_K66FãèŠã€ããŸãã ãã€ã¯ãã³ã³ãããŒã©ãŒã®ã¿ã€ãã«äŸåãããã¡ã€ã«ãããã«ä¿åãããŸãã ãããã®éåžžã«å€ã-136ãã¡ã€ã«ããããŸãã TARGET_K66Fãã£ã¬ã¯ããªã®æšªã«ã TARGET_MKE18Fãšããååã®ç¬èªã®ãã£ã¬ã¯ããªãäœæããŸãã
-ãã¢ãããžã§ã¯ãSDK led_blinky \ CMSISã®ãã£ã¬ã¯ããªããã 次ã®ãã¡ã€ã«ãMbedãã£ã¬ã¯ããªã«ã³ããŒããŸã -os \ targets \ TARGET_Freescale \ TARGET_MCUXpresso_MCUS \ TARGET_MKE18F \ device ïŒ
â¢fsl_device_registers.hã ïŒè¿œå ãªãã·ã§ã³ã®ãã¯ãCPU_MK66FN2M0VMD18ã¯CPU_MKE18F512VLL16ã«çœ®ãæããããŸãïŒ
â¢MKE18F16.h
â¢MKE18F16_features.h
â¢system_MKE18F16.h
â¢system_MKE18F16.c
-ãã¡ã€ã«ãåé€ãã
â¢MK66F18.h
â¢MK66F18_features.h
â¢system_MK66F18.c
â¢system_MK66F18.h
-TOOLCHAIN_IARãã£ã¬ã¯ããªã§ ãå 容ãstartup_MKE18F16.sããã³MKE18F512xxx16_flash.icfãã¡ã€ã«ã«çœ®ãæããŸã ã
-IDE IARãããžã§ã¯ãã§ããªã³ã«ã«ããæ°ãããã¡ã€ã«MKE18F512xxx16_flash.icfãžã®ãã¹ãæå®ããŸã
-ãã£ã¬ã¯ããªMbed-os \ã¿ãŒã²ãã\ TARGET_Freescale \ TARGET_MCUXpresso_MCUS \ TARGET_MKE18F \ãã©ã€ããŒã®å 容ã¯æ¶å»ãããMKE18F512xxx16ãã¡ããªã®SDKã«ããããã€ã¹\ MKE18F16 \ãã©ã€ããŒãã£ã¬ã¯ããªã®ãã¡ã€ã«ã§ãã£ã±ãã«ãªããŸãã
-ãã¡ã€ã«\ mbed-os \ targets \ TARGET_Freescale \ TARGET_MCUXpresso_MCUS \ fsl_common.cãã MKE18F512xxx16ãã¡ããªã®SDKã«ããdevices \ MKE18F16 \ driversãã£ã¬ã¯ããªã«ããåæ§ã®ãã¡ã€ã«ã«çœ®ãæããŸãã ãã£ã¬ã¯ããªMbed-os \ targets \ TARGET_Freescale \ TARGET_MCUXpresso_MCUS \ TARGET_MKE18F \ driversã§åããã¡ã€ã«ãåé€ããŸãã
-ãã£ã¬ã¯ããªmbed-os \ targets \ TARGET_Freescale \ TARGET_MCUXpresso_MCUS \ TARGET_MKE18F \ driversãã ãFreeRTOSãååšããååã®ãã¡ã€ã«ãåé€ããŸãã
-æ°ãããã€ã¯ãã³ã³ãããŒã©ã«ã¯EMACããªãããã \ mbed-os \ features \ netsocket \ emac-driversãã£ã¬ã¯ããªãããK66ãã€ã¯ãã³ã³ãããŒã©ã®EMACåšèŸºæ©åšã«é¢é£ãããã¹ãŠã®ãã¡ã€ã«ãåé€ããŸãã
-åã³Convert_ewp_file.pyãŠãŒãã£ãªãã£ã䜿çšããŸã
-ã³ã³ãã€ã«ããŠ267ãšã©ãŒãååŸããŸãã ãããã¯ãã¹ãŠTARGET_MCUXpresso_MCUSãã£ã¬ã¯ããªã«ãããã¡ã€ã«ã«ãããã»ãšãã©ã®ãã¡ã€ã«ã«ã¯ååã«apiãµãã£ãã¯ã¹ãä»ããŠããŸãã åãã¡ã€ã«ã¯åå¥ã«åŠçããå¿ èŠããããŸãã åèš12åã®ãã¡ã€ã«ã«ãšã©ãŒã衚瀺ãããŸãã
ã¹ããã6. Mbedãã¡ã€ã«ã®ç·šé
fsl_clock_config.cãã¡ã€ã«
ããã¯ããã®æ®µéã§æãéèŠãªãã¡ã€ã«ã§ãã ãããã®ãã¹ãŠã®ãµãã·ã¹ãã ã®ã¯ãããã³ã°ãåæåããŸãã RTOSåæåé¢æ°mbed_sdk_initã¯ããã®ãã¡ã€ã«ããBOARD_BootClockRUNé¢æ°ãåŒã³åºããŸãã fsl_clock_config.cãã¡ã€ã«ã led_blinkyãããžã§ã¯ãã®æ€èšŒæžã¿ãã¡ã€ã«ã«çœ®ãæããŸãã ããã§ã¯clock_config.cãšåŒã°ãïŒ fsl_clock_config.hã«ã³ããŒããåŸã«ååãå€æŽããå¿ èŠã«å¿ããŠ#includeãä¿®æ£ããŸãïŒãæ倧åšæ³¢æ°168 MHzã§ããããèµ·åãããã®ã§ãRTOSãã¡ã€ã«ã®BOARD_BootClockRUNé¢æ°ã®åŒã³åºããBOARD_BootClockHSRUNã«çœ®ãæããŸã ã
-æ®ãã®ãã¡ã€ã«ãèæ ®ããŸãã ããã«ãã®å¿ èŠæ§ã«ã€ããŠçåãæèµ·ããŸãã å®éããããã®å€ãã¯ãåçŽåãããã€ã³ã¿ãŒãã§ãŒã¹ãåããåšèŸºæ©èœã®åçŽãªã©ãããŒã§ãã æãå¯èœæ§ãé«ãã®ã¯ãArduinoã«åºã¥ãAPIã·ã¹ãã ã®é¡äŒŒæ§ãéèŠã§ããåå¿è ããã°ã©ããŒã察象ãšããŠããŸãã ãããã®ãã¡ã€ã«ã¯ãã€ããŒããéã°ãªããã®ãšããŠç¡èŠããããšãã§ããŸããããã®ãããMbedã³ãã¥ããã£ã«ã¯åãå ¥ããããŸããã
åé€ãããã¡ã€ã«ïŒ
API
â¢analogin_api.c
â¢analogout_api.c
â¢dma_api.c
â¢i2c_api.c
â¢pwmout_api.c
â¢spi_api.c
â¢dma_api_hal.h
ãã©ã€ããŒ
â¢AnalogIn.cpp
â¢I2C.cpp
â¢I2CSlave.cpp
â¢SPI.cpp
â¢SPISlave.cpp
â¢AnalogIn.h
â¢AnalogOut.h
â¢I2C.h
â¢I2CSlave.h
â¢PwmOut.h
â¢SPI.h
â¢SPISlave.h
ãã«
â¢analogin_api.h
â¢analogout_api.h
â¢i2c_api.h
â¢pwmout_api.h
â¢spi_api.h
- mbed.hãã¡ã€ã«ãç·šéããŠãåé€ãããã¡ã€ã«ã®æ¥ç¶ãã³ã¡ã³ãåããŸãã object.hãç·šéããŸã ã
- ã·ã¹ãã ãã¯ã©ãã·ã¥ãããšãã«åŒã³åºãããmbed_dieé¢æ°ãç·šéããŸããã ã ããã©ã«ãã§ã¯ãLEDãç¹æ» ããŸãã ç¹æ» ãåé€ããŸãããã®ãããªLEDã¯ãããŸããã
- ãã®ãã¡ã€ã«ã®åã«åé€ãããAPIã«é¢é£ä»ãããããã³ãšæ§é ã®å®£èšãããPinNames.hããã³PeripheralNames.hãã¡ã€ã«ãã¯ãªã¢ããŸã
- PeripheralPins.cãã¡ã€ã«å ã®äžèŠãªé åãåé€ããåŸããã®äžã®UARTã®ãã³ããããç·šéããããã ãã«æ®ããŸãã
- ãã£ã¬ã¯ããªã®æ§é ãšã¿ãŒã²ããã®ãµããã£ã¬ã¯ããªå ã®ãã¡ã€ã«ã®å Žæããããã«å€æŽããŠããã¡ã€ã«ã®åœåãšæçåã®ã©ã³ãã æ§ãæžãããŸãã
ä¿®æ£ãå¿ èŠãªæ®ãã®ãã¡ã€ã«ã®ãªã¹ãïŒ
â¢serial_api.c
â¢trng_api.c
â¢flash_api.c
â¢sleep.c
â¢us_ticker.c
éèŠãªRTOSãµãŒãã¹ã¯ãã¡ã€ã«ã«äŸåããŠããããããããã®ãã¡ã€ã«ãåçŽã«åé€ããããšã¯ã§ããŸããã åé¡ã¯ãäž»ã«ã MKE18F512xxx16ãã¡ããªãMK66FN2M0VMD18ãšã¯ç°ãªãåšèŸºåã䜿çšããŠããããšã§ãããã¡ã€ã³APIã®åšèŸºã¯å®è³ªçã«å€æŽãããŠããŸããã
ãã¡ã€ã«serial_api.c
åºæ¬çã«ãK66ãããããç¶æ¿ãããé¢æ°ãšåæã®ååãå€æŽããŸãã ãã®ãã¡ã€ã«ã¯ãUARTãä»ããŠRTOSåºåããããã°ããããã®äœã¬ãã«é¢æ°ãå®çŸ©ããŸãã
Us_ticker.cãã¡ã€ã«
RTOSã®ãã£ãã¯ã§æ£ç¢ºãªæéãååŸããã¡ã«ããºã ã決å®ãããšããç¹ã§éèŠã§ãïŒãã®äŸã§ã¯ããã£ãã¯å€ã¯1ÎŒsã§ãïŒã ãã®APIã¯ãRTOSé 延é¢æ°ãšãã¿ã€ã ã©ã€ã³ã§æå®ãããã¢ã¯ãã£ããŒã·ã§ã³æéãæã€ã€ãã³ããã¥ãŒãµãŒãã¹ã§äœ¿çšãããŸãã é£ç¶æéã«ãŠã³ã¿ãŒãç·šæããã«ã¯ãPITã¢ãžã¥ãŒã«ã®é¢é£ãã£ã³ãã«0ããã³1ã䜿çšãããŸãã ãã£ãã«0ã®åšæã¯1ÎŒsã§ããã£ãã«1ã¯429ç§åŸã«ãµã€ã¯ã«ãçµäºããŸãïŒ0xFFFFFFFFãããŒãããããã£ãã«ã«ãŠã³ã¿ããã¯ãªã¡ã³ããããŸãïŒã ã€ãã³ããã¥ãŒãæŽçããã«ã¯ãPITã¢ãžã¥ãŒã«ã®ãã£ãã«2ãš3ã䜿çšãããã£ãã«3ããã®å²ã蟌ã¿ã䜿çšããŸãããããã£ãŠãMbedã¯PITã¢ãžã¥ãŒã«å šäœãå æããä»ã«ã¯äœ¿çšã§ããªãããšãããããŸãã
Trng_api.cãã¡ã€ã«
ããŒããŠã§ã¢ä¹±æ°çæãå®è£ ããŸãã MKE18F512xxx16ãããã«ã¯ãã®ãããªãžã§ãã¬ãŒã¿ãŒããªããããæšæºCé¢æ°randããã¹ã¿ããé 眮ããŸãã SSLããã³TLSããŒã¿æå·åãããã³ã«ã«ã¯ãé©åãªä¹±æ°ãžã§ãã¬ãŒã¿ãŒãå¿ èŠã§ãã ãããŸã§ã®ãšãããããŒãäžã§ãã®ãããªãã®ã䜿çšããäºå®ã¯ãããŸãããSleep.cãã¡ã€ã«
ã¹ãªãŒãã¢ãŒãã®éå§ãšçµäºã®æ©èœãå®è£ ããŸãã ãã®å Žåããã©ãã·ã¥ã¡ã¢ãªãæäœããããã®ã¢ã¯ã»ã©ã¬ãŒã¿ã®åäœã圱é¿ãåããŸãã ãã©ãã·ã¥ã¡ã¢ãªãã£ãã·ã¥ãæå¹ãŸãã¯ç¡å¹ã«ããé¢æ°ã®ååã調æŽããå¿ èŠããããŸããFlash_api.cãã¡ã€ã«
å éšãã©ãã·ã¥ã¡ã¢ãªãããã°ã©ãã³ã°ããããã®é¢æ°ãå®è£ ããŸãã ããã§ã MKE18F512xxx16ãã¡ããªã®ãããã«ã¯ããã©ãã·ã¥ã¡ã¢ãªã®2ã€ã®ã»ã¯ã·ã§ã³ãååšããå¯èœæ§ããããšããäºå®ã«åºäŒããŸããã ã»ã¯ã·ã§ã³0ã§éžæãããäœåã-ãã¡ã€ã«system_MKE18F16.hã®ãããã®å éšåšæ³¢æ°ã®å€ã䜿çšããŠãã¯ããä¿®æ£ããŸãã
ãªã³ã«ãŒãã¡ã€ã«MKE18F512xxx16_flash.icfã
__VECTOR_RAMæåã®å®£èšãå¿ èŠã§ãã ããã¯ãRAMå ã®å²ã蟌ã¿ãã¯ã¿ãŒã®ããŒãã«ãé 眮ãããã¢ãã¬ã¹ã§ãã Mbed OSã§ã¯ãåäœäžã«ã·ã¹ãã ã«ãã£ãŠããã°ã©ã ã«ãã£ãŠå€æŽã§ãããããå²ã蟌ã¿ãã¯ã¿ãŒããŒãã«ã¯åžžã«ãã©ãã·ã¥ããRAMã«ã³ããŒãããŸãã
奜å¥å¿
圌ãã¯ããã¯ãã«SVC_Handlerã«ã¹ã¿ãããããããèªäœã«åºå®ãããŠãããšããäºå®ã«ééããŸããã ãããŠã Mbed OSã®åæåã¯ãã®ç¹å®ã®ãã¯ãã«ãåŒã³åºããŸãã ã©ããã§æ£ãããã¯ã¿ãŒã®ã€ã³ã¹ããŒã«ã®ç¬éãéããŠããŸãã 倧æåã®æ¡åŒµåãæã€ã¢ã»ã³ãã©ãã¡ã€ã«ãIARã«æ¥ç¶ããã®ãå¿ããŠããããšãããããŸããã ãããŠãã³ã³ããã¹ãã¹ã€ããã§æãéèŠãªãã¡ã€ã«ã¯irq_cm4f.Sã§ãã Pythonã«æè¬ããŸãã Convert_ewp_file.pyãŠãŒãã£ãªãã£ãä¿®æ£ããŠãå床å®è¡ããŸãã ãããžã§ã¯ããåã³ã³ãã€ã«ããŸãã
æ»ãã ãããã埩掻ãããæ¹æ³
GPIOããŒããåæåãããšãã誀ã£ãŠãããã¬ãŒãšã¯ã©ãŒãã®I / Oã©ã€ã³ã誀ã£ãŠåæåããå¯èœæ§ããããŸãã ãã®å Žåããããã¯ãããã°ãåæ¢ããJ-Link SWDã¢ããã¿ãŒã§ã®ããã°ã©ãã³ã°ãåæ¢ããŸãã ãã®å Žåãåé¡ã¯ç°¡åã«è§£æ±ºã§ããŸãã å€éšã¯ã©ãŒãã®1ã€ã®åºåãã°ã©ã³ãã«ç絡ããé»åãé€å»ããŠããå床å°å ããŸãã ç§ãã¡ã®ããã°ã©ã ã¯ãã¯ã©ãŒãã®å å«ãåŸ ã£ãŠç«ã¡åŸçãããããGPIOã®èª€ã£ãåæåã«å°éããŸããã ãã®æç¹ã§ãSWDã¢ããã¿ãŒã®ããã°ã©ãã³ã°ãåã³äœ¿çšå¯èœã«ãªããŸãã
äžæ£ç¢ºãªåŸ æ©æéé 延æ©èœã®åŸ æ©ã®åé¡
LEDã®ç¹æ» åšæã枬å®ããããšã«ããã åŸ æ©æ©èœã®å®è¡ã®ã¹ããŒããŠã³ããäºæ³ããã2åé·ãæ€åºãããŸããã å éšåšæ³¢æ°èšå®ã®æ£ç¢ºãã確èªããããã«ãåºåã8ã§å²ã£ãå éšPLLãããã¯ã®å€éšåºåã«åæåããŸãã21MHzã®åšæ³¢æ°ã確èªããŸãã ãã¹ãŠæ£ããã§ãã
RTX_Config.hãã¡ã€ã«ã§ãã©ã¡ãŒã¿ãŒãèšå®ãããŠããRTX ãã£ãã¯åšæ³¢æ°ãåæåãããšãã SystemCoreClockå€æ°ã䜿çšãããã·ã¹ãã åæåäžã«BOARD_BootClockHSRUNé¢æ°ã§å²ãåœãŠããã 168000000ã«çãããªããŸããããã§ãããã¹ãŠãæ£ããã§ãã
IARãããã¬ãŒã®TimeLineãŠã£ã³ããŠã§ç¢ºèªãããšãã·ã¹ãã ãã£ãã¯ã®äžæã®é »åºŠã¯1 KHzã§ããããæ£ããã§ãã
PITã¢ãžã¥ãŒã«ã誀ã£ãŠåæåãããããšãå€æããŸããã 圌ã¯ã RTXãã¹ãªãŒãã¢ãŒãã«å ¥ã£ããšãã«ã«ãŠã³ããåæ¢ããŸããã ãŸããã¢ã¯ãã£ããªã¿ã¹ã¯ããªãå Žåã RTXã¯ãã£ãã¯ããšã«ãã®ã¢ãŒãã«åãæ¿ãããŸãã ãããã£ãŠãã¿ã€ããŒã¯åæ¢ããŸããããæãæ£ç¢ºãªé 延ã確ä¿ããããã«ããã®å€ãåŸ æ©æ©èœã§äœ¿çšãããŸããã ããããK66ã®å ¬åŒMbedããŒããããã®ãšã©ãŒãç¶æ¿ããŸããïŒ
3æ¥ç®ã«ã ARM Mbed OSã®ç§»æ€ãæ£åžžã«å®äºããLEDãç¹æ» ããŸãã
github.com/Indemsys/Mbed_led_blinky_MKE18F