1、安裝Keil MDK。
略。
2、安裝芯片對應的Pack包。
(1)這里以MM32F0130單片機為例。
(2)進入靈動微電子官網(wǎng)。上海靈動微電子股份有限公司
(3)點擊“支持”→“KEILPacl”。
(3)點擊下載Pack包。
(4)下載后,解壓下載的壓縮包,找到對應的Pack包,雙擊安裝即可。
3、下載示例工程并編譯
(1)點擊“支持”→“評估開發(fā)板”。
(2)選擇對應的開發(fā)板。
(3)點擊下載庫函數(shù)和例程。
(5)打開路徑""下的任意一個示例代碼。
(6)編譯。
4、創(chuàng)建一個新的工程
4.1、環(huán)境
(1)Keil MDK:V5.38.0.0
4.2、Kei創(chuàng)建工程
(1)創(chuàng)建Keil工程,并創(chuàng)建如下文件文組。
4.3、項目文件夾結構
E:\MM32_Project\MM32F0130_Project_LED
├Device
│ ├CMSIS
│ │ ├KEIL_Core
│ │ │ ├arm_common_tables.h
│ │ │ ├arm_const_structs.h
│ │ │ ├arm_math.h
│ │ │ ├cmsis_armcc.h
│ │ │ ├cmsis_armclang.h
│ │ │ ├cmsis_compiler.h
│ │ │ ├cmsis_gcc.h
│ │ │ ├core_armv8mbl.h
│ │ │ ├core_armv8mml.h
│ │ │ ├core_cm0.h
│ │ │ ├core_cm0plus.h
│ │ │ ├core_cm23.h
│ │ │ ├core_cm3.h
│ │ │ ├core_cm33.h
│ │ │ ├core_cm4.h
│ │ │ ├core_cm7.h
│ │ │ ├core_sc000.h
│ │ │ ├core_sc300.h
│ │ │ ├tz_context.h
│ ├MM32F013x
│ │ ├HAL_Lib
│ │ │ ├Inc
│ │ │ │ ├dtype.h
│ │ │ │ ├hal_adc.h
│ │ │ │ ├hal_bkp.h
│ │ │ │ ├hal_can.h
│ │ │ │ ├hal_comp.h
│ │ │ │ ├...
│ │ │ ├Src
│ │ │ │ ├hal_adc.c
│ │ │ │ ├hal_bkp.c
│ │ │ │ ├hal_can.c
│ │ │ │ ├hal_comp.c
│ │ │ │ ├...
│ │ ├Include
│ │ │ ├m(xù)m32_device.h
│ │ │ ├m(xù)m32_reg.h
│ │ │ ├m(xù)m32_reg_redefine_v1.h
│ │ │ ├reg_adc.h
│ │ │ ├reg_bkp.h
│ │ │ ├reg_can.h
│ │ │ ├reg_common.h
│ │ │ ├reg_comp.h
│ │ │ ├reg_crc.h
│ │ │ ├reg_crs.h
│ │ │ ├reg_dbg.h
│ │ │ ├reg_div.h
│ │ │ ├reg_dma.h
│ │ │ ├reg_exti.h
│ │ │ ├reg_flash.h
│ │ │ ├reg_gpio.h
│ │ │ ├reg_i2c.h
│ │ │ ├reg_iwdg.h
│ │ │ ├reg_pwr.h
│ │ │ ├reg_rcc.h
│ │ │ ├reg_rtc.h
│ │ │ ├reg_spi.h
│ │ │ ├reg_syscfg.h
│ │ │ ├reg_tim.h
│ │ │ ├reg_uart.h
│ │ │ ├reg_usb.h
│ │ │ ├reg_wwdg.h
│ │ │ ├types.h
│ │ ├Source
│ │ │ ├KEIL_StartAsm
│ │ │ │ ├startup_mm32f013x_keil.s
│ │ │ ├system_mm32f013x.c
├Doc
├MDK_Project
│ ├LED.uvguix.zjd
│ ├LED.uvoptx
│ ├LED.uvprojx
│ ├Listings
│ ├Objects
├User_Code
│ ├HARDWARE
│ │ ├LED
│ │ │ ├led.c
│ │ │ ├led.h
│ ├SYSTEM
│ │ ├DELAY
│ │ │ ├delay.c
│ │ │ ├delay.h
│ │ ├SYS
│ │ │ ├sys.c
│ │ │ ├sys.h
│ │ ├UART
│ │ │ ├uart.c
│ │ │ ├uart.h
│ ├USER
│ │ ├m(xù)ain.c
│ │ ├m(xù)ain.h
4.4、移植必要文件
(1)STARTUP中移植的文件
- system_mm32f013x.c
- startup_mm32f013_keil.s
(2)HARDWARE中移植的文件
(3)SYSTEM中移植的文件
(4)USER中移植的文件
(5)HAL_Lib中移植的文件
4.5、編寫main.c文件
(1)從下載的示例中復制一個。
4.6、添加頭文件路徑
略
4.7、取消GNU擴展
(1)不取消這個會報很多警告。
(2)點擊“Options for Target...”(魔法棒)
(3)點擊“C/C++”,取消勾選“GNU extensions”。
4.8、編譯執(zhí)行
(1)編譯結果文章來源:http://www.zghlxwxcb.cn/news/detail-713440.html
文章來源地址http://www.zghlxwxcb.cn/news/detail-713440.html
到了這里,關于一、靈動mm32單片機_開發(fā)環(huán)境的搭建(Keil)的文章就介紹完了。如果您還想了解更多內(nèi)容,請在右上角搜索TOY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關文章,希望大家以后多多支持TOY模板網(wǎng)!