IP binding (DHCP or static) causes "TCP/IP Unhandled interrupt"

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

IP binding (DHCP or static) causes "TCP/IP Unhandled interrupt"

Jump to solution
2,386 Views
panpwr
Contributor IV

Hello,

I am trying to bind IP to my ENET device on TWR-K60D100M, either dynamically (ipcfg_bind_dhcp_wait()) or static (ipcfg_bind_staticip()).

When examining the system after issuing the command (I am working with Keil's ARM-MDK IDE), I find the following (for both DHCP / static bind):

- _mqx_idle_task state = "Active".

- My task state = "Msg Send Blocked".

- TCP/IP task state = "Unhandled Interrupt".

- TCP/IP Message Queue has 3 entries.

I may add that both methods (DHCP/static) used to work before in the past. The main change is that I've added another  message queue to the system, and increased the BSP_DEFAULT_MAX_MSGPOOLS (from 2 to 5).

Please advise.

Thanks,

Lior.

Labels (1)
0 Kudos
Reply
1 Solution
1,816 Views
panpwr
Contributor IV

OK, I am now using MQX 4.0 (with uVision ver 4.60) and the problem went away...

Thanks.

View solution in original post

0 Kudos
Reply
5 Replies
1,816 Views
c0170
Senior Contributor III

Hello panpwr,

have you found out which instruction did cause unhandled interrupt? Install _int_unexpected_isr(), use terminal to get the dump of psp/msp. Put a breakpoint in unexpected isr and wait for it to happen.. Thats your starting point.

We do not know your application though, hard to tell what can be the cause here.

Regards,

MartinK

1,816 Views
panpwr
Contributor IV

Hello,

Thanks for picking this thread up.

I know that the error comes from both "ipcfg_bind_dhcp_wait()" and "ipcfg_bind_staticip()".

Moreover, I know that the internal call to _lwsem_wait(), and later to _INT_ENABLE() triggers the unhandled interrupt (which is caught in Install _int_unexpected_isr()).

However, I can't seem to get much more information - I am not familiar with the internal sequence of IP binding process, so just drilling down further into the inner functions of RTCS & MQX seems useless for me. I don't know what can cause the TCP/IP task to halt at this point.

Perhaps you can guide me for further checks / tests.

Thanks,

Lior.

0 Kudos
Reply
1,816 Views
panpwr
Contributor IV

I might have found something.

I am using Keil's ARM-MDK uVision4 IDE, and have just upgraded from version 4.54 to 4.60.

1. After the upgrade, I've recompiled the MQX "psp" library in "build_libs.uvmpw" (which is included in MQX release 3.8.0, and is a "Keil uVision 4 multi-project workspace file which can be used to batch-build the MQX kernel and all other MQX software stacks and libraries").

2. I've ran my program, and when using ipcfg_bind_dhcp_wait() or ipcfg_bind_staticip(), I get "Unhandled Exception", and all tasks halt.

3. When I've rolled back to version 4.54, I did the same compilation again (just the "psp" library file - other libraries do not affect anything) - this time everything worked as expected.

So I guess the problem is with the IDE / ARM compiler. I've emailed Keil, hopefully I will get some answers.

Did anyone have stumbled into the same issue?

0 Kudos
Reply
1,816 Views
BryGuyH
Contributor IV

Are you compiling with an optimization level of more than 0 in any of the projects? There are problems with the existing sources that cause problems with pre-4.6 when compiled with a higher optimization level so make sure you only compile with optimization level 0. This should be resolved in MQX 4.0

I assume those issues may in turn cause problems with the update to armcc as well.

1,817 Views
panpwr
Contributor IV

OK, I am now using MQX 4.0 (with uVision ver 4.60) and the problem went away...

Thanks.

0 Kudos
Reply