Picon

net_lock dependence on interrupts

Greg,
I am trying to figure out how to get away from having net_lock depend
on interrupts. I was thinking a worker thread could be the interface
between the drivers and uip.  What are your thoughts on this?

--Brennan

------------------------------------
Posted by: Brennan Ashton <bashton@...>
------------------------------------

------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nuttx/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/nuttx/join
    (Yahoo! ID required)

<*> To change settings via email:
    nuttx-digest@... 
    nuttx-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
(Continue reading)

Picon

Router should not route broadcast addresses

Not sure about this, but I don't think that packets for
255.255.255.255 can be routed?

I have a default route for traffic, and I was seeing dhcp broadcasts
get routed out this interface.

diff --git a/nuttx/net/route/net_router.c b/nuttx/net/route/net_router.c
index 8dde05c..2545a49 100644
--- a/nuttx/net/route/net_router.c
+++ b/nuttx/net/route/net_router.c
 <at>  <at>  -131,6 +131,11  <at>  <at>  int net_router(net_ipaddr_t target, FAR
net_ipaddr_t *router)
   struct route_match_s match;
   int ret;

+  if (target == INADDR_BROADCAST)
+    {
+      /* We should not be routing a broadcast ip */
+      return -ENOENT;
+    }
   /* Set up the comparison structure */

   memset(&match, 0, sizeof(struct route_match_s));

--Brennan

------------------------------------
Posted by: Brennan Ashton <bashton@...>
------------------------------------

(Continue reading)

Picon

POSIX GPIO Driver

Greg, 


just be sure, these no generic or standard GPIO driver to have a POSIX access in Nuttx ?


Pierre



__._,_.___
Posted by: pn_bouteville-Qt13gs6zZMY@public.gmane.org



__,_._,___
Picon

DHCP client

Hi group,

Here is an issue I'm facing with the DHCP client. As far as I can tell it almost works. I generates network traffic when inoked (not analyzed though), and configures the IP address and default router.

The problem is in the values of these addresses. They are completely unexpected, like IPaddr:32.144.238.117 DRaddr:32.144.238.1, while I expect something like 192.168.1.x. Apart from this, everything looks good: Sending packets works, with the source address being consistent with this weird IP, but of course the routing fails. When the IP is assigned manually, the network works perfect. The dhcp server works also fine.

I have checked the documentation for configuration dependencies, but now I'm stuck. What should I look for next?

The board is a cl ose sam4e-ek derivative.

Thanks.
--
Thierry-




__._,_.___
Posted by: thierry.durand-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org



__,_._,___
Picon

Ethernet on SAM4E-EK

Hi,

I working with the sam4e-ek and I am having a few concerns with the ethernet.

I have noticed that the system doesn't boot when the cable is not plugged in. Pluging the cable lets the system start. Similarly, when the system is up, removing the cable remains unnoticed. This is especially a problem when there is udp traffic as no timeout is implemented.

If I got it correctly, a change in the PHY status is signaled by an interrupt. This interrupt is routed to PIOD28 on the sam4e-ek. There is no configuration option to allow interrupts on the PIOD. There is this option only for ports A, B and C. I have updated the corresponding Kconfig to be able to configure interrupts on PIOD, but then there are many compilation errors.

Before proceeding further, can anyon e confirm whether the PHY interrupt is usable on sam4e-ek? Or am I taking a bad route?

Thanks.
--
Thierry-

__._,_.___
Posted by: thierry.durand-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org



__,_._,___
Picon

[PATCH] vfs/poll: add proper handling for sem_timedwait errnos [1 Attachment]

<*>[Attachment(s) from Jussi Kivilinna included below]

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@...>
---
 nuttx/fs/vfs/fs_poll.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

diff --git a/nuttx/fs/vfs/fs_poll.c b/nuttx/fs/vfs/fs_poll.c
index 26f1ebd..2d9dd4b 100644
--- a/nuttx/fs/vfs/fs_poll.c
+++ b/nuttx/fs/vfs/fs_poll.c
 <at>  <at>  -334,6 +334,23  <at>  <at>  int poll(FAR struct pollfd *fds, nfds_t nfds, int timeout)
              }

            ret = sem_timedwait(&sem, &abstime);
+           if (ret < 0)
+             {
+               int err = get_errno();
+
+               if (err == ETIMEDOUT)
+                 {
+                   ret = OK;
+                 }
+               else if (err == EINTR)
+                 {
+                   ret = -EINTR;
+                 }
+               else
+                 {
+                   ret = -err;
+                 }
+             }
            irqrestore(flags);
         }
       else

---
 nuttx/fs/vfs/fs_poll.c |   17 +++++++++++++++++
 1 file changed, 17 insertions(+)

<*>Attachment(s) from Jussi Kivilinna:

<*> 1 of 1 File(s)
https://groups.yahoo.com/neo/groups/nuttx/attachments/734616260;_ylc=X3oDMTJycmgzaGkzBF9TAzk3MzU5NzE0BGdycElkAzIzMzg5MDcwBGdycHNwSWQDMTcwNTAwNjU1OQRzZWMDYXR0YWNobWVudARzbGsDdmlld09uV2ViBHN0aW1lAzE0MTY1NzE0NDc- 
  <*> poll-add-proper-handling-for-sem_timedwait-TIMEDOUT.patch

------------------------------------
Posted by: Jussi Kivilinna <jussi.kivilinna@...>
------------------------------------

------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nuttx/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/nuttx/join
    (Yahoo! ID required)

<*> To change settings via email:
    nuttx-digest@... 
    nuttx-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    nuttx-unsubscribe@...

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Picon

CONFIG_NXTK_BORDERWIDTH==0 [1 Attachment]

Hi, 


A patch to remove warning when CONFIG_NXTK_BORDERWIDTH is set to 0.

 

Pierre


Ps, I m just starting with NXTK, so Y not sure that patch are correct.



__._,_.___

Attachment(s) from pn_bouteville-Qt13gs6zZMY@public.gmane.org [nuttx] | View attachments on the web

1 of 1 File(s)

Posted by: pn_bouteville-Qt13gs6zZMY@public.gmane.org



__,_._,___
Picon

STM32F429i-Disco USB WAS: Proposals for a few fixes

Hi Greg

I don't use this board, but my recollection as that the modification was just to add a separate OTGHS device driver that STILL operates in FS mode.  I remember that that the goal was to have to two FS devices by separating the single OTGFS-or-OTGHS-in-FS-mode device driver into two drivers:  OTGFS and OTGHS-in-FS-mode.

So, given that, I would think that the configuration should still be correct.  I don't know if it works or it has ever been tested, but I think that it could work.

It seems to me that what was lost was OTGFH-in-FS-mode host.  Am I remembering that correctly?

Yes, the goal was to support OTGHS-in-FS mode directly in the OTGHS driver, which I totally agree with.  The problem is that only stm32_otghshost.c was added.  There is no stm32_otghsdev.c file to enable device support.  So while I could connect a thumb drive to the stm32f429i-disco board, there is no way to connect it to a PC and get an NSH prompt.

And OTSHS USB CDC (device mode) is the only out-of-the-box mechanism to get an NSH prompt.  I have a nsh configuration, but the notes in the README state that you have to add an external RS-232 line driver or RS-232 to USB dongle.  So without the usbnsh configuration, there's really no way to tell if the board is even alive.  It's the very first configuration anyone should try.

<begin rant>
Oh, and I will be the first person to complain.  I don't usually complain much, especially on public forums, but I'll make an exception here.  I was quite irked at the author who removed OTGFS2 feature without an understanding of the ramifications.  As I have added new code to NuttX, I have always been very careful to add it as a CONFIG option so it doesn't affect anyone else (in terms of functionality, code size or RAM usage).  

At the time, I suggested adding the OTFS2 logic back to the stm32_otgfsdev.c file because it is an *OPTION*, one that you don't have to enable if you don't want.  But it was an important option for this board and this configuration, without which you can't really tell if the board is even alive!  I really don't understand removing an option that isn't affecting your development willy-nilly just because you (no, not you Greg) think it is a messy solution.  A promise was made at that time to get the stm32_otghsdev.c completed and checked in within a week or so.  It has been six weeks.  

I wasn't vocal about it at the time because I wasn't actively working on this board.  However it is one of the boards that I use and one of the boards with my name as the author who contributed the configuration.  This configuration needs to remain, and needs to actually work.  
</end rant>

So my strong request is to add the OTGFS2 config option back to the stm32_otgfs2dev.c file as I don't have time to develop the otghsdev.c.  I still have a sandbox with the OTGFS2 code that I know works and can provide a patch set if you need it.

Thanks,

Ken


__._,_.___
Posted by: Ken Pettit <pettitkd-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>



__,_._,___
Picon

[PATCH 1/2] sched: clock_abstime2ticks: detect absolute time in past and return negative tick [1 Attachment]

<*>[Attachment(s) from Jussi Kivilinna included below]

Calling mq_timedreceived with immediate timeout was getting stuck and not
timeout. Immediate timeout is achieved by setting absolute timeout value to
past time, for example abstime={ .tv_sec=0, .tv_nsec=0 }. However absolute
time was converted to relative time using unsigned integer arithmetic and
resulted large ticks count by clock_abstime2ticks, instead of expected negative
ticks value.

Patch corrects clock_abstime2ticks to return negative ticks, if absolute time
is in the past.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna@...>
---
 nuttx/sched/clock/clock_abstime2ticks.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/nuttx/sched/clock/clock_abstime2ticks.c b/nuttx/sched/clock/clock_abstime2ticks.c
index 1f8845d..cfc0447 100644
--- a/nuttx/sched/clock/clock_abstime2ticks.c
+++ b/nuttx/sched/clock/clock_abstime2ticks.c
 <at>  <at>  -64,6 +64,16  <at>  <at> 
  * Private Functions
  ********************************************************************************/

+static long compare_timespec(const struct timespec *a, const struct timespec *b)
+{
+    if (a->tv_sec < b->tv_sec)
+      return -1;
+    if (a->tv_sec > b->tv_sec)
+      return 1;
+
+    return a->tv_nsec - b->tv_nsec;
+}
+
 /********************************************************************************
  * Public Functions
  ********************************************************************************/
 <at>  <at>  -105,6 +115,17  <at>  <at>  int clock_abstime2ticks(clockid_t clockid, FAR const struct timespec *abstime,
       return EINVAL;
     }

+  if (compare_timespec(abstime, &currtime) < 0)
+    {
+      /* Every caller of clock_abstime2ticks check 'ticks < 0' to see if
+       * absolute time is in the past. So lets just return negative tick
+       * here.
+       */
+
+      *ticks = -1;
+      return OK;
+    }
+
   /* The relative time to wait is the absolute time minus the current time. */

   reltime.tv_nsec = (abstime->tv_nsec - currtime.tv_nsec);

---
 nuttx/sched/clock/clock_abstime2ticks.c |   21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

<*>Attachment(s) from Jussi Kivilinna:

<*> 1 of 1 File(s)
https://groups.yahoo.com/neo/groups/nuttx/attachments/130975839;_ylc=X3oDMTJyam1pOHE2BF9TAzk3MzU5NzE0BGdycElkAzIzMzg5MDcwBGdycHNwSWQDMTcwNTAwNjU1OQRzZWMDYXR0YWNobWVudARzbGsDdmlld09uV2ViBHN0aW1lAzE0MTY0MDkzODM- 
  <*> fix-clock_abstime2ticks-with-past-abstime.patch

------------------------------------
Posted by: Jussi Kivilinna <jussi.kivilinna@...>
------------------------------------

------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nuttx/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/nuttx/join
    (Yahoo! ID required)

<*> To change settings via email:
    nuttx-digest@... 
    nuttx-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    nuttx-unsubscribe@...

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/

Picon

timer or idle

Hi greg, 


For keyboard drivers, I need to look GPIO every 100ms about. I don't want use IRQ, because GPIO are shared by 8080 bus of LCD.


So I don't the best way to do that:

1) use a timer that look GPIO ?

2) get a hook in idle task ?

3) create a thread for all lowlevel polling ?


Pierre



__._,_.___
Posted by: pn_bouteville-Qt13gs6zZMY@public.gmane.org



__,_._,___
Picon

Buffered pkt_send

I am working on creating some packet forwarding logic and I have based
this off of the route table logic for creating the forwarding rules,
and I am now working on the logic that actually forwards the packet.

It seems like the easiest way to do this is to allocate a bunch of pkt
sockets. What I do not want is to add (long) delays in the processing
of other sockets. Would a buffered pkt_send be a good way to go about
this?

I know that support does not exist yet for pkt sockets and that there
are a few thing other little things that need to be sorted (pkt
sockets only work on eth0).

As a test using a single interface I was going to set the forwarding
rule to send the packet back out.

To be clear I am not implementing connection tracking or NAT, just the
ability to bridge connections.

--Brennan

------------------------------------
Posted by: Brennan Ashton <bashton@...>
------------------------------------

------------------------------------

Yahoo Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/nuttx/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/nuttx/join
    (Yahoo! ID required)

<*> To change settings via email:
    nuttx-digest@... 
    nuttx-fullfeatured@...

<*> To unsubscribe from this group, send an email to:
    nuttx-unsubscribe@...

<*> Your use of Yahoo Groups is subject to:
    https://info.yahoo.com/legal/us/yahoo/utos/terms/


Gmane