STM32固件庫(kù)V3.4移值到Keil MDK v4.12 圖文詳解
2:首先按下圖所示建立相應(yīng)用的文件夾,注意層次關(guān)系:


4:接著就打開Keil MDK V4.12,新建一個(gè)工程并選擇好器件:



5:下圖是建好組后的圖并在CoreSupport組里“Add Files”了一個(gè)文件:







11:“Output”文件夾用以存放你所勾選項(xiàng)目產(chǎn)生的“Debug Information”、"Create HEX File"和“Brower library”信息或文件。
接著就是點(diǎn)"Listing"標(biāo)簽頁(yè),設(shè)置方法和上圖相同。
12:點(diǎn)標(biāo)簽頁(yè)“C/C++”,這頁(yè)的設(shè)置很重要,首先加入這個(gè)宏:



14:這時(shí)在“Output”和“Listing”文件夾里就有了許多文件:


15:最后到了J-LINK仿真下載器相關(guān)項(xiàng)的設(shè)置。
下圖主要是右半部分的設(shè)置:

緊接著就是點(diǎn)上圖藍(lán)色背景右邊的"Settings"按鈕,不要忘了接上STM32開發(fā)板的電源和J-LINK,還要裝好J-LINK的驅(qū)動(dòng),按下圖設(shè)置好:

16:接著上圖所示點(diǎn)“Flash Download”標(biāo)簽頁(yè)并按實(shí)際況設(shè)置好:

17:還有最后一步,看下圖:


18:給大家一點(diǎn)設(shè)置的參考吧:
需在工程項(xiàng)目C/C++里面Define添加:USE_STDPERIPH_DRIVER,STM32F10X_HD
STM32F10X_LD---STM32小容量芯片
STM32F10X_MD---STM32中容量芯片
STM32F10X_HD---STM32大容量芯片
STM32F10X_CL---STM32互聯(lián)網(wǎng)型芯片105/107等
USE_STDPERIPH_DRIVER---使用庫(kù)里面的API函數(shù)
在工程里面添加相應(yīng)芯片的啟動(dòng)文件:
STM32F10X_LD.S
STM32F10X_MD.S
STM32F10X_HD.S
STM32F10X_CL.S
在system_stm32f10x.c修改工作頻率,默認(rèn)為72MHz,在外部晶振為8MHz的情況下。
STM32F10X_MD---STM32中容量芯片
STM32F10X_HD---STM32大容量芯片
STM32F10X_CL---STM32互聯(lián)網(wǎng)型芯片105/107等
USE_STDPERIPH_DRIVER---使用庫(kù)里面的API函數(shù)
在工程里面添加相應(yīng)芯片的啟動(dòng)文件:
STM32F10X_LD.S
STM32F10X_MD.S
STM32F10X_HD.S
STM32F10X_CL.S
在system_stm32f10x.c修改工作頻率,默認(rèn)為72MHz,在外部晶振為8MHz的情況下。
19:手上還有IAR FOR ARM 6.10 的STM32固件庫(kù)移植成功的模板,有需有的朋友請(qǐng)留言給我。
20:至于為什么為這樣設(shè)置,我就不再說(shuō)了,網(wǎng)上有很多相關(guān)的資料。
評(píng)論