Hi Marcelo
1) The
NQ ports default to IRQ lines. When in IRQ mode their inputs need to be read using the
EPPDR0 register (
EPPDR1 for IRQ8..15, if available).
I think that the simulator updates the
PORTIN_SETNQ register. This is correct when set as GPIO but not when left as IRQ lines.
I will need to see whether this can be improved, but you should be able to solve the issue on the target by reading the
EPPDRx register instead.
2) TELNET problems on the target are usually due to a lack of RAM available on the heap. Check the memory state before trying to establish the TELNET connection to see how much HEAP is available. The TELNET socket allocates a buffer of
TCP_BUFFER length the first time that is used. (
TCP_BUFFER is typically configured to 2800 bytes). If the heap doesn't have this space you can reduce the buffer size or increase heap setting. In the second case ensure that there is enough stack space - it should never go to 0. There are several discussions about this with more details - eg:
http://www.utasker.com/forum/index.php?topic=486.msg1926#msg1926Note that the exact use of memory varies between the simulator and the target and there is tuning value in config.h called
MEM_FACTOR. If this is set so that the simulator and target have the same free HEAP it helps catch such problems in the simulator. Generally the simulator just has enough memory but the target just fails...
Regards
Mark