不同型号的单片机芯片型号库函数一样吗

1421人阅读
LM3S系列的芯片对于芯片有固化驱动库和没有固化驱动库的区别
LM3S系列的芯片对于芯片有固化驱动库和没有固化驱动库的区别
今天在选型的时候发现,有一个区别,对于有Stellarisware in rom 和没有Stellarisware in rom的LM3S型号的芯片在使用驱动库函数的时候有什么区别吗,固化和没固化有什么优势吗?
1,TI Stellaris系列MCU有一个非常有优势的特点,就是免费提供称为StellarisWare的固件开发包,如果没有安装,请到TI网站搜索下载并安装。
2, TI Stellaris系列MCU的ROM根据型号的不同,可能会包含ROM Software Libraries, ROM Bootloader,ROM AES/CRC Tables。一般ROM Software Libraries与ROM Bootloader同时存在,而ROM AES/CRC Tables则不一定。
3,在 StellarisWare安装目录下的docs文件夹下,有《SW-DRL-UG-xxxx》(xxxx代表StellarisWare的发布版本号),它是Stellaris(R) Peripheral Driver Library USER’S GUIDE。第26章“Using the ROM”会对于ROM的使用有详细的讲解。
为了大家的方便,简单摘录几段如下:
“26.1& & Introduction
By utilizing the code in the on-chip ROM, more flash is available for use by the application.
The boot loader is also contained within the ROM, which can be called by an application in order to
start a firmware update.”
“26.2& & Direct ROM Calls
In order to call the ROM, the following steps must be performed:
1,The device on which the application will be run must be defined.&&This is done by defining a
preprocessor symbol, which can be done either within the source code or in the project that
builds the application. The later is more flexible if code is shared between projects.
2, driverlib/rom.h is included by the source code desiring to call the ROM.
3, The ROM version of a peripheral driver library function is called. For example, if GPIODirMod-
eSet() is to be called in the ROM, ROM_GPIODirModeSet() is used instead.
A define is used to to select the device being used since the set of functions available in the ROM
must be a compile- checking at run-time does not provide any flash savings since
both the ROM call and the flash version of the API would be in the application flash image.
The following defines are recognized by driverlib/rom.h:
TARGET_IS_DUSTDEVIL_RA0& &The application is being built to run on a DustDevil-class de-
vice, silicon revision A0.
TARGET_IS_TEMPEST_RB1& && & The application is being built to run on a Tempest-class device,
silicon revision B1.
By using ROM_Function(), the ROM will be explicitly called. If the function in question is not avail-
able in the ROM, a compiler error will be produced.
See the Stellaris ROM User’s Guide for details of the APIs available in the ROM.”
“26.3& & Mapped ROM Calls
When code is intended to be shared between projects, and some of the projects run on devices with
a ROM and some run on devices without a ROM, it is convenient to have the code automatically
call the ROM or the flash version of the API without having #ifdef-s in the code.&&rom_map.h
provides an automatic mapping feature for accessing the ROM. Similar to the ROM_Function()
APIs provided by rom.h, a set of MAP_Function() APIs are provided. If the function is available in
ROM, MAP_Function() will simply call ROM_Function(); otherwise it will call Function().
In order to use the mapped ROM calls, the following steps must be performed:
1, Follow the above steps for including and using driverlib/rom.h.
2, Include driverlib/rom_map.h.
3, Continuing the above example, call MAP_GPIODirModeSet() in the source code.
As in the direct ROM call method, the choice of calling ROM versus the flash version is made at
compile-time.&&The only APIs that are provided via the ROM mapping feature are ones that are
available in the ROM, which is not every API available in the peripheral driver library.
The following is an example of calling a function in shared code, where the device in question is
defined in the project file:
#include&&&driverlib/rom.h&
#include&&&driverlib/rom_map.h&
#include&&&driverlib/systick.h&
SetupSysTick(void)
& & MAP_SysTickPeriodSet(0x1000);
& & Map_SysTickEnable();
Luminary Micro先后推出3代Stellaris(群星)系列ARM,都采用性能先进的Cortex-M3处理器内核:
第一代:Sandstorm(沙暴)
第二代:Fury(狂暴)
第三代:DustDevil(尘魔)
近期,有多个客户在咨询Luminary第三代产品DustDevil家族内部集成的ROM库函数如何使用的问题,现总结如下,供大家参考交流:
驱动库函数固化在ROM当中,好处有:
1. 不会占用用户的任何Flash资源
2. 最大限度提高代码密度
3. 加快程序执行速度
4. 这是Luminary免费提供的,不存在版权问题(royalty-free)
5. 固化的驱动库同时也是bootloader(即ISP下载),提供UART、I2C、SSI等多种接口
【ROM库函数用法1】
● 首先保证你使用的芯片属于Luminary Micro第三代产品DustDevil家族,如LM3S5749
● 在程序的开头做如下定义:
& & #define&&TARGET_IS_DUSTDEVIL_RA0
& & #include&&&rom.h&
● 然后在每个调用的库函数名前面加上ROM_前缀就可以了
【ROM库函数用法2】
● 首先保证你使用的芯片属于Luminary Micro第三代产品DustDevil家族,如LM3S5749
● 在程序的开头做如下定义:
& & #define&&TARGET_IS_DUSTDEVIL_RA0
& & #include&&&rom_map.h&
& & #include&&&rom.h&
● 然后在每个调用的库函数名前面加上MAP_前缀就可以了
前缀MAP_要比前缀ROM_可移植性好
【注意事项】
& & 驱动库版本不能太旧,否则不会支持ROM库特性
& & ROM库不支持某些库函数,如SysCtlDelay()
参考知识库
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:578006次
积分:7688
积分:7688
排名:第2083名
原创:70篇
转载:844篇
评论:41条
(19)(84)(148)(25)(72)(13)(12)(24)(6)(6)(2)(8)(1)(3)(3)(2)(13)(6)(1)(14)(24)(42)(17)(21)(53)(84)(49)(29)(20)(55)(34)(19)(1)(3)(9)(3)(1)(2)(6)(9)(6)(3)(1)(10)(8)(7)(1)(1)更多公众号:strongerHuang该公众号定位于"EmbeddDeveloper",即嵌入式开发。适用人群:技术开发人员,包括大学计算机电子等专业学生、想转行做技术开发的人、工作之后从事技术开发的人等。免费分享、交流个人技术知识,欢迎加入。最新文章相关作者文章搜狗:感谢您阅读关于STM32软硬件兼容性相关的知识,本文由网友投稿产生,如果侵犯了您的相关权益,请联系管理员。}

我要回帖

更多关于 u盘芯片型号怎么看 的文章

更多推荐

版权声明:文章内容来源于网络,版权归原作者所有,如有侵权请点击这里与我们联系,我们将及时删除。

点击添加站长微信