LM3S系列的芯片对于芯片有固化驱动库和没有固化驱动库的区别

2019-03-24 14:25发布

LM3S系列的芯片对于芯片有固化驱动库和没有固化驱动库的区别 今天在选型的时候发现,有一个区别,对于有Stellarisware in rom 和没有Stellarisware in rom的LM3S型号的芯片在使用驱动库函数的时候有什么区别吗,固化和没固化有什么优势吗? 此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
4条回答
beloved
2019-03-25 05:30
首先感谢你对TI Stellaris系列MCU的关注。
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® 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-time decision; 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"

void
SetupSysTick(void)
{
    MAP_SysTickPeriodSet(0x1000);
    Map_SysTickEnable();
}”

一周热门 更多>

相关问题

    相关文章