{"id":2205,"date":"2014-03-05T14:06:10","date_gmt":"2014-03-05T05:06:10","guid":{"rendered":"http:\/\/oohito.com\/nqthm\/?p=2205"},"modified":"2014-03-05T14:06:10","modified_gmt":"2014-03-05T05:06:10","slug":"maverics-stm32f4discovery-2","status":"publish","type":"post","link":"https:\/\/oohito.com\/nqthm\/archives\/2205","title":{"rendered":"OS X(Mavericks)\u306bSTM32F4DISCOVERY\u7528\u306e\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\u3059\u308b\uff08\u30b5\u30f3\u30d7\u30eb\u30d3\u30eb\u30c9\u7de8\uff09"},"content":{"rendered":"<p><a href=\"http:\/\/oohito.com\/nqthm\/archives\/2201\" title=\"OS X(Maverics)\u306bSTM32F4DISCOVERY\u7528\u306e\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\uff08\u6e96\u5099\u7de8\uff09\">\u524d\u56de<\/a>\u306b\u5f15\u304d\u7d9a\u3044\u3066\u3001STM32F4DISCOVERY\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30d3\u30eb\u30c9\u306b\u3064\u3044\u3066\u8aac\u660e\u3059\u308b\u3002<br \/>\nSTM32\u306e\u958b\u767a\u74b0\u5883\u306f\u6709\u511f\u3001\u7121\u511f\u3082\u542b\u3081\u3066\u3044\u308d\u3044\u308d\u3042\u308b\u3088\u3046\u3060\u304c\u3001Eclipse\u306e\u3088\u3046\u306a\u25cb\u25cb\u306a\u3082\u306e\u3092\u4f7f\u3044\u305f\u304f\u306a\u3044\u306e\u3067\uff08\u25cb\u25cb\u306f\u304a\u6c17\u306b\u5165\u308a\u306e\u8a00\u8449\u3092\u633f\u5165\uff09\u3001Emacs\u304a\u3088\u3073\u30b7\u30a7\u30eb\u3092\u7528\u3044\u3066\u958b\u767a\u3092\u884c\u3046\u3053\u3068\u306b\u3059\u308b\u3002<br \/>\n<!--more--><\/p>\n<h2>\u60c5\u5831\u6e90<\/h2>\n<p>\u307e\u305a\u306f\u958b\u767a\u3092\u884c\u3046\u306e\u306b\u5fc5\u8981\u306a\u60c5\u5831\u6e90\u304b\u3089\u3002<br \/>\n<a href=\"http:\/\/www.st.com\/web\/jp\/catalog\/tools\/FM116\/SC959\/SS1532\/LN1848\/PF252419\">STMicroelectronics\u306eSTM32F4DISCOVERY\u30da\u30fc\u30b8<\/a><br \/>\n\u307e\u305f\u3001\u3053\u306e\u8a18\u4e8b\u306f<a href=\"https:\/\/github.com\/yamanekko\/stm32f4discovery\/wiki\/Setup-for-Mac-OS-X\">Setup for Mac OS X<\/a>\u3092\u53c2\u8003\u306b\u3057\u3066\u3044\u308b\u3002<\/p>\n<h2>firmware package\u306e\u5165\u624b<\/h2>\n<p>\u5148\u307b\u3069\u306eSTM\u793e\u306e\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u304b\u3089\u3001\u30b5\u30f3\u30d7\u30eb\u3092\u542b\u3081\u305f\u30e9\u30a4\u30d6\u30e9\u30ea\uff06\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u304c\u5165\u624b\u3067\u304d\u308b\u3002<br \/>\n<a href=\"http:\/\/www.st.com\/web\/jp\/catalog\/tools\/PF257904\">STSW-STM32068<\/a>\u306e\u30da\u30fc\u30b8\u306e\u4e0b\u306e\u65b9\u306b\u300c\u30b5\u30f3\u30d7\u30eb&#038;\u8cfc\u5165\u300d\u3068\u3044\u3046\u6b04\u304c\u3042\u308a\u3001STSW-STM32068\u306e\u9805\u306eDownload\u30dc\u30bf\u30f3\u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001stsw-stm32068.zip\u30d5\u30a1\u30a4\u30eb\u304c\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3067\u304d\u308b\u3002<br \/>\n\u30c0\u30a6\u30f3\u30ed\u30fc\u30c9\u3057\u305fzip\u30d5\u30a1\u30a4\u30eb\u3092\u5c55\u958b\u3059\u308b\u3068\u3001STM32F4-Discovery_FW_V1.1.0\u30d5\u30a9\u30eb\u30c0\u306e\u4e2d\u306b\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u30d5\u30a1\u30a4\u30eb\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u304c\u73fe\u308c\u308b\u3002<\/p>\n<pre>STM32F4-Discovery_FW_V1.1.0\/\n +-- Libraries\/\n +-- MCD-ST Liberty SW License Agreement 20Jul2011 v0.1.pdf\n +-- Project\/\n +-- Release_Notes.html\n +-- Utilities\/\n +-- _htmresc<\/pre>\n<p>\u3053\u308c\u3089\u306e\u30d5\u30a1\u30a4\u30eb\u30fb\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306f\u5f8c\u3067\u4f7f\u3046\u306e\u3067\u5c55\u958b\u3057\u305f\u5834\u6240\u3092\u899a\u3048\u3066\u304a\u304f\u3002<\/p>\n<h2>\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u4f5c\u6210<\/h2>\n<p>\u958b\u767a\u3092\u884c\u3046\u969b\u306e\u3072\u306a\u5f62\u3068\u306a\u308b\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u3092\u4f5c\u6210\u3059\u308b\u3002<br \/>\n\u6700\u7d42\u7684\u306a\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u69cb\u6210\u306f\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u306a\u308b\u3002<\/p>\n<pre>sample\/ (\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u30d9\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea)\n +-- inc (\u30d8\u30c3\u30c0\u30fc\u30d5\u30a1\u30a4\u30eb)\n +-- src (\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb)\n +-- Libraries (\u30e9\u30a4\u30d6\u30e9\u30ea: STM32F4-Discovery_FW_V1.1.0\u304b\u3089\u30b3\u30d4\u30fc)\n +-- Utilities (\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3: STM32F4-Discovery_FW_V1.1.0\u304b\u3089\u30b3\u30d4\u30fc)\n +-- Makefile\n +-- stm32_flash.ld (\u30ea\u30f3\u30ab\u7528\u30b9\u30af\u30ea\u30d7\u30c8)<\/pre>\n<p>\u9069\u5f53\u306a\u5834\u6240\u306b\u30d9\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3068\u521d\u671f\u7684\u306a\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre>mkdir sample\nmkdir sample\/inc\nmkdir sample\/src\ncd sample<\/pre>\n<h3>Libraries\u3068Utilities\u306e\u30b3\u30d4\u30fc<\/h3>\n<p>\u30e9\u30a4\u30d6\u30e9\u30ea\u3068\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3092stsw-stm32068.zip\u3092\u5c55\u958b\u3057\u305f\u3082\u306e\u304b\u3089\u30b3\u30d4\u30fc\u3059\u308b\u3002zip\u30d5\u30a1\u30a4\u30eb\u3092\u5c55\u958b\u3057\u305f\u5834\u6240\u3092~\/Downloads\u3068\u3059\u308b\u3068\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306b\u30b3\u30d4\u30fc\u3059\u308c\u3070\u3088\u3044\u3002\uff08\u30bd\u30fc\u30b9\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u6700\u5f8c\u306b\/\u3092\u4ed8\u3051\u306a\u3044\u306e\u306b\u6c17\u3092\u3064\u3051\u3066\uff09<\/p>\n<pre>cp ~\/Downloads\/STM32F4-Discovery_FW_V1.1.0\/Libraries .\ncp ~\/Downloads\/STM32F4-Discovery_FW_V1.1.0\/Utilities .<\/pre>\n<h3>inc\u3068src\u306e\u4f5c\u6210<\/h3>\n<p>inc\u3068src\u306e\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u30b5\u30f3\u30d7\u30eb\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3059\u308b\u3002\u5143\u306b\u3059\u308b\u306e\u306fSTM32F4-Discovery_FW_V1.1.0\u306eProjects\u306b\u3042\u308bIO_Toggle\u3068\u3059\u308b\u3002\u3053\u306e\u30b5\u30f3\u30d7\u30eb\u306f\u5b9f\u884c\u3059\u308b\u3068\u4e2d\u592e\u306b4\u3064\u3042\u308bLED\u3092\u9806\u306b\u70b9\u706f\u3059\u308b\u306e\u3092\u7e70\u308a\u8fd4\u3059\u3068\u3044\u3046\u3082\u306e\u3067\u3042\u308b\u3002<\/p>\n<pre>cp ~\/Downloads\/STM32F4-Discovery_FW_V1.1.0\/Project\/Peripheral_Examples\/IO_Toggle\/stm32f4xx_it.h inc\/\ncp ~\/Downloads\/STM32F4-Discovery_FW_V1.1.0\/Project\/Peripheral_Examples\/IO_Toggle\/stm32f4xx_conf.h inc\/\ncp ~\/Downloads\/STM32F4-Discovery_FW_V1.1.0\/Project\/Peripheral_Examples\/IO_Toggle\/stm32f4xx_it.c src\/\ncp ~\/Downloads\/STM32F4-Discovery_FW_V1.1.0\/Project\/Peripheral_Examples\/IO_Toggle\/main.c src\/<\/pre>\n<p>\u305d\u306e\u4ed6\u306e\u30d5\u30a1\u30a4\u30eb\u3092\u30b3\u30d4\u30fc\u3059\u308b\u3002system_stm32f4xx.c\u306b\u3064\u3044\u3066\u306f\u53c2\u8003\u30b5\u30a4\u30c8\u3067\u3082\u8aac\u660e\u3055\u308c\u3066\u3044\u308b\u3088\u3046\u306b\u3001FPU\u306e\u521d\u671f\u5316\u30b3\u30fc\u30c9\u304cIO_Toggle\u306e\u65b9\u306b\u542b\u307e\u308c\u3066\u3044\u306a\u3044\u306e\u3067\u3001CMSIS\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u3082\u306e\u3092\u5229\u7528\u3059\u308b\u3002<\/p>\n<pre>cp .\/Libraries\/CMSIS\/ST\/STM32F4xx\/Source\/Templates\/system_stm32f4xx.c src\/\ncp .\/Libraries\/CMSIS\/ST\/STM32F4xx\/Source\/Templates\/gcc_ride7\/startup_stm32f4xx.s src\/\n<\/pre>\n<p>\u30b3\u30d4\u30fc\u3059\u3079\u304d\u30d5\u30a1\u30a4\u30eb\u306f\u4ee5\u4e0a\u3060\u304c\u3001\u4e0a\u8a18\u306e\u30d5\u30a1\u30a4\u30eb\u3060\u3051\u3067\u30d3\u30eb\u30c9\u3059\u308b\u3068\u3001_exit\u306e\u53c2\u7167\u304c\u672a\u89e3\u6c7a\u3068\u306a\u3063\u3066\u3057\u307e\u3046\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u3088\u3046\u306a\u5185\u5bb9\u306e_exit.c\u3092\u4f5c\u6210\u3057\u3001src\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306b\u683c\u7d0d\u3059\u308b\u3002<\/p>\n<pre>void\n_exit(int x)\n{\n  while(1);\n}<\/pre>\n<h3>\u30ea\u30f3\u30af\u7528\u30b9\u30af\u30ea\u30d7\u30c8\u306e\u30b3\u30d4\u30fc<\/h3>\n<p>\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u30ea\u30f3\u30af\u3059\u308b\u969b\u306b\u7528\u3044\u308b\u30b9\u30af\u30ea\u30d7\u30c8\u3092\u30b3\u30d4\u30fc\u3059\u308b\u3002<\/p>\n<pre>cp ~\/Downloads\/STM32F4-Discovery_FW_V1.1.0\/Project\/Peripheral_Examples\/IO_Toggle\/TrueSTUDIO\/IO_Toggle\/stm32_flash.ld .<\/pre>\n<h3>Makefile\u306e\u4f5c\u6210<\/h3>\n<p>\u6700\u5f8c\u306b\u30b5\u30f3\u30d7\u30eb\u3092\u30d3\u30eb\u30c9\u3059\u308b\u305f\u3081\u4ee5\u4e0b\u306e\u3088\u3046\u306aMakefile\u3092\u4f5c\u6210\u3059\u308b\u3002<\/p>\n<pre>TARGET=demo.hex\nEXECUTABLE=demo.elf\nCC=arm-none-eabi-gcc\nLD=arm-none-eabi-ld\n#LD=arm-none-eabi-gcc\nAR=arm-none-eabi-ar\nAS=arm-none-eabi-as\nCP=arm-none-eabi-objcopy\nOD=arm-none-eabi-objdump\nBIN=$(CP) -O ihex\nDEFS = -DUSE_STDPERIPH_DRIVER -DSTM32F4XX -DMANGUSTA_DISCOVERY -DUSE_USB_OTG_FS -DHSE_VALUE=8000000\nMCU = cortex-m4\nMCFLAGS = -mcpu=$(MCU) -mthumb -mlittle-endian -mfpu=fpv4-sp-d16 -mfloat-abi=hard -mthumb-interwork\nSTM32_INCLUDES = -I.\/inc \\\n\t       -I.\/Libraries\/CMSIS\/Include\/ \\\n\t       -I.\/Libraries\/CMSIS\/ST\/STM32F4xx\/Include \\\n               -I.\/Libraries\/STM32F4xx_StdPeriph_Driver\/inc \\\n               -I.\/Libraries\/STM32_USB_Device_Library\/Class\/hid\/inc \\\n               -I.\/Libraries\/STM32_USB_Device_Library\/Core\/inc \\\n               -I.\/Libraries\/STM32_USB_OTG_Driver\/inc \\\n               -I.\/Utilities\/STM32F4-Discovery\n#OPTIMIZE       = -Os\nOPTIMIZE       = -g -O0\nCFLAGS\t= $(MCFLAGS)  $(OPTIMIZE)  $(DEFS) -I.\/ $(STM32_INCLUDES)  -Wl,-T,stm32_flash.ld\nAFLAGS\t= $(MCFLAGS)\n#-mapcs-float use float regs. small increase in code size\nSRC = .\/src\/main.c \\\n\t.\/src\/stm32f4xx_it.c \\\n\t.\/src\/system_stm32f4xx.c \\\n\t.\/src\/_exit.c \\\n\t.\/Utilities\/STM32F4-Discovery\/stm32f4_discovery.c \\\n\t.\/Libraries\/STM32F4xx_StdPeriph_Driver\/src\/stm32f4xx_syscfg.c \\\n\t.\/Libraries\/STM32F4xx_StdPeriph_Driver\/src\/misc.c \\\n\t.\/Libraries\/STM32F4xx_StdPeriph_Driver\/src\/stm32f4xx_gpio.c \\\n\t.\/Libraries\/STM32F4xx_StdPeriph_Driver\/src\/stm32f4xx_rcc.c \\\n\t.\/Libraries\/STM32F4xx_StdPeriph_Driver\/src\/stm32f4xx_exti.c\nSTARTUP = .\/src\/startup_stm32f4xx.s\nOBJDIR = .\nOBJ = $(SRC:%.c=$(OBJDIR)\/%.o)\nOBJ += Startup.o\nall: $(TARGET)\n$(TARGET): $(EXECUTABLE)\n\t$(CP) -O ihex $^ $@\n$(EXECUTABLE): $(SRC) $(STARTUP)\n\t$(CC) $(CFLAGS) $^ -o $@\nclean:\n\trm -f Startup.lst  $(TARGET)  $(TARGET).lst $(OBJ) $(AUTOGEN)  $(TARGET).out  $(TARGET).hex  $(TARGET).map \\\n\t $(TARGET).dmp  $(TARGET).elf<\/pre>\n<p>\u4ee5\u4e0a\u3067\u30d3\u30eb\u30c9\u74b0\u5883\u306e\u69cb\u7bc9\u306f\u5b8c\u4e86\u3067\u3042\u308b\u3002<\/p>\n<h2>\u30d3\u30eb\u30c9<\/h2>\n<p>\u30d3\u30eb\u30c9\u306f\u5358\u306bmake\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308c\u3070\u826f\u3044\u3002<br \/>\n\u7d50\u679c\u3068\u3057\u3066\u3001demo.hex\u3068demo.elf\u304c\u751f\u6210\u3055\u308c\u308b\u3002<br \/>\n<a href=\"http:\/\/oohito.com\/nqthm\/archives\/2212\" title=\"OS X(Maverics)\u306bSTM32F4DISCOVERY\u7528\u306e\u958b\u767a\u74b0\u5883\u3092\u69cb\u7bc9\uff08\u30b5\u30f3\u30d7\u30eb\u5b9f\u884c\u7de8\uff09\">\u6b21\u306e\u8a18\u4e8b<\/a>\u3067\u306f\u30b5\u30f3\u30d7\u30eb\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u5b9f\u884c\u65b9\u6cd5\u306b\u3064\u3044\u3066\u8aac\u660e\u3059\u308b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u524d\u56de\u306b\u5f15\u304d\u7d9a\u3044\u3066\u3001STM32F4DISCOVERY\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30d3\u30eb\u30c9\u306b\u3064\u3044\u3066\u8aac\u660e\u3059\u308b\u3002 STM32\u306e\u958b\u767a\u74b0\u5883\u306f\u6709\u511f\u3001\u7121\u511f\u3082\u542b\u3081\u3066\u3044\u308d\u3044\u308d\u3042\u308b\u3088\u3046\u3060\u304c\u3001Eclipse\u306e\u3088\u3046\u306a\u25cb\u25cb\u306a\u3082\u306e\u3092\u4f7f\u3044\u305f\u304f\u306a\u3044\u306e\u3067\uff08\u25cb\u25cb\u306f\u304a\u6c17\u306b\u5165\u308a&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5,35,42],"tags":[],"class_list":["post-2205","post","type-post","status-publish","format-standard","hentry","category-linux","category-mac","category-stm32"],"_links":{"self":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/2205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/comments?post=2205"}],"version-history":[{"count":0,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/posts\/2205\/revisions"}],"wp:attachment":[{"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/media?parent=2205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/categories?post=2205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/oohito.com\/nqthm\/wp-json\/wp\/v2\/tags?post=2205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}