Re: [nuttx] Problems in trying to use nuttx and micro-ROS for EtherCAT device control

117 views
Skip to first unread message
Message has been deleted

Gregory Nutt

unread,
Apr 14, 2020, 1:42:16 PM4/14/20
to nu...@googlegroups.com

> Does nuttx send and receive raw socket have buffer mechanism for the receive() function get response data in Ethernet DMA?
There is no receive buffering for RAW sockets.  You could either
implement this in net/pkt copying logic from net/udp OR you could create
a reading thread that constantly reads and buffers data in user space.
> As far as I know, Stm32f767 can port soem Library in Hal and communicate with EtherCAT slave station as master station.
> However, after using nuttx, stm32f767 can't complete the communication with slave station.
> Is that a lot operation resource of Stm32f767 used by running nuttx system?
>
> Is there any way for stm32f767 + nuttx + micro-ROS + soem to be implemented? For example, can we shorten the operation time of ec_send_processdata() function by setting nuttx parameters in menuconfig? Add the raw socket buffer mechanism? or other way?

I don't know anything about this soem library and can't give you any
insight into that.

Greg

Kevin

unread,
Apr 14, 2020, 1:54:38 PM4/14/20
to NuttX
Thanks for you hint.I'll try.

Kevin

unread,
Apr 15, 2020, 7:21:07 AM4/15/20
to NuttX
Hi Greg.

I've been trying hold day to solve this problemand now I'm a bit confused.

I would like to know, in nuttx, how to dump the data received from the NIC to the socket cache?

Could you tell me which file is implemented?

Gregory Nutt

unread,
Apr 15, 2020, 10:05:55 AM4/15/20
to nu...@googlegroups.com

> I would like to know, in nuttx, how to dump the data received from the
> NIC to the socket cache?
>
> Could you tell me which file is implemented?

I think you are talking about what we normally refer as READAHEAD in the
code.  That is why I suggested that look at UDP (net/udp). The
implementation should be more or less the same for raw sockets.  Search
for readahead.  Look at the file udp_recvfrom.c


Kevin

unread,
Apr 15, 2020, 10:13:14 AM4/15/20
to NuttX
OMG! 
There is no udp_recvfrom.c  in my net/udp folder,

I just found out that I used nuttx version 8.2 !?

在 2020年4月15日星期三 UTC+8下午10:05:55,patacongo写道:

Gregory Nutt

unread,
Apr 15, 2020, 10:24:17 AM4/15/20
to nu...@googlegroups.com

> OMG!
> There is no udp_recvfrom.c  in my net/udp folder,
>
> I just found out that I used nuttx version 8.2 !?

The readahead logic is still there, it is just in another location.  In
8.2, it is easier to find the UDP read-ahead logic. There is a
configuration setting called CONFIG_NET_UDP_READAHEAD that flags all of
the relevant logic.  Just seach for NET_UDP_READAHEAD in net/ and you
will find everything.  The logic corresponding udp_recvfrom() was
net/inet/inet_recvfrom.c


Kevin

unread,
Apr 15, 2020, 10:38:09 AM4/15/20
to NuttX
Thanks!!! I'll see now.

在 2020年4月15日星期三 UTC+8下午10:24:17,patacongo写道:
Message has been deleted
Message has been deleted

Pelle Windestam

unread,
Apr 16, 2020, 5:05:41 AM4/16/20
to nu...@googlegroups.com
Hi Kevin,

Have a look here for more info on debugging hardfaults:
https://cwiki.apache.org/confluence/display/NUTTX/Analyzing+Cortex-M+Hardfaults

There is also a new mailing list which is a lot more active than this one: https://nuttx.apache.org/community/

//Pelle

> -----Original Message-----
> From: nu...@googlegroups.com <nu...@googlegroups.com> On Behalf Of Kevin
> Sent: Thursday, 16 April 2020 10:19
> To: NuttX <nu...@googlegroups.com>
> Subject: Re: [nuttx] Problems in trying to use nuttx and micro-ROS for
> EtherCAT device control
>
> Hi,Greg.Sorry to disturb you again.
> I modified the logic of pkt_recvfrom. C according to / UDP, but it crashed
> when running the program:
>
> up_hardfault: Hard Fault:
> up_hardfault: IRQ: 3 regs: 0x3000f96c
> up_hardfault: BASEPRI: 000000f0 PRIMASK: 00000000 IPSR: 00000003 CONTROL:
> 00000000
> up_hardfault: CFAULTS: 00008200 HFAULTS: 40000000 DFAULTS: 0000000b
> BFAULTADDR: 0000000c AFA0
> up_hardfault: PANIC!!! Hard fault: 40000000
> up_assert: Assertion failed at file:armv7-m/up_hardfault.c line: 148
> up_registerdump: R0: 3000fa80 00000000 240263e0 00000000 08018eb5 00000000
> 00000000 3000fa40
> up_registerdump: R8: 00000000 00000000 00000000 00000000 00000003 3000fa40
> 08018f1d 08018d0a
> up_registerdump: xPSR: 01000000 PRIMASK: 00000000 CONTROL: 00000000
> up_registerdump: EXC_RETURN: ffffffe9
> up_dumpstate: sp: 3000f8a0
> up_dumpstate: stack base: 3000fdd0
> up_dumpstate: stack size: 0000fdc4
> up_dumpstate: stack used: 000006f0
> up_stackdump: 3000f8a0: 00000000 00000000 3000f8b0 080015a1 3000f8a0 38002030
> 0000fdc4 3000fdd0
> up_stackdump: 3000f8c0: 3000f8d0 0800165d 00000094 3000f8f0 00000094 08042394
> 3000f8f0 08002591
> up_stackdump: 3000f8e0: 40000000 0000000b 0000000c 00000000 3000f914 00000000
> 3000f96c 00000003
> up_stackdump: 3000f900: 3000f908 000000f0 00000000 00000003 00000000 681b0000
> 08018d08 3000f96c
> up_stackdump: 3000f920: 00000001 3000f96c 3000f930 08002c3d 3000f96c 00000003
> 3000f940 00000003
> up_stackdump: 3000f940: 00000000 080024b1 3000f950 0800248f 3000f96c 00000003
> 2400570c 00000000
> up_stackdump: 3000f960: 3000fa40 08001bdd 00000000 3000fa40 00000000 08018eb5
> 00000000 00000000
> up_stackdump: 3000f980: 3000fa40 00000000 00000000 00000000 00000000 ffffffe9
> 00000000 00000000
> up_stackdump: 3000f9a0: 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000 00000000
> up_stackdump: 3000f9c0: 00000000 00000000 00000000 00000000 00000000 00000000
> 3000fa80 00000000
> up_stackdump: 3000f9e0: 240263e0 00000000 00000003 08018f1d 08018d0a 01000000
> 00000000 00000000
> up_stackdump: 3000fa00: 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000 00000000
> up_stackdump: 3000fa20: 00000000 00000000 00000000 00000000 00000000 00000000
> 00000000 00000000
> up_stackdump: 3000fa40: 00000000 3000fa80 00000003 3000fa50 00000000 000005ee
> 240263e0 38002398
> up_stackdump: 3000fa60: 3000fa70 08018f1d 00000000 3000fa80 00000000 000005ee
> 240263e0 38002398
> up_stackdump: 3000fa80: 00000000 00000000 00000000 000005ee 240263e0 00000000
> 00000000 0801deb7
> up_stackdump: 3000faa0: 24005e84 24005e8c 3000fab8 08015d45 00000000 00000000
> 00000000 000005ee
> up_stackdump: 3000fac0: 240263e0 38002398 3000fad0 00000008 38002394 00000000
> 3000fae8 08015d8f
> up_stackdump: 3000fae0: 00000000 00000000 00000000 000005ee 240263e0 00000008
> 38002030 38002398
> up_stackdump: 3000fb00: 3000fb10 08015dbf 00000000 00000000 00000000 000005ee
> 240263e0 00000008
> up_stackdump: 3000fb20: 00000bb8 00000000 3000fb38 0803ee1b 00000000 00000000
> 00000000 000005ee
> up_stackdump: 3000fb40: 240263e0 00000008 3000fb50 0803bc87 00000000 24020460
> 00000000 00000000
> up_stackdump: 3000fb60: 000005ee 24020460 3000fb70 0803bd3d 00000000 00000000
> 00000001 24020460
> up_stackdump: 3000fb80: 00000000 0000001d 24026fc2 00000008 3000fb98 24020a6e
> 24020460 ffffffff
> up_stackdump: 3000fba0: 00000000 00000000 3000fbb0 0803be8d 1b6b0b00 3000fbfc
> 00000001 24020460
> up_stackdump: 3000fbc0: 000007d0 3000fbfc 00000003 00070cb0 00000000 ffffffff
> 00000003 00000000
> up_stackdump: 3000fbe0: 3000fbe8 0803c119 08000001 00001770 00000001 24020460
> 00000000 00000003
> up_stackdump: 3000fc00: 00070cb0 00000003 00071c50 ffffffff 3000fc28 0803ce5f
> 00000000 00000103
> up_stackdump: 3000fc20: 00000001 3000fc5b 00000000 0001001b 00000103 24020460
> 00000000 01010b30
> up_stackdump: 3000fc40: 3000fc50 08032add 3000fc5b 00001770 3000fc60 24000234
> 0000fcc0 00000002
> up_stackdump: 3000fc60: 3000fc70 08033347 0804480c 38002298 0000fc78 24000234
> 01adbeef 3000fcbc
> up_stackdump: 3000fc80: 0804480c 38002298 00000001 0802f6d9 0802f71b 0000001b
> 38002298 0000001b
> up_stackdump: 3000fca0: 3000fca8 0802d3d1 3000fcbc 00000000 3000fcb8 080362e1
> 0804480c 0000fde9
> up_stackdump: 3000fcc0: 3000fcd8 08014941 080447a4 00000000 00000000 3000fd6c
> 3000fce0 3000fde9
> up_stackdump: 3000fce0: deadbeef 2400a108 2400a170 00000000 3000fcf8 08009c4f
> 00000140 3000fd00
> up_stackdump: 3000fd00: deadbeef 0000fd08 00000000 00000023 3000fd18 3800229c
> 00002030 00000000
> up_stackdump: 3000fd20: 00000000 00000000 3000fd30 08005317 3000fd40 3800229c
> 3000fd9c 00000000
> up_stackdump: 3000fd40: 3000fd48 08008463 08044780 38002298 3000fd58 0802f6cd
> 01adbeef 3000fd9c
> up_stackdump: 3000fd60: 08044780 38002298 380021b0 0802f6d9 0802f71b 00000023
> 38002298 00000023
> up_stackdump: 3000fd80: 3000fd88 0802d3d1 3000fd9c 00000023 3000fda8 0801483d
> 00000000 00000000
> up_stackdump: 3000fda0: 3000fda8 0801484f 3000fdd4 00000002 3000fdb8 08003235
> 00000000 00000000
> up_stackdump: 3000fdc0: 38002030 00000002 00000000 00000000 deadbeef 3000fde0
> 3000fde9 00000000
> up_taskdump: PID: 0 Stack Used=0 of 0
> up_taskdump: PID: 1 Stack Used=848 of 2020
> up_taskdump: PID: 2 Stack Used=1348 of 2020
> up_taskdump: PID: 4 Stack Used=1784 of 64964
>
>
>
>
> --
> You received this message because you are subscribed to the Google Groups
> "NuttX" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nuttx+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nuttx/354dfdcf-94c7-4bcd-bc59-
> 55cc008e7bf7%40googlegroups.com
> <https://groups.google.com/d/msgid/nuttx/354dfdcf-94c7-4bcd-bc59-
> 55cc008e7bf7%40googlegroups.com?utm_medium=email&utm_source=footer> .

Message has been deleted

Xiang Xiao

unread,
Apr 16, 2020, 10:34:32 PM4/16/20
to NuttX
Kevin,
If you have more issue need to disscuss with the community, it's
better to use the new forum here:
https://lists.apache.org/list.html?d...@nuttx.apache.org
You can subscibe the email list here:
https://nuttx.apache.org/community

Thanks
Xiang

On Thu, Apr 16, 2020 at 5:27 PM Kevin <kenhwa...@gmail.com> wrote:
>
> Thank you. I've found the reason. Keep testing
>
> 在 2020年4月16日星期四 UTC+8下午5:05:41,Pelle Windestam写道:
>>
>> Hi Kevin,
>>
>> Have a look here for more info on debugging hardfaults:
>> https://cwiki.apache.org/confluence/display/NUTTX/Analyzing+Cortex-M+Hardfaults
>>
>> There is also a new mailing list which is a lot more active than this one: https://nuttx.apache.org/community/
>>
> --
> You received this message because you are subscribed to the Google Groups "NuttX" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to nuttx+un...@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/nuttx/bb8897bb-34d3-4b4e-88b9-a14a161f9c39%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages