MplabX,USB Start er Kit 2.当前PC 0x9d00641c没有找到源代码行 [英] MplabX, USB Start er Kit 2. No source code lines were found at current PC 0x9d00641c
问题描述
Good evening,
The device under test is MicroChip USB Starter Kit 2.
The problem began appearing after adding some SPI initialization code to HID - Custom Demo program from 10-15-2012 microchip solutions framework.
Before the code was added everything in the demo worked perfectly
Code added was the following: right after
int main(void)
{
<pre>
int rData;
//IEC0CLR=0x03800000; // disable all interrupts
SPI1CON = 0; // Stops and resets the SPI1.
rData=SPI1BUF; // clears the receive buffer
IFS0CLR=0x03800000; // clear any existing event
IPC5CLR=0x1f000000; // clear the priority
IPC5SET=0x0d000000; // Set IPL=3, Subpriority 1
IEC0SET=0x03800000; // Enable RX, TX and Error interrupts
SPI1BRG=30; // use FPB/4 clock frequency
SPI1STATCLR=0x40; // clear the Overflow
SPI1CON=0x8260; // SPI ON, 8 bits transfer, SMP=1, Master mode
立即加入后,MPLabX开始报告
当前PC没有找到源代码行0x9d006474
十六进制数根据我放置初始化代码的位置而改变,但它从未超过USBDeviceAttach();
为什么SPI干扰USB功能?
请注意,我注释了FRM建议的线路,假设这是这些问题的原因,但事实并非如此。
// IEC0CLR = 0x03800000; //禁用所有中断
请告诉我这个问题是如何解决的。
谢谢,
Immediately, after this was added, MPLabX began reporting
No source code lines were found at current PC 0x9d006474
the hex number changed depending on where I put the initialization code, but it never got past USBDeviceAttach();
Why is it that SPI is interfering with USB functionaly?
Notice that I commented out the line suggested by the FRM, assuming that this is the cause of those issues, but it was not.
//IEC0CLR=0x03800000; // disable all interrupts
Please let me know how this problem may be resolved.
Thank you,
推荐答案
我找到了问题的解决方案,我不知道它是否是Microchip USB的一个错误堆栈
但我在USBDeviceAttach中添加了一行(无效)
IEC0CLR = 0x03800000; // //禁用所有中断
之前
USBEnableInterrupts(); //修改全局中断设置
定义为:
折叠|复制代码
#define USBEnableInterrupts(){\
IEC1SET = USBIE / * 0x02000000 * /; \
IPC11CLR = 0x0000FF00; \\ \\ b
IPC11SET = 0x00001000; \
INTEnableSystemMultiVectoredInt(); \
INTEnableInterrupts(); \
}
从那时起,每个人的工作都很完美。 />
我会将此内容提交给Microchip,如果他们遇到同样的问题,希望它可以帮助他们
I found a solution to the problem, I don''t know if it''s a bug to the Microchip USB stack
But I added a line inside USBDeviceAttach(void)
IEC0CLR=0x03800000; // // disable all interrupts
Right before
USBEnableInterrupts(); //Modifies global interrupt settings
which is defined as:
Collapse | Copy Code
#define USBEnableInterrupts() {\
IEC1SET = USBIE /*0x02000000*/;\
IPC11CLR = 0x0000FF00;\
IPC11SET = 0x00001000;\
INTEnableSystemMultiVectoredInt();\
INTEnableInterrupts();\
}
Since then everythign worked perfectly.
I will submit this to Microchip and hopefully it will help someone down the line if they run into the same problem
这篇关于MplabX,USB Start er Kit 2.当前PC 0x9d00641c没有找到源代码行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!