This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
工具与软件:
您好!
我已从 ROM 表中读取 ROM_VERSION、找到769。 如何将其转换为 rom.h 使用的#define 值?
无需知道 ROM 的版本。 在芯片制造期间、ROM 代码被永久编程到 ROM 存储器中。 代码冻结后可能已超过10年。 我们建议客户直接调用 map_xyz 而不是 rom_xyz。 ROM 中的一些 API 已被弃用。 如果 ROM 中的 API 仍然有效、则调用 map_xyz 将导致调用 rom_xyz、否则将调用 driverlib.lib 中库的 xyz。 在您的 CCS 工程中、您只需定义您拥有的器件和芯片版本。
Refer to the below description.
34.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() simply calls ROM_Function(); otherwise it calls Function().
In order to use the mapped ROM calls, the following steps must be performed:
Follow the above steps for including and using driverlib/rom.h.
Include driverlib/rom_map.h.
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();
}
When built for a device that does not have a ROM, this example is equivalent to:
#include "driverlib/systick.h"
void
SetupSysTick(void)
{
SysTickPeriodSet(0x1000);
SysTickEnable();
}
When built for a device that has a ROM, however, this example is equivalent to:
#include "driverlib/rom.h"
#include "driverlib/systick.h"
void
SetupSysTick(void)
{
ROM_SysTickPeriodSet(0x1000);
ROM_SysTickEnable();
谢谢、我将使用地图版本来实现这种可移植性。 我想我的问题应该是如何找到我正在使用的芯片版本? 1毫米
您好、Sam、
[报价 userid="611830" url="~/support/microcontrollers/arm-based-microcontrollers-group/arm-based-microcontrollers/f/arm-based-microcontrollers-forum/1381130/tm4c1290ncpdt-finding-rom-version/5277634 #5277634"]是的。
可以通过两种方法做到这一点。 您可以读取器件 ID 寄存器。 请参见下文。 您还可以直观地查看 IC 上的器件标识。