g_pfnVectors Error

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

g_pfnVectors Error

1,561 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Prithvi on Thu Mar 03 03:52:35 MST 2011
Hi,
I am getting a error while debugging. It's screenshot is attached. At times it goes to the hard fault handler also. It started occurring once I added this innocent piece of code in the main().
unsigned int abc;
    index = LPC_EMAC->TxProduceIndex;
    if (++index == NUM_TX_FRAG)
        index = 0;
    LPC_EMAC->TxProduceIndex = index;
How can I resolve this error?
Thanks,
Prithvi
0 Kudos
Reply
6 Replies

1,494 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Prithvi on Thu Mar 03 13:33:58 MST 2011
Got to know what causes the error! But don't know why.
I after updating the producer index manually I overlooked that I was also calling the CopyToFrame_EthMAC() function also. Now that its removed its debugging. :)
0 Kudos
Reply

1,494 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Prithvi on Thu Mar 03 12:31:42 MST 2011
Yes that's strange. I have not modified the vector base ( I have not touched the startup code).
The confusing part is that when the code that I put in the first post is commented completely, the error does not occur. Otherwise it occurs, sometimes as hard fault if I comment different parts of that code.
Do you think it is a build error? How can I overcome it?
Thanks
0 Kudos
Reply

1,494 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Mar 03 12:24:46 MST 2011
Sorry, don't know the error :)

Is there an error?

1. You've copied a working sample
2. How to transmit a simple frame was described before
3. I asked you to use a simple 1 sec loop to find your problem

Result?

If you don't know what you are doing and don't do what you have been asked for, what are you expecting?

Is your concept to solve this problem copying code to main?

Your creating problems instead of solving them. If you don't want to do what I've asked you for, that's not my problem.
I've no crystal ball and I'm not convinced that you know what you are doing. So the first step would be to find out if hardware is working and therefore a loop is a good start.
0 Kudos
Reply

1,494 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by CodeRedSupport on Thu Mar 03 09:59:41 MST 2011
In your screenshot I see disassembly at address zero. The interesting thing is this code is all zeroes. If your vector base has not been modified, address zero should contain the reset stack pointer, followed by the reset vector. So, the question is do you use a vector base at a non-zero address? If not, you have a build problem.

Regards,

CodeRedSupport
0 Kudos
Reply

1,494 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Prithvi on Thu Mar 03 07:50:01 MST 2011
Hey Zero,
1. I've read the manual.
2. I am just trying to get my hands dirty by working with the codes  and trying to make this work.
I am not just incrementing producer index, before that I am the also configuring the TX control register and copying the data to be sent to the TX_Buffer of the current index.
So if you know why the error is occurring please tell me.
Thanks
0 Kudos
Reply

1,494 Views
lpcware
NXP Employee
NXP Employee
Content originally posted in LPCWare by Ex-Zero on Thu Mar 03 04:45:53 MST 2011
There are 2 simple solutions:

1. Read the manual :mad:

2. Don't mutilate CopyToFrame_EthMAC() function :mad::mad:

Manual:
[Quote]
...the Ethernet block will start transmitting the frame as
soon as it detects the TxProduceIndex is not equal to TxConsumeIndex...
[/Quote]

So obviously you try to transmit some sh.....

Why do you destroy working samples?
0 Kudos
Reply