问题标签 [lpc]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
assembly - ARM7中定义的Reset_Addr、Undef_Addr等在哪里?
我正在 LPC2119 中试验 ARM7TDMI-s 并试图找出 startup.s 代码中的内容以了解向量中断系统。
我很好奇在哪里定义了像 Reset_Addr 和 SWI_Addr 这样的标签,因为它们不在同一个文件中,也不在标题中。
感谢任何帮助。
谢谢
c - 错误:int32_t 的类型冲突
我正在努力lpcxpresso (lpc1768)
。我在我已经编写的代码中包含了一个.h
文件和两个.c
文件(这些文件是使用flex
and创建的bison
)。我想在“快速设置”下使用“Newlib(semihost)”选项。当我构建我的代码时,它显示了一些错误:
“c:\nxp\lpcxpresso_6.1.2_177\lpcxpresso\tools\bin../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi /include/newlib_inc/stdint.h:79:21:错误:“int32_t”的类型冲突”
“c:\nxp\lpcxpresso_6.1.2_177\lpcxpresso\tools\bin../lib/gcc/arm-none-eabi/4.6.2/../../../../arm-none-eabi /include/newlib_inc/stdint.h:80:23: 错误: 'uint32_t' 的类型冲突"
当我切换到 Redlib 库时,这些错误不会发生,但会出现其他一些问题。我想使用 Newlib。
为什么会发生这些错误?我需要做什么?
java - LPC1343 和 JAVA
是否有可能在 LPC1343 或 LPC1769 等微控制器/cpu 上使用 Java 编程语言发出命令。
如果是,你能告诉在 Java 中使用什么库吗?
主要思想是我想使用 Java 编程语言构建一个客户端应用程序,并且该客户端在 LPC1343 微控制器上发送一些命令。我阅读了有关图书馆http://rxtx.qbang.org/的信息,它看起来是一个可能的解决方案。LPC1343 将成为嵌入项目的一部分。我只需要从 LPC1343 读取一些信息并给出一些命令。
c - Data Corruption when Segregating Functions into Different Files
This issue has me vexed. I am doing some bare-metal programming in C for a custom sensor board based on the LPC15XX series microcontrollers. The platform amounts to a bunch of I2C sensors and a BlueTooth transmitter hooked up to one of the UARTs. This is NOT one of the LPCxpresso (or similar) boards; it is of a custom design.
Until today, everything was working as expected with all test code in one monolithic file. As the code grew, I decided to break the main functional pieces into separate source files to easier management. Unfortunately, as soon as I did this, the program began segfaulting.
The code being moved is a copy + paste of the original monolithic file. I have stepped through using GDB over a SWD link. It appears that one of my static variables used to hit the internal ROM drivers is being NULLified. Dereferencing this later causes the fault.
Setting a watch on the static variable, I can see the line of code blowing it up is in the I2C initialization routines. What is problematic is the fact that init is done using the provided in-ROM driver routines from NXP. Furthermore, this same code worked without issue when it was all in the same file.
Questions
What would nuke a file-level static variable like that? To my understanding, the variable shouldn't be on the stack so I don't see a buffer overflow causing this.
Why would moving the code between files expose this? Shouldn't it all be compiled and linked into a single namespace anyway?
Replies to Questions in Comments
uart_instance
is defined once, inusart.c
and only ever directly (by name) written to once as part of the call touart_setup
.Likewise,
i2c_instance
is defined inmain.c
(I haven't moved the I2C functions yet). Is static and declared identically touart_instance
. I have updated the code below to include all static variables from both files.The pointer is actually NULLed out in the call to
pI2CApi->i2c_set_bitrate(hI2C, BASE_CLOCK, I2C_BAUD);
, as determined by setting a watch on the memory in question.I cannot directly trace into any of the ROM driver routines. They are provided by the uC and are accessed through a double pointer provided at a fixed memory address. I have checked these pointer objects (
hUart
andpUartApi
) and they retain their correct values; onlyuart_instance
gets clobbered.I created and dumped the map file for this application; it did not contain a reference to
uart_instance
(or any static variable, for that matter). Strange. I can post the full contents on request (is a bit long).
Code Vomit
A word of warning, this code is extremely prototypical and unoptimized. A good most of it was copied shamelessly from the datasheet.
Definition of static variables (usart.c)
Definition of static variables (main.c)
Init of static handle (usart.c)
I2C init code that breaks the pointer (main.c)
arm - 由于一个逻辑错误,整个程序无法运行
我正在为 LPC2148 使用 NEX 机器人板。我发现下面的代码行有一个非常奇怪的问题。
执行此代码时,我看到一个空白显示。我注意到问题出在最后一个 convertLowerNibbleToASCIIValue 函数调用上。它应该是:
但是由于这一行错误,为什么整个显示都是空白的?只有最后一个函数 diaplayInRow1WithPosition 应该有麻烦吧?即使更改了上面的行,我也得到了空白显示。所以我将包含最后一个 convertLowerNibbleToASCIIValue 的那行替换为
最后我得到了正确的显示。
无法消化问题。任何人都可以帮忙吗?我需要的主要答案是,如果一行有问题,为什么前面的行没有正确执行?我正在使用 Keil 编译器和任何编译器依赖项?没有编译错误。如果类型等有问题,整个程序会损坏吗?
arm - 重新映射中断向量和引导块
我无法理解重新映射中断向量或引导块的概念。重映射向量表有什么用?它如何使用重映射和不重映射?有没有关于这方面好文章的链接?我用谷歌搜索了这个,但无法得到好的答案。将 RAM 映射到 0x0000 并将 0x0000 中存在的任何内容映射到其他地方有什么好处?如果从 0x0000 执行,执行速度会更快吗?
arm - ARM LPC2378 I2C 与 HMC5883L 接口
我正在尝试将 LPC2378 I2C0 与 HMC5883L 连接。我写了以下代码:
当我在模拟中(在 Keil 中)运行时,我得到了 NACK 条件(这是预期的,因为没有要确认的从机),但是当我连接到 HMC5883L 时,我在传输 SLA+W 后既没有达到 ACK 也没有达到 NACK 状态字节。这个问题的原因可能是什么?
camera - 通过 I2C 到 NXP LPC1768 微控制器的 OV2640 相机模块?
我是嵌入式的新手,甚至是相机传感器的新手——请多多包涵。我正在尝试连接 OV2640 相机模块(OV2640 数据表,带分线板的模块)。所以我连接了以下内容:
- OV2640 - LPC1768
- 地线------- p1(地线)
- VCC ------- p40 (Vout - 3.3V)
- SDA -------- p28 (I2C SDA)
- SCL -------- p27 (I2C SCL)
我试图让它通过SCCB工作,这就是连接 I2C 的原因。但似乎我无法正确设置。
这是我现在拥有的代码:
我无法通过 I2C 写入或读取 - 我在这里做错了什么?
另外,相信 XCLK 需要绑定到 OV2640 模块,如何从 LPC1768 微控制器完成?
c - 尽管包含“string.h”,但未定义对“strnlen”的引用
我正在尝试在 LPCXpresso 上为 LPC1769 创建一个项目。我有一个 C 文件调用
我得到一个错误:
奇怪的是,strcpy、strncpy 或其他常见的字符串函数没有问题。
我正在为 Cortex-M3 处理器构建使用的编译器是:arm-none-eabi-gcc 在 Eclipse 中,我勾选了 MCU 链接器选项:没有启动或默认库我在 Ubuntu 上运行 Eclipse
虽然仅使用 strlen 可能很容易绕过它,但实际上我在使用使用 strnlen 的库时遇到了问题,我不想弄乱库源。
arm - LPC2148 ISP 在刷入 hex 文件后不工作
我是 ARM 编程新手,从 NXP 的 LPC2148 芯片开始。我正在使用它的片上 ISP UART 引导加载程序。加载在 9600 波特、8 位甚至奇偶校验下完美运行。
然后我通过 Flash Magic 固件以 14400 波特刷新了一个由 LPCXpresso 上的新项目制作的代码。之后,引导加载程序序列不再起作用。我已经用奇偶校验尝试了所有可能的波特率,但它不再起作用了。出现“Autobaud failed”的常见问题,奇怪的是,当电源打开时,芯片正在升温。
最让我头疼的问题是我是否破坏了 ISP 引导加载程序。
PS。我一直在使用 16MHz 晶体。虽然我插入的代码实际上是为 12MHz 晶体制作的,其 PLL 调整为 5 倍(60MHz)。但是引导加载程序初始化序列应该绕过芯片上的正常代码,不是吗?
请帮我