Re: CTU CAN FD driver multi-licence for Nuttx

2023-09-07 Thread Gregory Nutt

On 9/6/2023 5:15 AM, alin.jerpe...@sony.com wrote:

There are known CAN sources that have GPL code and have been documented in the 
LICENSE File

All this code is protected under the include GPL code config option and 
disabled by default

Is this approach approved or we should completely remove the GPL code from 
NuttX?


My understanding is that there can be no GPL code in any way in the 
Apache project repository.


In the case of the CANFD code, it has a dual license, GPL or BSD-3.  I 
don't recall all of the details but, as a podling at the time, we 
discussed this pretty thoroughly with our mentors and the inclusion of 
the dual licensed third party code was found acceptable.  Justin McClean 
was involved in this discussion.  I briefly looked for the e-mail thread 
that addressed this, but I could not find it so my recollection might be 
faulty,.


Any pure GPL should be removed in my opinion.



make command error

2023-09-07 Thread Gustavo Soares
Hello!

I have an application and it was compiling normally to NuttX, but out of the 
blue an error showed up and I can not figure out what is wrong. This is the 
error message:

[cid:96b8807a-e494-4891-b208-0b17ada218b6]

and this is the line 73 of the server file:

[cid:5e6c0c83-7a54-44a9-b553-c74432356707]

I tryied everything: rewriting the file, rewriting the line, declaring the main 
function in the start of the file (in this case the error occoured for this 
line too) and also creating another simple file with the main function empty. 
In every attempt the same error showed up. It's hard to believe that the error 
is in the make command, but I can run the application on my VM with no problem.

Does anyone know what could be the problem?
Thank you!


RE: [EXT] Re: CTU CAN FD driver multi-licence for Nuttx

2023-09-07 Thread Peter van der Perk
There was a discussion when the kconfig GPL switch got introduced.
The libcanutils code from my perspective would be interpreted as BSD-3.
But it was decided otherwise 
https://github.com/apache/nuttx-apps/pull/833#issuecomment-918875006

-Original Message-
From: Gregory Nutt  
Sent: Thursday, September 7, 2023 3:50 PM
To: dev@nuttx.apache.org
Subject: [EXT] Re: CTU CAN FD driver multi-licence for Nuttx

On 9/6/2023 5:15 AM, alin.jerpe...@sony.com wrote:
> There are known CAN sources that have GPL code and have been 
> documented in the LICENSE File
>
> All this code is protected under the include GPL code config option 
> and disabled by default
>
> Is this approach approved or we should completely remove the GPL code from 
> NuttX?

My understanding is that there can be no GPL code in any way in the Apache 
project repository.

In the case of the CANFD code, it has a dual license, GPL or BSD-3.  I don't 
recall all of the details but, as a podling at the time, we discussed this 
pretty thoroughly with our mentors and the inclusion of the dual licensed third 
party code was found acceptable.  Justin McClean was involved in this 
discussion.  I briefly looked for the e-mail thread that addressed this, but I 
could not find it so my recollection might be faulty,.

Any pure GPL should be removed in my opinion.



Re: [EXT] Re: CTU CAN FD driver multi-licence for Nuttx

2023-09-07 Thread Alan C. Assis
I think GPL code shouldn't be included directly, but I think it is
fair to allow GPL code be downloaded using the building system case
user selected it.

Some time ago I suggested to create a tainted variable in the building
system to track it, after I suggested that a friend of mine from
Espressif added it to Zephyr.

Doing this way will avoid someone saying that wasn't aware of BSD,
MIT, GPL or other license included in their final binary.

BR,

Alan

On 9/7/23, Peter van der Perk  wrote:
> There was a discussion when the kconfig GPL switch got introduced.
> The libcanutils code from my perspective would be interpreted as BSD-3.
> But it was decided otherwise
> https://github.com/apache/nuttx-apps/pull/833#issuecomment-918875006
>
> -Original Message-
> From: Gregory Nutt 
> Sent: Thursday, September 7, 2023 3:50 PM
> To: dev@nuttx.apache.org
> Subject: [EXT] Re: CTU CAN FD driver multi-licence for Nuttx
>
> On 9/6/2023 5:15 AM, alin.jerpe...@sony.com wrote:
>> There are known CAN sources that have GPL code and have been
>> documented in the LICENSE File
>>
>> All this code is protected under the include GPL code config option
>> and disabled by default
>>
>> Is this approach approved or we should completely remove the GPL code from
>> NuttX?
>
> My understanding is that there can be no GPL code in any way in the Apache
> project repository.
>
> In the case of the CANFD code, it has a dual license, GPL or BSD-3.  I don't
> recall all of the details but, as a podling at the time, we discussed this
> pretty thoroughly with our mentors and the inclusion of the dual licensed
> third party code was found acceptable.  Justin McClean was involved in this
> discussion.  I briefly looked for the e-mail thread that addressed this, but
> I could not find it so my recollection might be faulty,.
>
> Any pure GPL should be removed in my opinion.
>
>


Re: [EXT] Re: CTU CAN FD driver multi-licence for Nuttx

2023-09-07 Thread Gregory Nutt




I think GPL code shouldn't be included directly, but I think it is
fair to allow GPL code be downloaded using the building system case
user selected it.


We created this directory specifically to hold forks of GPL code that 
can be used with NuttX:  https://github.com/NuttX .  I am not sure of 
the current state; it hasn't been used or maintained.





Re: make command error

2023-09-07 Thread Alan C. Assis
Hi Miguel,

It was many years ago, normally the used hello_main() etc, to avoid
main() symbol collision. Now the apps can use main() and the building
system will concatenate it automatically.

Probably the issue that Gustavo is facing is some messing with the source code.

I think he is using special symbols as App name (i.e. m++)

If that is the case, it will become m++_main(int ...) that will
confuse the compiler.

Just my 2 cents!

BR,

Alan

On 9/7/23, MIGUEL ALEXANDRE WISINTAINER  wrote:
> If I remember, your program can not have a main() function, but other name,
> because is called by other program
>
> Enviado do meu iPhone
>
> Em 7 de set. de 2023, à(s) 11:13, Gustavo Soares
>  escreveu:
>
> 
> Hello!
>
> I have an application and it was compiling normally to NuttX, but out of the
> blue an error showed up and I can not figure out what is wrong. This is the
> error message:
>
> [image.png]
>
> and this is the line 73 of the server file:
>
> [image.png]
>
> I tryied everything: rewriting the file, rewriting the line, declaring the
> main function in the start of the file (in this case the error occoured for
> this line too) and also creating another simple file with the main function
> empty. In every attempt the same error showed up. It's hard to believe that
> the error is in the make command, but I can run the application on my VM
> with no problem.
>
> Does anyone know what could be the problem?
> Thank you!
>


RE: make command error

2023-09-07 Thread Gustavo Soares
Hi Alan!

I changed the app name from 'M+++' to 'mthreeplus' but the error still appears:

[cid:35aa8eda-31a2-4d80-825e-e653c25698da]

[cid:3cb94f25-e1fc-48b8-9f8d-753d5fc09ceb]

De: Alan C. Assis 
Enviado: quinta-feira, 7 de setembro de 2023 13:10
Para: dev@nuttx.apache.org 
Assunto: Re: make command error

Hi Miguel,

It was many years ago, normally the used hello_main() etc, to avoid
main() symbol collision. Now the apps can use main() and the building
system will concatenate it automatically.

Probably the issue that Gustavo is facing is some messing with the source code.

I think he is using special symbols as App name (i.e. m++)

If that is the case, it will become m++_main(int ...) that will
confuse the compiler.

Just my 2 cents!

BR,

Alan

On 9/7/23, MIGUEL ALEXANDRE WISINTAINER  wrote:
> If I remember, your program can not have a main() function, but other name,
> because is called by other program
>
> Enviado do meu iPhone
>
> Em 7 de set. de 2023, à(s) 11:13, Gustavo Soares
>  escreveu:
>
> 
> Hello!
>
> I have an application and it was compiling normally to NuttX, but out of the
> blue an error showed up and I can not figure out what is wrong. This is the
> error message:
>
> [image.png]
>
> and this is the line 73 of the server file:
>
> [image.png]
>
> I tryied everything: rewriting the file, rewriting the line, declaring the
> main function in the start of the file (in this case the error occoured for
> this line too) and also creating another simple file with the main function
> empty. In every attempt the same error showed up. It's hard to believe that
> the error is in the make command, but I can run the application on my VM
> with no problem.
>
> Does anyone know what could be the problem?
> Thank you!
>


Re: make command error

2023-09-07 Thread Alan C. Assis
Hi Gustavo,

Try to do a "make distclean" and configure again.

Also it could be something inside your source code just before the
main() function. But I think the issue was the M+++ name.

BR,

Alan

On 9/7/23, Gustavo Soares  wrote:
> Hi Alan!
>
> I changed the app name from 'M+++' to 'mthreeplus' but the error still
> appears:
>
> [cid:35aa8eda-31a2-4d80-825e-e653c25698da]
>
> [cid:3cb94f25-e1fc-48b8-9f8d-753d5fc09ceb]
> 
> De: Alan C. Assis 
> Enviado: quinta-feira, 7 de setembro de 2023 13:10
> Para: dev@nuttx.apache.org 
> Assunto: Re: make command error
>
> Hi Miguel,
>
> It was many years ago, normally the used hello_main() etc, to avoid
> main() symbol collision. Now the apps can use main() and the building
> system will concatenate it automatically.
>
> Probably the issue that Gustavo is facing is some messing with the source
> code.
>
> I think he is using special symbols as App name (i.e. m++)
>
> If that is the case, it will become m++_main(int ...) that will
> confuse the compiler.
>
> Just my 2 cents!
>
> BR,
>
> Alan
>
> On 9/7/23, MIGUEL ALEXANDRE WISINTAINER  wrote:
>> If I remember, your program can not have a main() function, but other
>> name,
>> because is called by other program
>>
>> Enviado do meu iPhone
>>
>> Em 7 de set. de 2023, à(s) 11:13, Gustavo Soares
>>  escreveu:
>>
>> 
>> Hello!
>>
>> I have an application and it was compiling normally to NuttX, but out of
>> the
>> blue an error showed up and I can not figure out what is wrong. This is
>> the
>> error message:
>>
>> [image.png]
>>
>> and this is the line 73 of the server file:
>>
>> [image.png]
>>
>> I tryied everything: rewriting the file, rewriting the line, declaring
>> the
>> main function in the start of the file (in this case the error occoured
>> for
>> this line too) and also creating another simple file with the main
>> function
>> empty. In every attempt the same error showed up. It's hard to believe
>> that
>> the error is in the make command, but I can run the application on my VM
>> with no problem.
>>
>> Does anyone know what could be the problem?
>> Thank you!
>>
>


Re: [EXT] Re: CTU CAN FD driver multi-licence for Nuttx

2023-09-07 Thread Brennan Ashton
On Thu, Sep 7, 2023, 9:01 AM Gregory Nutt  wrote:

>
> > I think GPL code shouldn't be included directly, but I think it is
> > fair to allow GPL code be downloaded using the building system case
> > user selected it.
>
> We created this directory specifically to hold forks of GPL code that
> can be used with NuttX:  https://github.com/NuttX .  I am not sure of
> the current state; it hasn't been used or maintained.
>

I maintain that it should be deleted.

>


Re: [EXT] Re: CTU CAN FD driver multi-licence for Nuttx

2023-09-07 Thread Alan C. Assis
On 9/7/23, Brennan Ashton  wrote:
> On Thu, Sep 7, 2023, 9:01 AM Gregory Nutt  wrote:
>
>>
>> > I think GPL code shouldn't be included directly, but I think it is
>> > fair to allow GPL code be downloaded using the building system case
>> > user selected it.
>>
>> We created this directory specifically to hold forks of GPL code that
>> can be used with NuttX:  https://github.com/NuttX .  I am not sure of
>> the current state; it hasn't been used or maintained.
>>
>
> I maintain that it should be deleted.
>

I think it could used as a mirror, including external tar balls that
NuttX uses and eventually could disappear from their original
site/repositories.

BTW, while we don't do it, it should be nice to have some info there
pointing to the github.com/apache/nuttx

BR,

Alan


Re: 500ms delay between HTTP request execution

2023-09-07 Thread Petro Karashchenko
Hi,

Finally I was able to identify the root cause of the problem. Thank you
Alan! I did an experiment and ran the same app on my SAMv7 based board
(that has the original issue) and ESP32-S3, and... the issue was not
reproduced on ESP32-S3. So I dug into the SAMv7 Ethernet driver and found
an issue with GMAC registers modification and D-Cache write-through mode.
The case is that sometimes the packet was put to the GMAC TX buffer from
the TCP stack, but not actually transmitted because TXGO was set to
register while the corresponding TX descriptor was still not flushed to
memory. I ended up with a generic cache fix
https://github.com/apache/nuttx/pull/10536 that I think should give a
positive influence on all chips based on armv7-m and armv8-m.

Best regards,
Petro

чт, 7 вер. 2023 р. о 13:32 Alan C. Assis  пише:

> Hi Petro,
>
> I don't remember seeing those Retransmits when I was debugging the
> issue with MQTT, see attached image.
>
> I saved all the wireshark dumps, I can share it with you case you want
> to compare.
>
> BR,
>
> Alan
>
> On 9/7/23, Petro Karashchenko  wrote:
> > Hi,
> >
> > I got back to investigating the issue and based on a wireshark logs quite
> > often the SYN message from PC to device is not getting acknowledged and
> > getting retransmitted after 1s.
> >
> > The communication log looks like
> > [image: Screenshot 2023-09-07 at 11.10.33.png]
> >
> > And at the start there is an example of "good" transaction, or I would
> even
> > say a semi-good because I can't explain the "[TCP Retransmission] 59996 -
> > 80 [FIN, ACK] Seq=101 Ack=374 Win=65535 Len=0" from PC to device.
> >
> > Right after the new transaction is started and time diff between "59997 -
> > 80 [SYN] Seq=0 Win=65535 Len=0 MSS=1460 WS=64 TSval=4107001238 TSecr=0
> > SACK_PERM" and "[TCP Retransmission] 59997 - 80 [SYN] Seq=0 Win=65535
> Len=0
> > MSS=1460 WS=64 TSval=4107002239 TSecr=0 SACK PERM" is exactly 1s.
> >
> > Has anybody met such a situation? Is it depending on TCP stack
> > configuration options or maybe I should look for a bug in ethernet
> driver,
> > something like buffer overrun or similar?
> >
> > I'm using a SAMv7 based board and my code trunk is at least 6month behind
> > the latest master.
> >
> > Best regards,
> > Petro
> >
> > пт, 1 вер. 2023 р. о 01:09 Petro Karashchenko
> > 
> > пише:
> >
> >> The delayed ACK option is selected. I will try to deselect it and make
> >> end
> >> to end testing before going further with investigation.
> >> Thank you very much for the hint.
> >>
> >> пт, 1 вер. 2023 р. о 01:04 Gregory Nutt  пише:
> >>
> >>>
> >>> On 8/31/2023 3:39 PM, Petro Karashchenko wrote:
> >>> > Hello,
> >>> >
> >>> > I'm having an issue with a network based application on NuttX.
> >>> > I have a HTTP server that is built with the help of the
> >>> > "netlib_server"
> >>> > interface. When I'm trying to access my server with curl multiple
> >>> > times
> >>> in
> >>> > a row I see that there is a gap close to 500ms on the PC side when
> >>> > accessing the device.
> >>> >
> >>> > I think maybe this is somehow related to a case where each time a new
> >>> > request is accepted the client socket is created, handled and closed?
> >>> > I
> >>> > will deepdive into this of course and will analyze wireshark logs,
> but
> >>> > maybe someone has any guesses or met similar issues in the past? I
> >>> > mean
> >>> > maybe there is some kind of "blacklist" or TCP/socket configuration
> >>> > that
> >>> > prevents new connections from being established for a certain period
> >>> > of
> >>> > time?
> >>> >
> >>> > Best regards,
> >>> > Petro
> >>>
> >>> You will have to use wireshark to get to the bottom.  It sounds like
> >>> there is some delay or timeout that is causing the issue. Perhaps in
> the
> >>> 3-way handshake.  It taks 500ms for a missing ACK to be detected.  Are
> >>> you using delayed ACKs?  That delay is 500ms too.
> >>>
> >>>
> >>>
> >
>