Re: New names of repositories

2022-11-22 Thread Flavio Castro Alves Filho
+1

Em ter., 22 de nov. de 2022 às 10:30, Nathan Hartman
 escreveu:
>
> After hearing back from Infra about the repository naming convention,
> all the recent feedback has been to stay with the default and just
> remove "incubator-" from our repo names, giving:
>
> https://github.com/apache/nuttx
> https://github.com/apache/nuttx-apps
>
> Shall I go ahead and open the Jira ticket to do that?
>
> Cheers,
> Nathan



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: NuttX and C++ libraries: boost / ASIO / std::chrono

2022-03-03 Thread Flavio Castro Alves Filho
Hello Petro,

Did you use any specific feature from boost?

Most used features from boost were integrated to newer versions of C++.

I used C++-17 in a project and it worked fine.

Best regards,

Flavio

Em qua., 2 de mar. de 2022 às 11:01, Xiang Xiao
 escreveu:
>
> We use both uClibc++ and libc++, both work fine. But never try the
> boost library.
>
> On Wed, Mar 2, 2022 at 9:16 PM Petro Karashchenko <
> petro.karashche...@gmail.com> wrote:
>
> > Hello team,
> >
> > I would like to ask who has used C++ libraries with NuttX. For example
> > if I have a C++ application that is based on boost and std::chrono
> > then what should be a good way of starting it with NuttX?
> >
> > Best regards,
> > Petro
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: I does an app know it is building on NuttX

2022-02-23 Thread Flavio Castro Alves Filho
Hi Greg,

When I thought about this issue, my 'solution' was using NuttX as a library :-/

That would work for a single application, but we lose a lot in
application architecture using the NuttX tree.

Maybe porting using "same code"/different architectures would be
advised as a not-recommended scenario for NuttX ...  :-(

Best regards,

Flavio

Em qua., 23 de fev. de 2022 às 00:00, Gregory Nutt
 escreveu:
>
> I think we have done a great job with C code compatibility across
> platforms.  I was thinking more of a common application make system that
> could work on both Linux and NuttX platforms.  The apps/ Makefiles and
> Make.defs files and some of the apps Kconfig menu=ing are not compatible.
> I would like to be able to just type 'make' and the app build would just do
> the right thing.  But in order to do that, the build system would have to
> know which platform it is building on.
>
> Perhaps some indirect, ad hoc, heuristic like checking if TOPDIR and APPDIR
> are defined.  That would probably be enough. Those should always be passed
> to the Makefile from the higher level apps/ build logic, but would never be
> defined when building the application to run natively on Linux or any other
> non-NuttX platform.
>
> Greg
>
>
>
> On Tue, Feb 22, 2022 at 8:31 PM James Dougherty  wrote:
>
> > Hi Greg,
> >
> > Thanks for this; it is one of the greatest features you have built into
> > NuttX - POSIX compliance!!!
> >
> > I have a few programs which compile either for NuttX or Linux/MacOS with no
> > changes (or Makefile
> > -D options). I started out that way, using -D__NuttX__ but then found that
> > besides the includes for NuttX,
> > almost all of the std c library and some of sys (at least filesystem/serial
> > code) needs no change!
> >
> > Instead of gcc dumpspecs archaeology, I just did the opposite and have
> > NuttX be the fall-out for
> > conditional includes in the Posix environment. Most NuttX/Linux
> > cross-platform code files have the below:
> >
> > #ifndef __linux__
> > #include  /* NuttX */
> > #endif
> >
> > /* POSIX Includes (Linux/Nutt-X) common */
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> > #include 
> >
> > I also found some mutually exclusive cases like the below:
> >
> > #ifdef __linux__
> > /* Linux include -D__linux__ */
> > #else
> > /* Nutt-X include  -D__NuttX__ */
> > #endif
> >
> > And yes, I found __NuttX__ defined in the past also
> >
> > $find . -type f | xargs grep _NuttX__
> > ./nuttx/configs/stm32f4discovery/testlibcxx/Make.defs:
> >  -D__NuttX__
> > ./nuttx/configs/bambino-200e/netnsh/Make.defs:CXXFLAGS += $(ARCHDEFINES)
> > $(EXTRADEFINES) -pipe -std=c++11 -DCLOCK_MONOTONIC -D__NuttX__
> > ./nuttx/configs/imxrt1050-evk/libcxxtest/Make.defs:-D__NuttX__
> > $
> >
> > Of course if you're targeting more than one RTOS you'll need more, but I
> > have had great luck with
> > filesystem, pthread, mutex, and serial (termios) portability.
> >
> > Thank you
> > -James
> >
> >
> >
> >
> >
> >
> > On Tue, Feb 22, 2022 at 5:11 PM Gregory Nutt  wrote:
> >
> > > Hmm.. but that doesn't help with setting up the build.  That definition
> > is
> > > only visible to C code since it is a C pre-processor definition defined
> > in
> > > the CFLAGS.  It can't really be used to customize the build, at least not
> > > in any clean way.
> > >
> > > It would have been useful to have a similar, Make=friendly definition as
> > > well.
> > >
> > > On Tue, Feb 22, 2022 at 7:03 PM Gregory Nutt 
> > wrote:
> > >
> > > > Thanks!  Now I see it defined tools/Config.mk.  Looks like that was
> > added
> > > > with #2192.  That is exactly what I need!
> > > >
> > > > I was thrown off because there are applications that ARE using
> > __NUTTX__:
> > > >
> > > > $ grep -rl __NUTTX__ *
> > > > system/adb/Makefile
> > > > system/libuv/0001-initial-libuv-port-to-nuttx.patch
> > > > system/libuv/libuv/Makefile
> > > > system/libuv/tests/Makefile
> > > >
> > > > There are a couple using __NuttX__, but didn't catch those:
> > > >
> > > > $ grep -rl __NuttX__ *
> > > > netutils/ftpd/ftpd.c
> > > > netutils/webclient/webclient.c
> > > >
> > > > Thanks again.
> > > >
> > > >
> > > >
> > > > On Tue, Feb 22, 2022 at 6:43 PM Nathan Hartman <
> > hartman.nat...@gmail.com
> > > >
> > > > wrote:
> > > >
> > > >> On Tue, Feb 22, 2022 at 2:14 PM Gregory Nutt 
> > > wrote:
> > > >>
> > > >> > One option would be to define __NUTTX_ in tools/Config.mk instead of
> > > in
> > > >> > each individual apps/Makefile.  That would provide a single point
> > > >> > definition coordinate all usage.
> > > >>
> > > >>
> > > >> Just one (possible) correction: IIRC it is capitalized as __NuttX__.
> > All
> > > >> my
> > > >> cross platform applications look for __NuttX__ to detect that they are
> 

Re: Build Nuttx on MAC / ARM64 Ubuntu

2022-01-31 Thread Flavio Castro Alves Filho
Hi Peter,

Yes, I intend to use it for simulation only.

It is for a personal project. I already have a Ubuntu based desktop
machine, which works fine. But for mobility, if I could work on my MAC, it
would be better.

I will try to figure out what is going on.

Thank you for all your help.

Best regards,

Flavio


Em dom., 30 de jan. de 2022 10:28, Kalbus, Peter 
escreveu:

> Hi,
>
> are you only interested in the simulation or also have a real target in
> mind?
>
> Maybe you can try to get it working for your real target instead of the
> simulation. The simulation is definitely not working overall on M1 based
> host systems yet.
>
> I‘m using RP2040 based targets and they are working using my M1 based host
> system.
>
> /Piet
>
>
> > Am 30.01.2022 um 13:22 schrieb Flavio de Castro Alves Filho <
> flavio.al...@gmail.com>:
> >
> > That’s what I did.
> >
> > So it is not the problem.
> >
> >> On 29 Jan 2022, at 19:43, Peter Kalbus 
> wrote:
> >>
> >> Hi Flavio,
> >>
> >> there’s an explanation in NuttX documentation:
> https://nuttx.apache.org/docs/latest/quickstart/install.html#kconfig-frontend
> <
> https://nuttx.apache.org/docs/latest/quickstart/install.html#kconfig-frontend
> >
> >> Check for the „MacOS, Ubuntu 18.04 LTS and earlier“ tab.
> >>
> >> It’s a couple of months back, as I did this … but I’m quite sure, that
> I followed that explanation.
> >>
> >> /Piet
> >>
> >>
>  Am 29.01.2022 um 23:17 schrieb Flavio de Castro Alves Filho <
> flavio.al...@gmail.com>:
> >>>
> >>> Hi Peter,
> >>>
> >>> How did you install kconfig-frontends on your machine?
> >>>
> >>> Best regards,
> >>>
> >>> Flavio
> >>>
>  On 29 Jan 2022, at 18:13, Kalbus, Peter 
> wrote:
> 
>  Hi,
> 
>  I know, it‘s not complete. But you should get a different error … I
> see, ARM based CPU is now detected … next step will take longer.
> 
>  /Piet
> 
> > Am 29.01.2022 um 22:03 schrieb Flavio de Castro Alves Filho <
> flavio.al...@gmail.com>:
> >
> > Hello Guys. Thank you for your fast response.
> >
> > @Alan, indeed it is an ARM-based Mac.
> >
> > @Peter, I added your patch in my NuttX project and ran again the
> configuration, but without success yet :-(
> >
> > Here is the output
> >
> > flavio@Flavios-MacBook-Pro nuttx % tools/configure.sh -m sim:nsh
> > Copy files
> > Select CONFIG_HOST_MACOS=y
> > Select CONFIG_HOST_ARM=y
> > Refreshing...
> > make[2]: Nothing to be done for `clean_context'.
> > CP: arch/dummy/Kconfig to
> /Users/flavio/mestrado/nuttx/nuttx/arch/dummy/dummy_kconfig
> > CP: boards/dummy/Kconfig to
> /Users/flavio/mestrado/nuttx/nuttx/boards/dummy/dummy_kconfig
> > LN: platform/board to
> /Users/flavio/mestrado/nuttx/apps/platform/dummy
> > LN: include/arch to arch/sim/include
> > LN: include/arch/board to
> /Users/flavio/mestrado/nuttx/nuttx/boards/sim/sim/sim/include
> > LN: drivers/platform to
> /Users/flavio/mestrado/nuttx/nuttx/drivers/dummy
> > LN: include/arch/chip to
> /Users/flavio/mestrado/nuttx/nuttx/arch/sim/include/sim
> > /Users/flavio/mestrado/nuttx/nuttx/tools/link.sh
> /Users/flavio/mestrado/nuttx/nuttx/arch/sim/include/sim include/arch/chip
> > LN: arch/sim/src/chip to
> /Users/flavio/mestrado/nuttx/nuttx/arch/sim/src/sim
> > LN: arch/sim/src/board to
> /Users/flavio/mestrado/nuttx/nuttx/boards/sim/sim/sim/src
> > touch .dirlinks
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/boot
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/canutils
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/crypto
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/examples
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/fsutils
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/gpsutils
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/graphics
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/industry
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/interpreters
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/math
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/mlearning
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/netutils
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/system/libuv
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/system
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/testing
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/wireless/bluetooth
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/wireless/ieee802154
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps/wireless
> > mkkconfig in /Users/flavio/mestrado/nuttx/apps
> > arch/arm/src/imxrt/Kconfig:1504: syntax error
> > arch/arm/src/imxrt/Kconfig:1503: invalid option
> > arch/arm/src/stm32l4/Kconfig:5347: syntax error
> > arch/arm/src/stm32l4/Kconfig:5296: missing end statement for this
> entry
> > arch/arm/src/stm32l4/Kconfig:5164: missing end statement for this
> entry
> 

Re: C++ CMake HelloWorld - Sim target

2021-11-12 Thread Flavio Castro Alves Filho
Hello Nuno,

It is better to post here the cmake files and the compilation execution.

Now looking at your first email, it seems that the function
'at_quick_exit' cannot be found by the linker.

You can look at NuttX code (app and nuttx) and see where this function
is and who is complaining. For a first implementation, maybe the
linked library does not need the library that is causing the issue can
be removed.

It can be:
* function not compiled during make export
* function not found by cmake-generated linker rule
  - the order of the libraries call is important
  - when I did for stm32, I looked at the linker call when building
standard NuttX to make the same on Cmake

Hope it helps.

Best regards,

Flavio

Em qui., 11 de nov. de 2021 às 22:50, Nuno Barcellos
 escreveu:
>
> Yes, it does. It generates the nuttx-export.zip. Then I set cmake to:
>
> include_directories:
> nuttx-export/include
> nuttx-export/include/libcxx
> nuttx-export/arch/chip
>
> target_link_libraries:
> libs under nuttx-export/libs
>
> And set the compiler and linker flags at nuttx-export/scripts/Make.defs
>
> Nuno
>
>
> Em qui., 11 de nov. de 2021 às 22:15, Flavio Castro Alves Filho <
> flavio.al...@gmail.com> escreveu:
>
> > Hi Nuno,
> >
> > So when you run 'make export' the build runs correctly, right?
> >
> > Best regards,
> >
> > Flavio
> >
> > Em qui., 11 de nov. de 2021 às 21:14, Nuno Barcellos
> >  escreveu:
> > >
> > > Hey Flavio :)
> > >
> > > Yes, I can build and run the helloxx example when it is inside the
> > > nuttx/apps tree (I've been using sim:libcxxtest configuration).
> > >
> > > I'm having problems when trying to build it outside the nuttx tree by
> > using
> > > the nuttx-as-library (make export).
> > > I followed the C++ CMake example in the documentation and was able to get
> > > it working on an STM32 target.
> > > However, the build error I mentioned comes up when I set the target to
> > the
> > > simulator.
> > >
> > > I'm not sure if the cmake toolchain is set correctly. I'm using:
> > >
> > > set(CMAKE_SYSTEM_NAME Linux)
> > > set(CMAKE_SYSTEM_PROCESSOR sim)
> > >
> > > and set the compiler and tools to standard g++.
> > >
> > > Cheers,
> > > Nuno
> > >
> > >
> > >
> > > Em qui., 11 de nov. de 2021 às 20:42, Flavio Castro Alves Filho <
> > > flavio.al...@gmail.com> escreveu:
> > >
> > > > Hello Nuno,
> > > >
> > > > Before starting working with cmake, it is important that the C++
> > > > configuration in nuttx is building and running.
> > > >
> > > > Did you get this part working?
> > > >
> > > > Best regards,
> > > >
> > > > Flavio
> > > >
> > > > Em qui., 11 de nov. de 2021 19:17, Nuno Barcellos <
> > nunobarcel...@gmail.com
> > > > >
> > > > escreveu:
> > > >
> > > > > Hello!
> > > > >
> > > > > Could anyone get the C++ CMake HelloWorld example working for the
> > > > > simulator?
> > > > > I'm using the sim:libcxxtest config but am getting the following
> > error:
> > > > >
> > > > > nuttx-export/include/libcxx/cstdlib:154:9: error: ‘::at_quick_exit’
> > has
> > > > not
> > > > > been declared
> > > > >  154 | using ::at_quick_exit;
> > > > >
> > > > > Thanks,
> > > > > Nuno
> > > > >
> > > >
> > >
> > >
> > > --
> > > Nuno Bernardes Barcellos
> > > *Politecnico di Milano & University of São Paulo*
> > > M.Sc. in Electronics Engineering
> > > +5534988273589 <+393896649806> | nunobarcel...@gmail.com
> >
> >
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.al...@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: C++ CMake HelloWorld - Sim target

2021-11-11 Thread Flavio Castro Alves Filho
Hi Nuno,

So when you run 'make export' the build runs correctly, right?

Best regards,

Flavio

Em qui., 11 de nov. de 2021 às 21:14, Nuno Barcellos
 escreveu:
>
> Hey Flavio :)
>
> Yes, I can build and run the helloxx example when it is inside the
> nuttx/apps tree (I've been using sim:libcxxtest configuration).
>
> I'm having problems when trying to build it outside the nuttx tree by using
> the nuttx-as-library (make export).
> I followed the C++ CMake example in the documentation and was able to get
> it working on an STM32 target.
> However, the build error I mentioned comes up when I set the target to the
> simulator.
>
> I'm not sure if the cmake toolchain is set correctly. I'm using:
>
> set(CMAKE_SYSTEM_NAME Linux)
> set(CMAKE_SYSTEM_PROCESSOR sim)
>
> and set the compiler and tools to standard g++.
>
> Cheers,
> Nuno
>
>
>
> Em qui., 11 de nov. de 2021 às 20:42, Flavio Castro Alves Filho <
> flavio.al...@gmail.com> escreveu:
>
> > Hello Nuno,
> >
> > Before starting working with cmake, it is important that the C++
> > configuration in nuttx is building and running.
> >
> > Did you get this part working?
> >
> > Best regards,
> >
> > Flavio
> >
> > Em qui., 11 de nov. de 2021 19:17, Nuno Barcellos  > >
> > escreveu:
> >
> > > Hello!
> > >
> > > Could anyone get the C++ CMake HelloWorld example working for the
> > > simulator?
> > > I'm using the sim:libcxxtest config but am getting the following error:
> > >
> > > nuttx-export/include/libcxx/cstdlib:154:9: error: ‘::at_quick_exit’ has
> > not
> > > been declared
> > >  154 | using ::at_quick_exit;
> > >
> > > Thanks,
> > > Nuno
> > >
> >
>
>
> --
> Nuno Bernardes Barcellos
> *Politecnico di Milano & University of São Paulo*
> M.Sc. in Electronics Engineering
> +5534988273589 <+393896649806> | nunobarcel...@gmail.com



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: C++ CMake HelloWorld - Sim target

2021-11-11 Thread Flavio Castro Alves Filho
Hello Nuno,

Before starting working with cmake, it is important that the C++
configuration in nuttx is building and running.

Did you get this part working?

Best regards,

Flavio

Em qui., 11 de nov. de 2021 19:17, Nuno Barcellos 
escreveu:

> Hello!
>
> Could anyone get the C++ CMake HelloWorld example working for the
> simulator?
> I'm using the sim:libcxxtest config but am getting the following error:
>
> nuttx-export/include/libcxx/cstdlib:154:9: error: ‘::at_quick_exit’ has not
> been declared
>  154 | using ::at_quick_exit;
>
> Thanks,
> Nuno
>


Re: Poll: Which OS are you using to compile NuttX?

2021-09-24 Thread Flavio Castro Alves Filho
Alan,

How about a poll asking "which other OS would you like to build NuttX?" :-P

Best regards,

Flavio

Em sex., 24 de set. de 2021 às 17:45, Tim Hardisty
 escreveu:
>
> Linux
>
>
>
> On 24/09/2021, 21:07, "Alan Carvalho de Assis"  wrote:
>
> Sorry guys, I suppose you are using LinkedIn too.
>
> Yes, probably it will collect some data from you, but you are using a
> better MS gather:
>
> "Sent from Mail for Windows"
>
> So, if you are already in the hell, please give a warm hug in the Lucifer 
> :-D
>
> Now, let be serious here: for those who don't have LinkedIn access,
> please reply this email with one of these options:
>
> 1) Linux
> 2) MacOS
> 3) Windows using Cygwin
> 4) Windows Native
>
> Thank you for the understanding.
>
> BR,
>
> Alan
>
> On 9/24/21, Russell Haley  wrote:
> > The link gives me “This post cannot be displayed”. I am logged into the
> > Microsoft data collection site known as LinkedIn.
> >
> > Sent from Mail for Windows
> >
> > From: Tim Hardisty
> > Sent: Friday, September 24, 2021 12:54 PM
> > To: dev@nuttx.apache.org
> > Subject: Re: Poll: Which OS are you using to compile NuttX?
> >
> > Needs a LinkedIn login?
> >
> >
> >
> > From: Alan Carvalho de Assis 
> > Reply to: "dev@nuttx.apache.org" 
> > Date: Friday, 24 September 2021 at 20:20
> > To: dev 
> > Subject: Poll: Which OS are you using to compile NuttX?
> >
> > Hi Everyone, Please help us to discover which OS people are using most 
> to
> > compile NuttX:
> > 
> https://www.linkedin.com/feed/update/urn:li:activity:6847246067046596609/ It
> > will help us to decide how better support your host OS. BR, Alan
> >
> >
>
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: .NET nanoFramework ported to NuttX running on Raspberry Pi Pico

2021-06-28 Thread Flavio Castro Alves Filho
This project is really nice.

Isn't it good enough for a presentation at the workshop?

Best regards,

Flavio

Em dom., 27 de jun. de 2021 às 13:49, Alan Carvalho de Assis
 escreveu:
>
> Hi Nathan,
>
> Yes, I already suggested it, but he didn't submit a proposal to the
> N.O.W. event yet, he was waiting to get more features supported.
>
> His post is gaining a low of visibility, let see if someone from
> Microsoft will see it! ;-)
>
> BR,
>
> Alan
>
> On 6/27/21, Nathan Hartman  wrote:
> > On Sun, Jun 27, 2021 at 11:16 AM Alan Carvalho de Assis
> >  wrote:
> >>
> >> Hi Everyone,
> >>
> >> Case some of you didn't see it yet:
> >>
> >> https://microhobby.com.br/blog/2021/06/24/running-dotnet-on-raspberry-pi-pico/
> >>
> >> https://www.linkedin.com/feed/update/urn:li:activity:6814662746039181312/
> >>
> >> BR,
> >>
> >> Alan
> >
> >
> > Thanks for sharing.
> >
> > Maybe extend an invitation to them to post about it here or speak
> > about it at a NuttX event?
> >
> > Cheers,
> > Nathan
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Socket programming: send() function blocked

2021-06-28 Thread Flavio Castro Alves Filho
Hello Johnny,

Thank you for the explanation. That's an important remark so I can
continue the evaluation here.

I was thinking that the issue was related to the MQTT library. But, in
fact, there is something wrong with the TCP connection.

I will post here as soon as I have more news.

Best regards,

Flavio

Em dom., 27 de jun. de 2021 às 13:56, Johnny Billquist
 escreveu:
>
> Something is seriously wrong in your first run.
> Maybe a tcpdump would expose something, but basically, tcp_max_wrb_size
> should never be 0, but in your first run it appears to be.
>
> As that is the buffer size to use, you end up with a tcp connection with
> a buffer size of 0, so of course all writes (including send) will return
> with success, but with 0 bytes written, since there wasn't space for
> anything more.
>
> tcp_max_wrb_size should be based on mss, which suggests that mss would
> be zero. But that is rather surprising. Since the mss is exchanged
> between the hosts at tcp connection establishment, it would be very
> interesting to report what mss each side is suggesting.
>
> It might be that one side isn't reporting any mss at all, and then the
> tcp implementation in Nuttx behaves badly. I don't really have time to
> dive into this more right now, but this should give you some pointers
> and ideas to where to look further.
>
>Johnny
>
> On 2021-06-27 16:34, Flavio Castro Alves Filho wrote:
> > I'm sorry ... I got the same behavior, but the send function now
> > started to work non-blocking.
> >
> > Here is my situation:
> >
> > * I have 2 mqtt brokers (tcp servers)
> >- one commercial (Tago.io)
> >- one personal (Mosquitto)
> >
> > After a successful connection in both cases, the next step is to send
> > the mqtt connect message.
> >
> > Below shows the execution trace for the commercial broker.
> >
> > [972934023.72] [  INFO] psock_vfcntl: sockfd=0x10007a70 cmd=9
> > [972934023.73] [  INFO] psock_tcp_send (0x1000a9ac):
> > [972934023.73] [  INFO]   10 42 00 04 4d 51 54 54 04 c2 01 90
> > 00 07 54 65  .B..MQTT..Te
> > [972934023.74] [  INFO] 0010  73 74 65 47 57 00 07 70 68 69 74 61
> > 67 6f 00 24  steGW..phitago.$
> > [972934023.75] [  INFO] 0020  30 66 30 62 36 37 33 64 2d 33 64 35
> > 66 2d 34 38  0f0b673d-3d5f-48
> > [972934023.76] [  INFO] 0030  38 62 2d 62 38 62 36 2d 62 36 35 36
> > 35 66 37 39  8b-b8b6-b6565f79
> > [972934023.77] [  INFO] 0040  66 32 66 64
> >  f2fd
> > [972934023.78] [  INFO] tcp_max_wrb_size: tcp_max_wrb_size = 0 for
> > conn 0x20006e78
> > [972934023.78] [  INFO] psock_tcp_send: new wrb 0x200073fc (non 
> > blocking)
> > [972934023.79] [  INFO] iob_copyin_internal: iob=0x20004238 len=0 
> > offset=0
> >
> > The send() result is 0. And keeps always in this way.
> >
> > And below we have the traces for the personal broker transmission.
> >
> > [972932455.67] [  INFO] psock_vfcntl: sockfd=0x10007a70 cmd=9
> > [972932455.67] [  INFO] psock_tcp_send (0x1000a9ac):
> > [972932455.68] [  INFO]   10 42 00 04 4d 51 54 54 04 c2 01 90
> > 00 07 54 65  .B..MQTT..Te
> > [972932455.69] [  INFO] 0010  73 74 65 47 57 00 07 70 68 69 74 61
> > 67 6f 00 24  steGW..phitago.$
> > [972932455.70] [  INFO] 0020  30 66 30 62 36 37 33 64 2d 33 64 35
> > 66 2d 34 38  0f0b673d-3d5f-48
> > [972932455.71] [  INFO] 0030  38 62 2d 62 38 62 36 2d 62 36 35 36
> > 35 66 37 39  8b-b8b6-b6565f79
> > [972932455.71] [  INFO] 0040  66 32 66 64
> >  f2fd
> > [972932455.72] [  INFO] tcp_max_wrb_size: tcp_max_wrb_size = 2144
> > for conn 0x20006e78
> > [972932455.73] [  INFO] psock_tcp_send: new wrb 0x200073fc (non 
> > blocking)
> > [972932455.74] [  INFO] iob_copyin_internal: iob=0x20004238 len=68 
> > offset=0
> > [972932455.75] [  INFO] iob_copyin_internal: iob=0x20004238
> > avail=0 len=68 next=0
> >
> > In this case, send return a value bigger than 0.
> >
> > Could you please give me any advice to understand what's going on? Or
> > what can I check?
> >
> > The connect() response is 0 in both cases.
> >
> > Using PC-based tools, such as MQTT.Fx, I can connect to the host.
> >
> > Best regards,
> >
> > Flavio
> >
> > Em sáb., 26 de jun. de 2021 às 13:57, Gregory Nutt
> >  escreveu:
> >>
> >>
> >>> Is there any chance that the broker didn't like the mqtt connect
> >>> message and shutdown the connection and leaving my device alone ...
> >>> all during send call?
> >> If the peer disconnects, the socket should be marked disconnected and
> >> the send() should fail with an error.
> >
> >
> >
>
> --
> Johnny Billquist  || "I'm on a bus
>||  on a psychedelic trip
> email: b...@softjar.se ||  Reading murder books
> pdp is alive! ||  tryin' to stay hip" - B. Idol



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Socket programming: send() function blocked

2021-06-27 Thread Flavio Castro Alves Filho
I'm sorry ... I got the same behavior, but the send function now
started to work non-blocking.

Here is my situation:

* I have 2 mqtt brokers (tcp servers)
  - one commercial (Tago.io)
  - one personal (Mosquitto)

After a successful connection in both cases, the next step is to send
the mqtt connect message.

Below shows the execution trace for the commercial broker.

[972934023.72] [  INFO] psock_vfcntl: sockfd=0x10007a70 cmd=9
[972934023.73] [  INFO] psock_tcp_send (0x1000a9ac):
[972934023.73] [  INFO]   10 42 00 04 4d 51 54 54 04 c2 01 90
00 07 54 65  .B..MQTT..Te
[972934023.74] [  INFO] 0010  73 74 65 47 57 00 07 70 68 69 74 61
67 6f 00 24  steGW..phitago.$
[972934023.75] [  INFO] 0020  30 66 30 62 36 37 33 64 2d 33 64 35
66 2d 34 38  0f0b673d-3d5f-48
[972934023.76] [  INFO] 0030  38 62 2d 62 38 62 36 2d 62 36 35 36
35 66 37 39  8b-b8b6-b6565f79
[972934023.77] [  INFO] 0040  66 32 66 64
f2fd
[972934023.78] [  INFO] tcp_max_wrb_size: tcp_max_wrb_size = 0 for
conn 0x20006e78
[972934023.78] [  INFO] psock_tcp_send: new wrb 0x200073fc (non blocking)
[972934023.79] [  INFO] iob_copyin_internal: iob=0x20004238 len=0 offset=0

The send() result is 0. And keeps always in this way.

And below we have the traces for the personal broker transmission.

[972932455.67] [  INFO] psock_vfcntl: sockfd=0x10007a70 cmd=9
[972932455.67] [  INFO] psock_tcp_send (0x1000a9ac):
[972932455.68] [  INFO]   10 42 00 04 4d 51 54 54 04 c2 01 90
00 07 54 65  .B..MQTT..Te
[972932455.69] [  INFO] 0010  73 74 65 47 57 00 07 70 68 69 74 61
67 6f 00 24  steGW..phitago.$
[972932455.70] [  INFO] 0020  30 66 30 62 36 37 33 64 2d 33 64 35
66 2d 34 38  0f0b673d-3d5f-48
[972932455.71] [  INFO] 0030  38 62 2d 62 38 62 36 2d 62 36 35 36
35 66 37 39  8b-b8b6-b6565f79
[972932455.71] [  INFO] 0040  66 32 66 64
f2fd
[972932455.72] [  INFO] tcp_max_wrb_size: tcp_max_wrb_size = 2144
for conn 0x20006e78
[972932455.73] [  INFO] psock_tcp_send: new wrb 0x200073fc (non blocking)
[972932455.74] [  INFO] iob_copyin_internal: iob=0x20004238 len=68 offset=0
[972932455.75] [  INFO] iob_copyin_internal: iob=0x20004238
avail=0 len=68 next=0

In this case, send return a value bigger than 0.

Could you please give me any advice to understand what's going on? Or
what can I check?

The connect() response is 0 in both cases.

Using PC-based tools, such as MQTT.Fx, I can connect to the host.

Best regards,

Flavio

Em sáb., 26 de jun. de 2021 às 13:57, Gregory Nutt
 escreveu:
>
>
> > Is there any chance that the broker didn't like the mqtt connect
> > message and shutdown the connection and leaving my device alone ...
> > all during send call?
> If the peer disconnects, the socket should be marked disconnected and
> the send() should fail with an error.



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Socket programming: send() function blocked

2021-06-26 Thread Flavio Castro Alves Filho
Is there any chance that the broker didn't like the mqtt connect
message and shutdown the connection and leaving my device alone ...
all during send call?

Em sáb., 26 de jun. de 2021 às 11:42, Flavio Castro Alves Filho
 escreveu:
>
> Hello Greg,
>
> No. It was not set :-(
>
> I turned on the configuration, but the problem persisted. :-(
>
> Best regards,
>
> Flavio
>
> Em sáb., 26 de jun. de 2021 às 10:41, Gregory Nutt
>  escreveu:
> >
> > Do you have CONFIG_NET_TCP_WRITE_BUFFERS=y selected?  It is required for
> > TCP non-blocking send.
> >
>
>
> --
> Flavio de Castro Alves Filho
>
> flavio.al...@gmail.com
> Twitter: http://twitter.com/#!/fraviofii
> LinkedIn profile: www.linkedin.com/in/flaviocastroalves



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Socket programming: send() function blocked

2021-06-26 Thread Flavio Castro Alves Filho
Hello Greg,

No. It was not set :-(

I turned on the configuration, but the problem persisted. :-(

Best regards,

Flavio

Em sáb., 26 de jun. de 2021 às 10:41, Gregory Nutt
 escreveu:
>
> Do you have CONFIG_NET_TCP_WRITE_BUFFERS=y selected?  It is required for
> TCP non-blocking send.
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Socket programming: send() function blocked

2021-06-26 Thread Flavio Castro Alves Filho
Hello,

I am using the MQTT-C library (https://github.com/LiamBindle/MQTT-C)
in my NuttX project and I am facing a quite interesting issue with a
specific server.

For a specific broker, which is a commercial one, after the connection
is established, when the MQTT Connect message is sent, the firmware
gets stuck.

Debugging the code, I can see that the send() function is blocked.

When I set the socket, I setup to work in non-blocking mode:

===
/*
 * Opening socket
 */
int sockfd = socket(AF_INET, SOCK_STREAM | SOCK_NONBLOCK, IPPROTO_IP);
if (sockfd == -1) {
syslog(LOG_ERR, "MqttClient: error socket() %d
(%s)\n",errno,strerror(errno));
return -1;
}

struct timeval tv;
tv.tv_sec  = 3;
tv.tv_usec = 0;

setsockopt(sockfd, SOL_SOCKET, SO_RCVTIMEO,
(FAR const void *), sizeof(struct timeval));
setsockopt(sockfd, SOL_SOCKET, SO_SNDTIMEO,
(FAR const void *), sizeof(struct timeval));
/*
 * Connecting
 */
int rv = connect(sockfd, server_address, server_address_len);
syslog(LOG_DEBUG,"connect() = %d\n",rv);
if(rv == -1) {
syslog(LOG_ERR, "MqttClient: error connect() %d
(%s)\n",errno,strerror(errno));
close(sockfd);
sockfd = -1;
return -1;
}
/*
 * make non-blocking
 */
if (sockfd != -1) {
fcntl(sockfd, F_SETFL, fcntl(sockfd, F_GETFL) | O_NONBLOCK);
}
===

I couldn't find the reason why the send() function gets stuck.

And, worst, it happens when I try to communicate with a specific broker.

Can anyone give me advice about why it is happening and what I am doing wrong?

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: [Discuss] Migrate the build system to CMake

2021-06-10 Thread Flavio Castro Alves Filho
Hello Guys,

In my specific situation, I use NuttX separately from the application,
deployed as a library.

And I use CMake to build my application. My reason to choose CMake was
tool integration and easier support to add other open source
libraries.

CMake can build fast, but make is not slow. In fact, CMake is a
makefile file generator. I use ninja in my builds, but could be make
as well. Probably that's the reason that it works better in different
environments.

Adding another point for the discussion, maybe the build system for
the operating system should not be the same for the application, just
like Linux today. The build system challenge is more relevant if you
have OS and apps together. Considering OS as, somehow, a BSP, then I
don't know what would be the value for changing the build system.

Best regards,

Flavio



Em qui., 10 de jun. de 2021 às 04:50, Sebastien Lorquet
 escreveu:
>
> Hello,
>
> Le 10/06/2021 à 02:00, Matias N. a écrit :
> > With regards to comments about others requiring some hands-on time to become
> > familiar with the system and try it for themselves: I agree with this point 
> > and was one
> > of the reasons I actually started the migration. As I mentioned several 
> > weeks ago,
> > the cmake branch can already be tested on the currently supported boards by 
> > everyone
> > wishing to do so, but I don't think anyone really tried it as my offers 
> > about
> > assistance in this were unanswered.
>
> I have no doubt that the new build system will work better.
>
> I understand that it builds faster than the existing and requires less
> kludges, and permits out of tree builds.
>
> But it's a fundamental change about how to approach the NuttX OS globally.
>
> The track record of this OS in terms of user documentation is not very
> good, to be honest, it requires a lot of time to dig in various source
> files and different web sites to understand how to do something.
>
> This is not only my experience, it's the feeling of all of the ~10
> persons I have tried to introduce to Nuttx: This OS is hard, it does not
> guide beginners and it's hard to do "WHAT I WANT" (which is usually not
> configuring nsh on a stm32f4discovery, but hands-on use case on custom
> hardware with custom apps).
>
> With that in mind, I am very worried of a supplemental dispersion of
> useful documentation.
>
> At what release/commit does the build system becomes cmake? before that,
> please refer to the make build system documentation. chances are that
> this doc quickly becomes 404, leaving all users of all versions in the
> dark. for commits after that, please refer to this other documentation
> on some personal blog, but only for release a.b.c later than this date.
>
> I dont think cmake is technically wrong, but from a USER POINT OF VIEW,
> it will become a nightmare and will drive new contributors away, because
> of documentation problems.
>
> Not to mention old users who spend weeks just to migrate a few boards
> from an old to a new nuttx, just because a makefile and a critical
> variable were renamed but no migration documentation exists. Add more
> changes, and a project may become unusable in the current state of the
> project.
>
> So please. Keep NuttX interfaces STABLE for users that need it. It's not
> a beta project anymore, it's "mature" as you advertise it, which means
> it has some real industrial users that matter more than abstract
> technical beauty. EXTRADEFINES now also need to include flags. hah, not
> cool. I should rename that to EXTRAFLAGS, thats more cute. But how many
> users will suffer from this apparently benign change? These questions
> NEED to be asked by developers and contributors and reviewers.
>
> When you make a change, please ask yourselves: how many unknown users
> will I f*k up with that?
>
> As a famous quote more or less goes, because it can be done does not
> mean it should be done.
>
> And having a generator that derives cmake files from current makefiles
> feels a bit like xkcd #927
>
> Sebastien
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Undefined reference to longjmp/setjmp

2021-06-10 Thread Flavio Castro Alves Filho
>
> We really ought to talk to the Lua team and see if we can upstream the
> changes.  Unsupported ports in NuttX don't have good shelf life.
>

I believe that one of the reasons is that Lua's major use case is to
be embedded inside applications, isn't it?

I don't know if Lua is used so much as a replacement for bash, perl or python ..

In this case, maybe a document explaining how to add on a project
could be enough :-|

Best regards,

Flavio


Re: ESP8266 support

2021-06-03 Thread Flavio Castro Alves Filho
To be honest, I started to work that way :-)

Then I had 2 doubts:

1. How to use the UART interface inside a device driver?
2. Is it ok to duplicate the AT commands? Maybe this question was answered :-)

Best regards,

Flavio

Em qui., 3 de jun. de 2021 às 12:53, Gregory Nutt
 escreveu:
>
>
> >> Looking at NuttX source code, I couldn't find any example of an
> >> application that implements the ESP8266 functions. Is there any place
> >> where I can find reference for this use?
> > There is a separate application in apps/netutils/esp8266.  I've never
> > tried it though, so I don't now about its state.
>
> There is also the the apps/wireless/gs2200m that is a very mature,
> USRSOCK wireless interface and should be very similar to an ESP8266
> USRSOCK solution.
>
> The apps/netutils/esp8266 is a standalone C callable library for ESP8266
> interfacing.  It was contributed by Pierre-noel Bouteville in 2016 and I
> am not aware that it has every been used since then.
>
> I really should have a USRSOCK interface and should reside at
> apps/wireless/esp8266.
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Question about USRSOCK deployment

2021-06-03 Thread Flavio Castro Alves Filho
Hello,

I am working on the integration between ESP8266 module and
STMF4Discovery-based board using UART communication.

I am implementing a thread where I use USRSOCK to interface with the
NuttX network infrastructure and the netutils/esp8266 library to send
commands to the module.

My project reference is the example for GS2200m available in NuttX source code.

In this project, when we have the map between the requested functions
and its execution (handlers array in
https://github.com/apache/incubator-nuttx-apps/blob/1140bebfc0bef2b92037341e0a94437fa3fecd3e/wireless/gs2200m/gs2200m_main.c#L139),
I can see the execution calls for sendto() and recvfrom() functions.

These functions are commonly associated with UDP communication.

In my case, I need to implement TCP communication, where send() and
recv() are the main functions.

I would like to ask for advice about how to add support for send() and
recv() commands in USRSOCK.

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: ESP8266 support

2021-06-03 Thread Flavio Castro Alves Filho
Em qui., 3 de jun. de 2021 às 11:33, Abdelatif Guettouche
 escreveu:
>
> > Looking at NuttX source code, I couldn't find any example of an
> > application that implements the ESP8266 functions. Is there any place
> > where I can find reference for this use?
>
> There is a separate application in apps/netutils/esp8266.  I've never
> tried it though, so I don't now about its state.
>

That's the library I am currently working on. There is no application
there, only the functions.


Re: ESP8266 support

2021-06-03 Thread Flavio Castro Alves Filho
Em qui., 3 de jun. de 2021 às 11:28, Grr  escreveu:
>
> There's a protocol to use SPI as network link, which obviously has much
> bigger bandwidth and potential
>
> If you're not in a hurry to implement the solution and are interested in
> developing a better one, count me in

My hardware is closed for now, and I have to leave with this UART communication.

There is an issue with my hardware where there is no GPIO defined to
control the power of the module. So, when the module gets stuck, I
can't recover without rebooting everything :-(

In the past, I have implemented the AT commands to drive the module.
But not on Nuttx. Reading the available library, the approach seems
fine to me.

Regarding SPI communication, this can indeed be a nice idea. We can
work on this for the STM32F4DISCOVERY board. And in future reviews of
my board I can change the ESP8266 connections.

Best regards,

Flavio

>
> El jue., 3 de jun. de 2021 9:02 AM, Flavio Castro Alves Filho <
> flavio.al...@gmail.com> escribió:
>
> > Hello,
> >
> > I am using UART.
> >
> >
> > Em qui., 3 de jun. de 2021 às 10:44, Grr  escreveu:
> > >
> > > What physical link will you use to connect 8266 and main board?
> > >
> > > Your project is very interesting and opens a lot of potential for
> > > inexpensive distributed control
> > >
> > > El jue., 3 de jun. de 2021 8:27 AM, Flavio Castro Alves Filho <
> > > flavio.al...@gmail.com> escribió:
> > >
> > > > Hello,
> > > >
> > > > I am working on the integration between a STM32F4Discovery based board
> > > > to a ESP8266-WROOM-2 module, in order to have WiFi connectivity.
> > > >
> > > > My plan is to implement a thread using USRSOCK and the ESP8266
> > > > functions available in netutils, using as reference the work
> > > > previously done with GS2200m.
> > > >
> > > > Looking at NuttX source code, I couldn't find any example of an
> > > > application that implements the ESP8266 functions. Is there any place
> > > > where I can find reference for this use?
> > > >
> > > > Best regards,
> > > >
> > > > Flavio
> > > >
> > > > --
> > > > Flavio de Castro Alves Filho
> > > >
> > > > flavio.al...@gmail.com
> > > > Twitter: http://twitter.com/#!/fraviofii
> > > > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> > > >
> >
> >
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.al...@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: ESP8266 support

2021-06-03 Thread Flavio Castro Alves Filho
Hello,

I am using UART.


Em qui., 3 de jun. de 2021 às 10:44, Grr  escreveu:
>
> What physical link will you use to connect 8266 and main board?
>
> Your project is very interesting and opens a lot of potential for
> inexpensive distributed control
>
> El jue., 3 de jun. de 2021 8:27 AM, Flavio Castro Alves Filho <
> flavio.al...@gmail.com> escribió:
>
> > Hello,
> >
> > I am working on the integration between a STM32F4Discovery based board
> > to a ESP8266-WROOM-2 module, in order to have WiFi connectivity.
> >
> > My plan is to implement a thread using USRSOCK and the ESP8266
> > functions available in netutils, using as reference the work
> > previously done with GS2200m.
> >
> > Looking at NuttX source code, I couldn't find any example of an
> > application that implements the ESP8266 functions. Is there any place
> > where I can find reference for this use?
> >
> > Best regards,
> >
> > Flavio
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.al...@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


ESP8266 support

2021-06-03 Thread Flavio Castro Alves Filho
Hello,

I am working on the integration between a STM32F4Discovery based board
to a ESP8266-WROOM-2 module, in order to have WiFi connectivity.

My plan is to implement a thread using USRSOCK and the ESP8266
functions available in netutils, using as reference the work
previously done with GS2200m.

Looking at NuttX source code, I couldn't find any example of an
application that implements the ESP8266 functions. Is there any place
where I can find reference for this use?

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Support for disk full detection using LittleFS

2021-05-28 Thread Flavio Castro Alves Filho
Hello,

I am using LittleFS to store information on an external dataflash.

I need to know if the memory is full. I saw that the nsh provides the
df command, which as far as I understood is a cat for /proc/fs/usage
file.

In my code, I could see the LFS message indicating LFS_ERR_NOSPC,
which is an error message indicating no more space when writing files.
But the return from the fwrite call is OK (indicating the number of
written bytes) :-|

Is /proc/fs/usage available for LittleFS? Is there any way to get the
disk space programmatically?

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: (Standard | Recommended) way to create NuttX applications

2021-05-23 Thread Flavio Castro Alves Filho
Em sáb., 22 de mai. de 2021 às 18:01, Gregory Nutt
 escreveu:
>
>
> > In my application, I am not using nutshell.
> >
> > But I was wondering if is it the best, or correct or recommended way to do.
>
> I don't think there is a best or recommended in this case.  You should
> do what is best for you and for the final product.
>
> Often people build NSH in their development builds, but omit it from
> final production build.  Many embedded systems have no easily accessible
> to UI and carrying NSH is a waste of FLASH in that case.
>
> NSH can also be a security hole if you don't carefully check which
> commands are available or do not use a login.

I was thinking about that.

>
> Other people like to keep NSH in FLASH for post-release debugging or for
> remote sessions.
>
> There is no one-size-fits-all answer.
>

Indeed.

In my case, I implemented a single application controlling everything,
maybe just like any firmware.

And I prepared my environment to work that way.

But, then, rethinking a little bit, I could split my "large"
application into some "small" applications communicating between each
other. Then the environment changes, the build process changes,
integration changes.

It's nice to see that there are several possibilities.

Best regards,

Flavio

> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: (Standard | Recommended) way to create NuttX applications

2021-05-22 Thread Flavio Castro Alves Filho
:-D

In my application, I am not using nutshell.

But I was wondering if is it the best, or correct or recommended way to do.

Best regards,

Flavio


Em sáb., 22 de mai. de 2021 12:24, David Sidrane 
escreveu:

> Yes you can,
>
> Just call the app.
>
> Create and app. Call it what you like. user_start etc.
>
> Set
>
> CONFIG_USERMAIN_STACKSIZE=1100
> CONFIG_USER_ENTRYPOINT="user_start"
>
> Int user_start(int argc, char *argv[])
> {
>  return ...;
> }
>
>
> CONFIG_USERMAIN_STACKSIZE=1100
> CONFIG_USER_ENTRYPOINT="pigs_can_fly "
>
> Int pigs_can_fly (int argc, char *argv[])
> {
> return ...;
> }
>
> -Original Message-
> From: Gregory Nutt [mailto:spudan...@gmail.com]
> Sent: Saturday, May 22, 2021 7:12 AM
> To: dev@nuttx.apache.org
> Subject: Re: (Standard | Recommended) way to create NuttX applications
>
>
> > This question is more of a curiosity. Which is the most used, or
> > recommended to implement and deploy an application in a NuttX
> > environment?
> >
> > I saw that it is possible to have several applications to be called by
> > NuttShell, and you can set applications to run when NuttShell starts.
> >
> > It is also possible to have a standalone application without NutShell.
> >
> > Is there any recommended approach?
>
> No, NuttX is an OS.  You can setup your applications in any that you
> would like.
>
> PX4 uses an NSH startup script to bring up their system.
>


(Standard | Recommended) way to create NuttX applications

2021-05-22 Thread Flavio Castro Alves Filho
Hello,

This question is more of a curiosity. Which is the most used, or
recommended to implement and deploy an application in a NuttX
environment?

I saw that it is possible to have several applications to be called by
NuttShell, and you can set applications to run when NuttShell starts.

It is also possible to have a standalone application without NutShell.

Is there any recommended approach?

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Dev environment

2021-05-21 Thread Flavio Castro Alves Filho
Hello Tim,

I use VSCode with GDB and Segger.

But Ubuntu does not come with GDB. So I use x-pack toolchain to build and debug.

It works well.

Best regards,

Flavio


Em sex., 21 de mai. de 2021 às 13:28, Tim  escreveu:
>
> Eventually got a Linux dev environment up and running (first PC purchased 
> failed after a few hours...grrr...now have an Intel i5 NUC for this).  Amazed 
> how darn fast compilation is compared to WSL (even on my 3.3GHz Zeon-based 
> workstation with the -j6 make option) so that in itself means it was a great 
> move! Always liked Linux anyway lol.
>
> Eclipse (latest version) still not playing ball - just won't debug. So I'm 
> assuming a platform independent setup issue with it; aka finger trouble :(
>
> I am temporarily using Segger Ozone - worked first time and can finally 
> debug. Not sure I like it but hey ho.
>
> As an aside, has anyone got a recommendation of a good, graphical, GDB 
> debugger for Linux, that place nicely with NuttX? Not bothered about an IDE 
> as such, and I'm 100% happy with building via terminal, but a feature rich 
> and easy to use debugger that looks up the source code "thoroughly" is an 
> essential.
>
> But, now I can set breakpoints, I found that lack of debug messages on the 
> console was because the .config was sending them to RAM not CONSOLE, because 
> that's what is in the sama5d2-xult defconfig file I based my custom config on.
>
> Simple explanation, but is this documented anywhere? Can't find that level of 
> syslog stuff using make menuconfig?
>
> Also now, at least, I know that the board is crashing in can_hwinitialize 
> when it calls can_putreg(priv, SAM_PMC_PCR, regval)...so next week's task is 
> to find out what's up with this (it's not my code).
>
> >>On 5/12/21, Tim Hardisty  wrote:
> From: Alan Carvalho de Assis 
> 
> Did you enable CONFIG_DEBUG_CAN_INFO in your menuconfig?
> 
>   │ -> Build Setup
>    │
>   │   -> Debug Options
>    │
>   │ -> Enable Debug Features (DEBUG_FEATURES [=y])
>    │
>   │   -> CAN Debug Features (DEBUG_CAN [=y])
> 
> >>>
> >>> Indeed I did. And, anyway, even if I hadn't my debug message might
> >>> appear but the system would keep running, but it doesn't: it crashes.
> >>> I have inserted the while(1) to narrow it down to where it
> >>> crashesit is the call to that debug message that does it :(
> >>>
> >>
> >>Try to put a sam_piowrite(PIO_LED_YOURLED, true/false); to between the
> >>caninfo() and the while(1); just for a double check ;-)
> >>
> >>By PIO_LED_YOURLED I mean the LED that is turning ON when your board
> >>initializes.
> >>
> >>Talking about LEDs... other important thing: normally when NuttX
> >>crashes the board LED start to blink to indicate an issue, is it blinking 
> >>on your
> >board?
> >
> >This is a custom board, and no LED such as that. I have removed any LED-
> >related stuff from the board.h file...is that the issue? Maybe NuttX 
> >absolutely
> >depends on some kind of LED?
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Ethernet cable (network interface availability) detection

2021-05-21 Thread Flavio Castro Alves Filho
Hello,

At the end, I implement in my application main loop the following procedure:

=> I get the current interface status using netlib_getifstatus() (devup)

=> check the link state using ioctl with the key SIOCGMIIREG and the
register MII_MSR.

=> I check the result with the MII_MSR_LINKSTATUS flag (linkup)

=> Then I performed the following verifications:
if (!devup && linkup) => netlib_ifup()
if (devup && !linkup) => netlib_down()

In fact, that's quite the same approach found in net_monitor. But, the
net_monitor cannot be called due the lack of interruption.

Best regards,

Flavio

Em qua., 19 de mai. de 2021 às 21:49, Flavio Castro Alves Filho
 escreveu:
>
> Hello David,
>
> I will try this option.
>
> Thank you very much.
>
> Best regards,
>
> Flavio
>
>
> Em qua., 19 de mai. de 2021 19:28, David Sidrane  
> escreveu:
>>
>> This https://github.com/apache/incubator-nuttx/pull/1924 was merged. It adds
>> the polling.
>>
>> This is the app https://github.com/PX4/NuttX-apps/pull/8  does the rest.
>>
>> It was not upstreamed because it was not everything others wanted and I
>> could not test what they wanted.
>>
>> David
>>
>> -Original Message-
>> From: Gregory Nutt [mailto:spudan...@gmail.com]
>> Sent: Wednesday, May 19, 2021 2:56 PM
>> To: dev@nuttx.apache.org
>> Subject: Re: Ethernet cable (network interface availability) detection
>>
>>
>> > Considering this scenario, is there any alternative approach that I
>> > could use to have this detection? Polling the phy, or something
>> > similar?
>>
>> As I recall, David Sidrane submitted a PR to do just this but it was not
>> incoporated.  I don't recall why.   I recall having some concerns that
>> polling the PHY in maintenance mode would interfere with normal
>> operational mode, but I think David demonstrated that there was not an
>> issue with that.
>>
>> I think these:
>>
>> https://github.com/apache/incubator-nuttx-apps/pull/402
>>
>> https://github.com/apache/incubator-nuttx-apps/pull/415



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Ethernet cable (network interface availability) detection

2021-05-19 Thread Flavio Castro Alves Filho
Hello David,

I will try this option.

Thank you very much.

Best regards,

Flavio


Em qua., 19 de mai. de 2021 19:28, David Sidrane 
escreveu:

> This https://github.com/apache/incubator-nuttx/pull/1924 was merged. It
> adds
> the polling.
>
> This is the app https://github.com/PX4/NuttX-apps/pull/8  does the rest.
>
> It was not upstreamed because it was not everything others wanted and I
> could not test what they wanted.
>
> David
>
> -Original Message-
> From: Gregory Nutt [mailto:spudan...@gmail.com]
> Sent: Wednesday, May 19, 2021 2:56 PM
> To: dev@nuttx.apache.org
> Subject: Re: Ethernet cable (network interface availability) detection
>
>
> > Considering this scenario, is there any alternative approach that I
> > could use to have this detection? Polling the phy, or something
> > similar?
>
> As I recall, David Sidrane submitted a PR to do just this but it was not
> incoporated.  I don't recall why.   I recall having some concerns that
> polling the PHY in maintenance mode would interfere with normal
> operational mode, but I think David demonstrated that there was not an
> issue with that.
>
> I think these:
>
> https://github.com/apache/incubator-nuttx-apps/pull/402
>
> https://github.com/apache/incubator-nuttx-apps/pull/415
>


Re: Ethernet cable (network interface availability) detection

2021-05-19 Thread Flavio Castro Alves Filho
Hello Gregory,

Thank you for your quick response.

Looking at the PRs, they seemed a bit complex for me :-| And I'm not
sure if it is that what I want or need.

What I was thinking was to use this call:

stm32_phyread(CONFIG_STM32F4_PHYADDR,MII_MSR,);

Then make the check:

if ((phyval & MII_MSR_LINKSTATUS) != 0) {

==> change the net driver flag that indicates if the network interface
is up or not;

}

Then in the application, I continue to check regularly the netlib_getifstatus().

Is there any way, or is it feasible, to have something like that? How
should I proceed?

Best regards,

Flavio



Em qua., 19 de mai. de 2021 às 18:55, Gregory Nutt
 escreveu:
>
>
> > Considering this scenario, is there any alternative approach that I
> > could use to have this detection? Polling the phy, or something
> > similar?
>
> As I recall, David Sidrane submitted a PR to do just this but it was not
> incoporated.  I don't recall why.   I recall having some concerns that
> polling the PHY in maintenance mode would interfere with normal
> operational mode, but I think David demonstrated that there was not an
> issue with that.
>
> I think these:
>
> https://github.com/apache/incubator-nuttx-apps/pull/402
>
> https://github.com/apache/incubator-nuttx-apps/pull/415
>
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Ethernet cable (network interface availability) detection

2021-05-19 Thread Flavio Castro Alves Filho
Hello,

Coming back to this issue.

Looking at STM32F4DISCOVERY code, I could see that the NETINIT_THREAD
is disabled because the IRQ pin from the PHY is not available.

It happens when the RMII configuration is set and the IRQ pin is also
used as REFCLK0.

This is also the situation with my hardware.

Considering this scenario, is there any alternative approach that I
could use to have this detection? Polling the phy, or something
similar?

Best regards,

Flavio

Em qua., 14 de abr. de 2021 às 11:45, Flavio Castro Alves Filho
 escreveu:
>
> Gregory,
>
> Thank you for your support. I will work on this.
>
> Best regards.
>
> Flavio
>
> Em qua., 14 de abr. de 2021 11:09, Gregory Nutt  
> escreveu:
>>
>> You board must provide CONFIG_ARCH_PHY_INTERRUPT:
>>
>> $ find boards/ -name Kconfig | xargs grep ARCH_PHY_INTERRUPT
>> boards/Kconfig: select ARCH_PHY_INTERRUPT
>> boards/Kconfig: select ARCH_PHY_INTERRUPT if SAMA5_EMACA ||
>> SAMA5_EMAC0 || SAMA5_EMAC1 || SAMA5_GMAC
>> boards/Kconfig: select ARCH_PHY_INTERRUPT
>> boards/Kconfig: select ARCH_PHY_INTERRUPT
>> boards/Kconfig: select ARCH_PHY_INTERRUPT
>> boards/Kconfig: select ARCH_PHY_INTERRUPT
>> boards/Kconfig: select ARCH_PHY_INTERRUPT
>>
>> and you must implement PHY interrupt handling as documented in
>> include/nuttx/arch.h:
>>
>> 
>> /
>>   * Name: arch_phy_irq
>>   *
>>   * Description:
>>   *   This function may be called to register an interrupt handler
>> that will
>>   *   be called when a PHY interrupt occurs.  This function both
>> attaches
>>   *   the interrupt handler and enables the interrupt if 'handler'
>> is non-
>>   *   NULL.  If handler is NULL, then the interrupt is detached and
>> disabled
>>   *   instead.
>>   *
>>   *   The PHY interrupt is always disabled upon return.  The caller must
>>   *   call back through the enable function point to control the
>> state of
>>   *   the interrupt.
>>   *
>>   *   This interrupt may or may not be available on a given platform
>> depending
>>   *   on how the network hardware architecture is implemented. In a
>> typical
>>   *   case, the PHY interrupt is provided to board-level logic as a GPIO
>>   *   interrupt (in which case this is a board-specific interface
>> and really
>>   *   should be called board_phy_irq()); In other cases, the PHY
>> interrupt
>>   *   may be cause by the chip's MAC logic (in which case
>> arch_phy_irq()) is
>>   *   an appropriate name.  Other other boards, there may be no PHY
>> interrupts
>>   *   available at all.  If client attachable PHY interrupts are
>> available
>>   *   from the board or from the chip, then
>> CONFIG_ARCH_PHY_INTERRUPT should
>>   *   be defined to indicate that fact.
>>   *
>>   *   Typical usage:
>>   *   a. OS service logic (not application logic*) attaches to the PHY
>>   *  PHY interrupt and enables the PHY interrupt.
>>   *   b. When the PHY interrupt occurs:  (1) the interrupt should be
>>   *  disabled and () work should be scheduled on the worker
>> thread (or
>>   *  perhaps a dedicated application thread).
>>   *   c. That worker thread should use the SIOCGMIIPHY, SIOCGMIIREG,
>>   *  and SIOCSMIIREG ioctl calls** to communicate with the PHY,
>>   *  determine what network event took place (Link Up/Down?), and
>>   *  take the appropriate actions.
>>   *   d. It should then interact the PHY to clear any pending
>>   *  interrupts, then re-enable the PHY interrupt.
>>   *
>>   ** This is an OS internal interface and should not be used from
>>   *  application space.  Rather applications should use the
>> SIOCMIISIG
>>   *  ioctl to receive a signal when a PHY event occurs.
>>   *   ** This interrupt is really of no use if the Ethernet MAC driver
>>   *  does not support these ioctl calls.
>>   *
>>   * Input Parameters:
>>   *   intf- Identifies the network interface.  For example
>> "eth0".  Only
>>   * useful on platforms that support multiple Ethernet
>> interfaces
>>   * and, hence, multiple PHYs and PHY interrupts.
>>   *   handler - The client i

Re: NuttX (Online) Workshop 2021 (call for event team members)

2021-05-18 Thread Flavio Castro Alves Filho
Hello,

I am also interested in being part of the event team.

Best regards,

Flavio

Em ter., 18 de mai. de 2021 às 12:10,  escreveu:
>
> That is one of the things to be decided during the meeting
>
> Regards
> Alin
>
> -Original Message-
> From: Abdelatif Guettouche 
> Sent: den 18 maj 2021 17:06
> To: dev@nuttx.apache.org
> Subject: Re: NuttX (Online) Workshop 2021 (call for event team members)
>
> Do we have any preliminary dates for the event?
>
> On Tue, May 18, 2021 at 3:02 PM David Sidrane  wrote:
> >
> > Please count me in.
> >
> > -Original Message-
> > From: alin.jerpe...@sony.com [mailto:alin.jerpe...@sony.com]
> > Sent: Tuesday, May 18, 2021 1:54 AM
> > To: dev@nuttx.apache.org
> > Subject: NuttX (Online) Workshop 2021 (call for event team members)
> >
> > Hi all,
> >
> > Yesterday me and Alan were talking about the plans for the NuttX 2021
> > workshop and we were thinking that we should see if there are other
> > people interested to be part of the event team.
> > If you are interested to be part of the event team please replay to
> > this mail and we will invite you to the online meeting.
> > Regards
> > Alin



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: NuttX support for b-l072z-lrwan1

2021-05-13 Thread Flavio Castro Alves Filho
Thank you Alan,

I will evaluate and report.

Best regards,

Flavio

Em qua., 12 de mai. de 2021 às 12:21, Alan Carvalho de Assis
 escreveu:
>
> That was the right path to: nuttx/drivers/wireless/lpwan/sx127x/
>
> Sorry my mistake!
>
> On 5/12/21, Alan Carvalho de Assis  wrote:
> > AFAIK there is support for LoRA, but not for LoRaWAN if it is what you
> > want.
> >
> > Please take a look:
> > https://www.healthexpress.co/br/warticon.html#qual_%C3%A9_o_ingrediente_ativo_do_warticon_(wartec),_e_como_ele_funciona?
> >
> > BR,
> >
> > Alan
> >
> > On 5/12/21, Miguel Wisintainer  wrote:
> >> Good question!
> >>
> >> Enviado do meu iPhone
> >>
> >>> Em 11 de mai. de 2021, à(s) 15:33, Flavio Castro Alves Filho
> >>>  escreveu:
> >>>
> >>> Hello,
> >>>
> >>> I am evaluating whether to use NuttX on a project based on the
> >>> b-l072z-lrwan1 board.
> >>>
> >>> Looking at the repository, I understood that most part of the features
> >>> regarding the microcontroller was implemented, but it was not clear
> >>> the support for LoRa and its stack.
> >>>
> >>> How can I get the current set of features implemented in NuttX for this
> >>> board?
> >>>
> >>> Best regards,
> >>>
> >>> Flavio
> >>>
> >>> --
> >>> Flavio de Castro Alves Filho
> >>>
> >>> flavio.al...@gmail.com
> >>> Twitter: http://twitter.com/#!/fraviofii
> >>> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >>
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


NuttX support for b-l072z-lrwan1

2021-05-11 Thread Flavio Castro Alves Filho
Hello,

I am evaluating whether to use NuttX on a project based on the
b-l072z-lrwan1 board.

Looking at the repository, I understood that most part of the features
regarding the microcontroller was implemented, but it was not clear
the support for LoRa and its stack.

How can I get the current set of features implemented in NuttX for this board?

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Dev environment

2021-05-11 Thread Flavio Castro Alves Filho
Hello Tim,

I use ubuntu 20.04 server to save space :-) ... If  you use
authorized_keys in ssh ... it is even better.

For me here, the USB in the VM is more stable than in my Windows host
:-\ ... for the J-Link and also for the FTDI to see syslog.

In VS-Code, I use these extensions:
* marus25.cortex-debug-dp-stm32f4
* marus25.cortex-debug

And here is my launch.json:

{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit:
https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"type": "cortex-debug",
"request": "launch",
"servertype": "jlink",
"cwd": "${workspaceRoot}",
"serverpath": "JLinkGDBServerCLExe",
"executable": "${workspaceRoot}/build/phigw.elf",
"name": "Debug PhiGW",
"device": "STM32F417VE",
"interface": "swd",
"runToMain": true,
"jlinkscript": "${workspaceRoot}/jlink/phigw.jlink",
"svdFile": "${workspaceRoot}/jlink/STM32F407.svd"
}
]
}

And here is my jlink script:

device STM32F417VE
si 1
speed 4000
loadbin build/phigw.bin, 0x08008000
r
g
q

Hope it helps.

Best regards,

Flavio

Em ter., 11 de mai. de 2021 às 14:36, Tim Hardisty
 escreveu:
>
> Thanks Flavio - I hadn't thought about using a VM; that would avoid yet 
> another lump of PC hardware cluttering up the place if I can't get the WSL or 
> MAC approach to work.
>
> I am really hating Window at the moment (1 machine can connect to my Mac, the 
> other can't...many hours wasted NOT fixing it!) and I had thought it time to 
> jump ship to Mac...but Linux seems even more appealing right now!!
>
> On 11/05/2021, 18:24, "Flavio Castro Alves Filho"  
> wrote:
>
> Hello Tim,
>
> What I do here to implement a NuttX application is to use an Ubuntu
> Server VM (in my case, VMWare).
>
> In this VM, I map my Jlink (which is a nucleo board with changed
> firmware). I use Segger tools to load the firmware.
>
> To code, I use VSCode in Windows with SSH access to the VM (I set a
> host-only network).
>
> For the toolchain, I use x-pack arm-gcc. The toolchain provided by
> ubuntu does not provide gdb.
>
> You can use the VSCode extension with GDB and JLink to run.
>
> Hope it helps.
>
> Best regards,
>
> Flavio
>
>
>
>
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Dev environment

2021-05-11 Thread Flavio Castro Alves Filho
It seems that it is possible to run JLink from Windows in WSL.

Em ter., 11 de mai. de 2021 às 14:23, Tim Hardisty
 escreveu:
>
> Thanks Alan. Compiling is no problem it is debugging that is my issue. I see 
> from your process that you copied the elf from the WSL environment to the 
> Windows /mnt/c ...I haven't tried that but I am not sure it will help eclipse 
> find the source code...unless I also replicate the source tree on the Windows 
> side perhaps. It is a few more things to try at least, so thank you.
> >Hi Tim,
>>
> >I don't use Windows or MacOS, but some time ago just tested NuttX on
> >WSL to help other to get started to NuttX on Windows, I documented the
> >process here:
>>
> 
> >https://acassis.wordpress.com/2018/01/10/how-to-build-nuttx-on-windows-10/
> >
> >I hope it helps you!
>
> >> I need to debug it. I will need to get to that point regardless.
> >>
>
>
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Dev environment

2021-05-11 Thread Flavio Castro Alves Filho
Hello Tim,

What I do here to implement a NuttX application is to use an Ubuntu
Server VM (in my case, VMWare).

In this VM, I map my Jlink (which is a nucleo board with changed
firmware). I use Segger tools to load the firmware.

To code, I use VSCode in Windows with SSH access to the VM (I set a
host-only network).

For the toolchain, I use x-pack arm-gcc. The toolchain provided by
ubuntu does not provide gdb.

You can use the VSCode extension with GDB and JLink to run.

Hope it helps.

Best regards,

Flavio

Em ter., 11 de mai. de 2021 às 13:50, Disruptive Solutions
 escreveu:
>
> Tim. Maybe I can try to help you concerning this matter. How can we
> connect? Do you have telegram?
>
> Op di 11 mei 2021 6:42 p.m. schreef Tim :
>
> > Pulling my hair out here!! So apologies for the lengthy brain dump and plea
> > for help!
> >
> >
> >
> > All this starts from the CAN init code crashing (SAMA5D27) when it makes
> > any
> > call to print debug messages. Printf itself is fine.
> >
> >
> >
> > I need to debug it. I will need to get to that point regardless.
> >
> >
> >
> > The only way I can actually get Nuttx to build is using WSL - compiles no
> > problem at all. I have a MAC - it won't compile without errors and there's
> > not enough info (for me) to see what the error is - some complaint about
> > ./builtin_list.c
> >
> >
> >
> > Mac is the machine I know least. I have no "full" Linux machine. No
> > experience of Cygwin and its ilk - just a minefield to me.
> >
> >
> >
> > I know Windows best, and have successfully used eclipse under Windows for
> > Arm development for many years (sometimes compiling within eclipse,
> > sometimes from a command prompt). But although I can download and run code
> > via my jlink, eclipse will not correctly index the source code so I cannot
> > debug or set breakpoints.
> >
> >
> >
> > So I went back to trying to get it to compile under the Mac but no joy so
> > not even got as far as seeing if eclipse - or any other debugger- will run
> > and do its job. Eclipse is pointing at the source code properly and even if
> > I stop the program and manually point the eclipse debugger to the source
> > code - where I have inserted a while(1); - it completely refuses to pick up
> > the source code. I am suspected a "\" vs "/" issue or something dumb. This
> > is true either for a project pointing to a clone in the WSL location or in
> > a
> > more native windows location
> >
> >
> >
> > I have not succeeded in getting Nuttx to build via eclipse (in Windows)
> > either - although my "Bare Metal"  SAMA5 code compiles just fine with the
> > eclipse GNU cross compilers and debugs nicely.
> >
> >
> >
> > I thought maybe I could run an X-windows emulator on my Win 10 machine and
> > run eclipse on WSL...but it doesn't get very far and just throws errors.
> >
> >
> >
> > Thought I'd try Visual GDB - no SAMA5D2 support it seems. Tried to run
> > OpenOCD (which purported to be "Windows ready") but it doesn't run.
> >
> >
> >
> > Has anyone got NuttX to successfully compile, and allow debug, under either
> > MAC or Windows. At all? Ever?
> >
> >
> >
> > If someone has any pointers I will be extremely grateful, as this is doing
> > my head in. I really don't want to waste yet more days finding a machine to
> > build up exclusively for Linux unless I REALLY have to!!!
> >
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Replacing SmartFS to LittleFS

2021-04-29 Thread Flavio Castro Alves Filho
Hello Xiang,

> >
> Yes, if you just want to create an empty littlefs partition, littlefs
> driver can do it without the userspace tool assistance.
> Either run the mount command from nsh:
> mount -t littlefs -o autoformat /dev/mtd /mnt
> Or call mount function from board_initialize like this:
> mount("/dev/mtd", "/mnt", "littlefs", 0, "autoformat");
>

I believe that is enough for me.

Thank you very much.

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Replacing SmartFS to LittleFS

2021-04-28 Thread Flavio Castro Alves Filho
Hello Xiang,

Thank you for your quick response.

How do I manage the format of a littlefs 'disk' from programming (not
nutshell) ?

I am looking for something similar to 'mksmatfs' function.

Or only the flash_eraseall function is enough? Or should I add the "-o
autoformat" option on the last parameter of the mount() function?

Best regards,

Flavio


Em qua., 28 de abr. de 2021 às 09:33, Xiang Xiao
 escreveu:
>
> LittleFS can talk directly with the standard MTD driver, so you just need:
>
>1. Call register_mtddriver in your board file
>2. Run mount from nsh like this:
>
>mount -t littlefs -o autoformat /dev/mtd /mnt
>
>
> On Wed, Apr 28, 2021 at 8:03 PM Flavio Castro Alves Filho <
> flavio.al...@gmail.com> wrote:
>
> > Hello,
> >
> > Today my application uses SmartFS associated with MX25L SPI Dataflash.
> >
> > I intend to replace the SmartFS to LittleFS.
> >
> > In the filesystem section of menuconfig, I can disable
> > CONFIG_FS_SMARTFS and enable CONFIG_FS_SMARTFS.
> >
> > But when I go to "Device Drivers" --> "Memory Technology Device (MTD)
> > Support", there is an option CONFIG_MTD_SMART.
> >
> > Is there any equivalent configuration for LittleFS?
> >
> > After enabling the LittleFS, is there anything that must be done at
> > the board code to enable it?
> >
> > Best Regards,
> >
> > Flavio
> >
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.al...@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Replacing SmartFS to LittleFS

2021-04-28 Thread Flavio Castro Alves Filho
Hello,

Today my application uses SmartFS associated with MX25L SPI Dataflash.

I intend to replace the SmartFS to LittleFS.

In the filesystem section of menuconfig, I can disable
CONFIG_FS_SMARTFS and enable CONFIG_FS_SMARTFS.

But when I go to "Device Drivers" --> "Memory Technology Device (MTD)
Support", there is an option CONFIG_MTD_SMART.

Is there any equivalent configuration for LittleFS?

After enabling the LittleFS, is there anything that must be done at
the board code to enable it?

Best Regards,

Flavio


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Running applications from dataflash

2021-04-25 Thread Flavio Castro Alves Filho
Hello,

I intend to implement a firmware update feature for my project, which
is based on stm32f4discovery.

My idea is to load a separated ELF file on the dataflash, which is
loaded using the approach described in the following video:
https://www.youtube.com/watch?v=oL6KAgkTb8M

When running this application, another content from this same
dataflash, the new firmware, will be used to erase the mcu flash and
write the new firmware.

While evaluating this approach and watching the video, I had 2 questions:

1. Can an ELF file be executed from dataflash too?
2. Is this execution totally independent from the MCU flash?

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Using NuttX with custom bootloader

2021-04-21 Thread Flavio Castro Alves Filho
It worked.

Just changing the linker script was enough.

Thank you very much.

Best regards,

Flavio

Em qua., 21 de abr. de 2021 às 16:00, Gregory Nutt
 escreveu:
>
>
> > But I don't know if there is anything to be done directly in NuttX source 
> > code.
>
> Nothing other than setting the VBAR register (called NVIC_VECTAB in
> NuttX).  This is already done so I guess the real answer is No.
>
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Error with stm32f4discovery:usbnsh

2021-04-21 Thread Flavio Castro Alves Filho
Hello,

To have usbnsh working I used, as a workaround, the implementation
done in this pull request:
https://github.com/apache/incubator-nuttx-apps/pull/521

In my application I don't use nsh. And USB-CDC works fine accessing
directly the device.

Hope it helps,

Best regards,

Flavio

Em ter., 20 de abr. de 2021 às 19:26, Alan Carvalho de Assis
 escreveu:
>
> Are you getting this error:
>
> "nsh> nsh: nsh_session: readline failed: 9"
>
> Could you please share your .config file?
>
> BR,
>
> Alan
>
> On 4/20/21, Max Kriegleder  wrote:
> > Strange.. I have sent two mails prior to this one and apparently they
> > did not make it to the list. Trying again:
> >
> > Were you able to fix this problem? I am running nuttx-10.0.1 on a
> > stm32f4discovery board and I have the same issue.
> >
> > Thanks!
> >
> >
> > On 2021/04/17 22:56:48, Alan Carvalho de Assis  wrote:
> >  > I just received it!>
> >  >
> >  > Try to submit a new email>
> >  >
> >  > On 4/17/21, Max Kriegleder  wrote:>
> >  > > Is anybody reading this? I am not sure why my messages get lost.. how>
> >  > > can I post to the message list?>
> >  > >>
> >  > > On 2020/12/13 22:19:01, Brennan Ashton 
> > wrote:>
> >  > > > Yeah 100% agree which is why I need to look when I have a little
> > more>>
> >  > > > time to understand what is going on.>>
> >  > > >>
> >  > > > On Sun, Dec 13, 2020 at 2:12 PM Gregory Nutt 
> > wrote:>>
> >  > > > >>>
> >  > > > > See>>
> >  > > > >>
> >  > >
> > https://mail-archives.apache.org/mod_mbox/nuttx-dev/202012.mbox/%3CCAKFLXYwes3pcDA2zXsL2FcwgCS4PecdmiP9srkGEtTaOoLEhMg%40mail.gmail.com%3E>>
> >
> >
> >  > >>
> >  > >>
> >  > > > >>>
> >  > > > > I don't think this is the correct solution since with Xiao
> > Xiang's>>
> >  > > > > recent changes, stdin should never be closed. But it does give
> > some>>
> >  > > > > clues about the nature of the problem: stdin is no valid;
> > stdout is>
> >  > > okay>>
> >  > > > >>>
> >  > > > > On 12/13/2020 4:07 PM, Brennan Ashton wrote:>>
> >  > > > > > This is impacting all the usbnsh configurations. I can take
> > another>>
> >  > > > > > look later this evening>>
> >  > > > > > https://github.com/apache/incubator-nuttx/pull/2526>>
> >  > > > > >>>
> >  > > > > > --Brennan>>
> >  > > > > >>>
> >  > > > > > On Fri, Dec 11, 2020 at 5:05 AM Gregory Nutt >
> >  > > wrote:>>
> >  > > > > >> Several other PRs specifically removed support for fclose>
> >  > > (stdin). Are>>
> >  > > > > >> you certain you want to restore it? I think this needs more>
> >  > > analysis>>
> >  > > > > >> and resolution with the previous changes that removed the>
> >  > > fclose() of>>
> >  > > > > >> stdin, stdout, and stderr.>>
> >  > > > > 
> >  > > > > >> On 12/10/2020 5:37 PM, Masayuki Ishikawa wrote:>>
> >  > > > > >>> Suzuki-san,>>
> >  > > > > >
> >  > > > > >>> Please send a PR (Pull Request) to>>
> >  > > > > >>> https://github.com/apache/incubator-nuttx-apps/>>
> >  > > > > >
> >  > > > > >>> On Thu, Dec 10, 2020 at 5:24 PM SUZUKI Keiji
> > >
> >  > > wrote:>>
> >  > > > > >
> >  > > > >  Hi,>>
> >  > > > > >>
> >  > > > >  I use STM32F407G-DISC1 (MB997D) and build nuttx on macOS>
> >  > > Mojave (10.14.6).>>
> >  > > > > >>
> >  > > > >  The following error occurs with the default configuration
> > of>>
> >  > > > >  stm32f4discovery:usbnsh.>>
> >  > > > > >>
> >  > > > >  NuttShell (NSH) NuttX-10.0.0>>
> >  > > > >  nsh> nsh: nsh_session: readline failed: 9>>
> >  > > > > >>
> >  > > > >  The reason seems that instream->fs_fd is -1 instead of 0 in>
> >  > > the readline()>>
> >  > > > >  function called by>>
> >  > > > >  nsh_session().>>
> >  > > > > >>
> >  > > > >  This error occurs in version 10.0-RC0 and after (I checked>
> >  > > 10.0-RC0, 10.0>>
> >  > > > >  and current master)>>
> >  > > > >  but does not occur in 9.1 and before (I checked 9.1, 8.2 and>
> >  > > 7.31).>>
> >  > > > > >>
> >  > > > >  The following patch fixed it in my environment but I don't>
> >  > > know this is a>>
> >  > > > >  correct fix.>>
> >  > > > > >>
> >  > > > >  === from here ===>>
> >  > > > > >>
> >  > > > >  diff --git a/nshlib/nsh_usbconsole.c
> > b/nshlib/nsh_usbconsole.c>>
> >  > > > >  index 28f63bcc..768a621b 100644>>
> >  > > > >  --- a/nshlib/nsh_usbconsole.c>>
> >  > > > >  +++ b/nshlib/nsh_usbconsole.c>>
> >  > > > >  @@ -77,8 +77,8 @@>>
> >  > > > > >>
> >  > > > >  static void nsh_configstdio(int fd, FAR struct
> > console_stdio_s>
> >  > > *pstate)>>
> >  > > > >  {>>
> >  > > > >  - /* Make sure the stdout, and stderr are flushed */>>
> >  > > > >  ->>
> >  > > > >  + /* Make sure the stdin is closed and the stdout, and
> > stderr>
> >  > > are flushed>>
> >  > > > >  */>>
> >  > > > >  + fclose(stdin);>>
> >  > > > >  fflush(stdout);>>
> >  > > > >  fflush(stderr);>>
> >  > > > > >>
> >  > > > >  @@ -88,6 +88,9 

Using NuttX with custom bootloader

2021-04-21 Thread Flavio Castro Alves Filho
Hello,

I intend to use a NuttX firmware with a custom bootloader on a
STM32F4DISCOVERY board.

The bootloader will be executed on the first available memory block in
flash, and the firmware will start from the second block - position
0x0802.

I believe I know what to do regarding linker script.

But I don't know if there is anything to be done directly in NuttX source code.

I ask this because in a standard STM32 firmware using STM32Cube, there
is a FLASH_BASE constant that must be set correctly for the firmware
to work correctly. My worry is if there is something similar in NuttX
for the board.

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Ethernet cable (network interface availability) detection

2021-04-14 Thread Flavio Castro Alves Filho
nable);
> #endif
>
>
> Lots of examples.  Note that it already exists for STM32F4 Discovery:
>
> $ find boards/ -name "*.c" | xargs grep arch_phy_irq
> boards/arm/imxrt/imxrt1020-evk/src/imxrt_ethernet.c: * Name:
> arch_phy_irq
> boards/arm/imxrt/imxrt1020-evk/src/imxrt_ethernet.c: *   may be
> cause by the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/imxrt/imxrt1020-evk/src/imxrt_ethernet.c:int
> arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
> boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c: * Name:
> arch_phy_irq
> boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c: *   may be
> cause by the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/imxrt/imxrt1050-evk/src/imxrt_ethernet.c:int
> arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
> boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c: * Name:
> arch_phy_irq
> boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c: *   may be
> cause by the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/imxrt/imxrt1060-evk/src/imxrt_ethernet.c:int
> arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
> boards/arm/imxrt/teensy-4.x/src/imxrt_ethernet.c: * Name: arch_phy_irq
> boards/arm/imxrt/teensy-4.x/src/imxrt_ethernet.c: *   may be cause
> by the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/imxrt/teensy-4.x/src/imxrt_ethernet.c:int
> arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
> boards/arm/sam34/sam4e-ek/src/sam_ethernet.c: * Name: arch_phy_irq
> boards/arm/sam34/sam4e-ek/src/sam_ethernet.c: *   may be cause by
> the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/sam34/sam4e-ek/src/sam_ethernet.c:int arch_phy_irq(FAR
> const char *intf, xcpt_t handler, void *arg,
> boards/arm/sama5/sama5d2-xult/src/sam_ethernet.c: * Name: arch_phy_irq
> boards/arm/sama5/sama5d2-xult/src/sam_ethernet.c: *   may be cause
> by the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/sama5/sama5d2-xult/src/sam_ethernet.c:int
> arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
> boards/arm/sama5/sama5d3-xplained/src/sam_ethernet.c: * Name:
> arch_phy_irq
> boards/arm/sama5/sama5d3-xplained/src/sam_ethernet.c: *   may be
> cause by the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/sama5/sama5d3-xplained/src/sam_ethernet.c:int
> arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
> boards/arm/sama5/sama5d3x-ek/src/sam_ethernet.c: * Name: arch_phy_irq
> boards/arm/sama5/sama5d3x-ek/src/sam_ethernet.c: *   may be cause by
> the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/sama5/sama5d3x-ek/src/sam_ethernet.c:int arch_phy_irq(FAR
> const char *intf, xcpt_t handler, void *arg,
> boards/arm/sama5/sama5d4-ek/src/sam_ethernet.c: * Name: arch_phy_irq
> boards/arm/sama5/sama5d4-ek/src/sam_ethernet.c: *   may be cause by
> the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/sama5/sama5d4-ek/src/sam_ethernet.c:int arch_phy_irq(FAR
> const char *intf, xcpt_t handler, void *arg,
> boards/arm/samv7/same70-xplained/src/sam_ethernet.c: * Name:
> arch_phy_irq
> boards/arm/samv7/same70-xplained/src/sam_ethernet.c: *   may be
> cause by the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/samv7/same70-xplained/src/sam_ethernet.c:int
> arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
> boards/arm/samv7/samv71-xult/src/sam_ethernet.c: * Name: arch_phy_irq
> boards/arm/samv7/samv71-xult/src/sam_ethernet.c: *   may be cause by
> the chip's MAC logic (in which case arch_phy_irq()) is
>     boards/arm/samv7/samv71-xult/src/sam_ethernet.c:int arch_phy_irq(FAR
> const char *intf, xcpt_t handler, void *arg,
> boards/arm/stm32/stm32f4discovery/src/stm32_ethernet.c: * Name:
> arch_phy_irq
> boards/arm/stm32/stm32f4discovery/src/stm32_ethernet.c: *   may be
> cause by the chip's MAC logic (in which case arch_phy_irq()) is
> boards/arm/stm32/stm32f4discovery/src/stm32_ethernet.c:int
> arch_phy_irq(FAR const char *intf, xcpt_t handler, void *arg,
>
>
> On 4/14/2021 7:59 AM, Flavio Castro Alves Filho wrote:
> > The netinit_monitor code is self-explanatory :-/
> >
> > I could understand what must be done ... and, naturally, it is in
> > accord with the documents.
> >
> > In my case, I cannot easily enable it from menuconfig ... as far as I
> > understood.
> >
> > Em qua., 14 de abr. de 2021 às 10:49, Gregory Nutt
> >  e

Re: Ethernet cable (network interface availability) detection

2021-04-14 Thread Flavio Castro Alves Filho
The netinit_monitor code is self-explanatory :-/

I could understand what must be done ... and, naturally, it is in
accord with the documents.

In my case, I cannot easily enable it from menuconfig ... as far as I
understood.

Em qua., 14 de abr. de 2021 às 10:49, Gregory Nutt
 escreveu:
>
> This is very out of date, but 90% accurate:
>
> https://cwiki.apache.org/confluence/display/NUTTX/Network+Link+Management
> https://cwiki.apache.org/confluence/display/NUTTX/NSH+Network+Link+Management
>
> This was not updated after the network initialization and network
> monitor were removed from NSH and made a separate feature.  It needs so
> clean-up.
>
> On 4/14/2021 7:40 AM, Alan Carvalho de Assis wrote:
> > I think this is kind of question that should be in some FAQ or in our
> > documentation, it is asked often...
> >
> > Is there some only place in our Documentation where we could include it?
> >
> > BR,
> >
> > Alan
> >
> > On 4/14/21, Gregory Nutt  wrote:
> >> Normally this is done using the PHY driver at
> >> nuttx/drivers/net/phy_notify.c that provides PHY-related events to
> >> applications via signals.  It requires board-level support to handle PHY
> >> interrupts.
> >>
> >> The network monitor thread at apps/netutils/netinit (see
> >> CONFIG_NETINIT_MONITOR) will handle taking the network down if the cable
> >> is unplugged and bringing it back up when the cable is restored.
> >>
> >> On 4/14/2021 7:24 AM, Flavio Castro Alves Filho wrote:
> >>> Hello,
> >>>
> >>> I am implementing an application using NuttX where I need to detect if
> >>> the network cable is plugged or not in my board.
> >>>
> >>> Today I implemented the function netlib_getifstatus(), which automates
> >>> the read of SIOCGIFFLAGS, similar to what we have in Linux.
> >>>
> >>> But, in my tests, it seems that it is not working correctly.
> >>>
> >>> What is the recommended approach to have this feature implemented?
> >>>
> >>> Best regards,
> >>>
> >>> Flavio
> >>>
> >>
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Ethernet cable (network interface availability) detection

2021-04-14 Thread Flavio Castro Alves Filho
Hello,

In my case, there is an additional challenge: the
CONFIG_NETINIT_MONITOR is not supported by STM32F4DISCOVERY.

What should I have to do to enable the feature for the board?

Best regards,

Flavio

Em qua., 14 de abr. de 2021 às 10:41, Alan Carvalho de Assis
 escreveu:
>
> I think this is kind of question that should be in some FAQ or in our
> documentation, it is asked often...
>
> Is there some only place in our Documentation where we could include it?
>
> BR,
>
> Alan
>
> On 4/14/21, Gregory Nutt  wrote:
> > Normally this is done using the PHY driver at
> > nuttx/drivers/net/phy_notify.c that provides PHY-related events to
> > applications via signals.  It requires board-level support to handle PHY
> > interrupts.
> >
> > The network monitor thread at apps/netutils/netinit (see
> > CONFIG_NETINIT_MONITOR) will handle taking the network down if the cable
> > is unplugged and bringing it back up when the cable is restored.
> >
> > On 4/14/2021 7:24 AM, Flavio Castro Alves Filho wrote:
> >> Hello,
> >>
> >> I am implementing an application using NuttX where I need to detect if
> >> the network cable is plugged or not in my board.
> >>
> >> Today I implemented the function netlib_getifstatus(), which automates
> >> the read of SIOCGIFFLAGS, similar to what we have in Linux.
> >>
> >> But, in my tests, it seems that it is not working correctly.
> >>
> >> What is the recommended approach to have this feature implemented?
> >>
> >> Best regards,
> >>
> >> Flavio
> >>
> >
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Ethernet cable (network interface availability) detection

2021-04-14 Thread Flavio Castro Alves Filho
Hello Gregory,

Got it! The flags are populated by the monitor thread.

I will enable here in my setup, test and report here.

Thank you very much.

Best regards,

Flavio

Em qua., 14 de abr. de 2021 às 10:31, Gregory Nutt
 escreveu:
>
> Examples:
>
> $ find boards/ -name defconfig | xargs grep CONFIG_NETINIT_MONITOR
> 
> boards/arm/samv7/same70-xplained/configs/netnsh/defconfig:CONFIG_NETINIT_MONITOR=y
> 
> boards/arm/samv7/samv71-xult/configs/netnsh/defconfig:CONFIG_NETINIT_MONITOR=y
> 
> boards/arm/tiva/dk-tm4c129x/configs/ipv6/defconfig:CONFIG_NETINIT_MONITOR=y
> boards/arm/tiva/dk-tm4c129x/configs/nsh/defconfig:CONFIG_NETINIT_MONITOR=y
> 
> boards/arm/tiva/tm4c1294-launchpad/configs/ipv6/defconfig:CONFIG_NETINIT_MONITOR=y
> 
> boards/arm/tiva/tm4c1294-launchpad/configs/nsh/defconfig:CONFIG_NETINIT_MONITOR=y
>
> On 4/14/2021 7:29 AM, Gregory Nutt wrote:
> > Normally this is done using the PHY driver at
> > nuttx/drivers/net/phy_notify.c that provides PHY-related events to
> > applications via signals.  It requires board-level support to handle
> > PHY interrupts.
> >
> > The network monitor thread at apps/netutils/netinit (see
> > CONFIG_NETINIT_MONITOR) will handle taking the network down if the
> > cable is unplugged and bringing it back up when the cable is restored.
> >
> > On 4/14/2021 7:24 AM, Flavio Castro Alves Filho wrote:
> >> Hello,
> >>
> >> I am implementing an application using NuttX where I need to detect if
> >> the network cable is plugged or not in my board.
> >>
> >> Today I implemented the function netlib_getifstatus(), which automates
> >> the read of SIOCGIFFLAGS, similar to what we have in Linux.
> >>
> >> But, in my tests, it seems that it is not working correctly.
> >>
> >> What is the recommended approach to have this feature implemented?
> >>
> >> Best regards,
> >>
> >> Flavio
> >>
> >
>


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Ethernet cable (network interface availability) detection

2021-04-14 Thread Flavio Castro Alves Filho
Hello,

I am implementing an application using NuttX where I need to detect if
the network cable is plugged or not in my board.

Today I implemented the function netlib_getifstatus(), which automates
the read of SIOCGIFFLAGS, similar to what we have in Linux.

But, in my tests, it seems that it is not working correctly.

What is the recommended approach to have this feature implemented?

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: mqtt library on NuttX?

2021-03-26 Thread Flavio Castro Alves Filho
Hello,

I did a simple sample code using CMake and NuttX as external library:

https://github.com/Phi-Innovations/nuttx-apps/tree/main/example-mqtt

Hope it helps.

I used MQTT-C for it, and I added the sources into my project (not into Nuttx).

It would be nice to have the library integrated into NuttX too.

Best regards,

Flavio

Em qui., 25 de mar. de 2021 às 19:11, Alan Carvalho de Assis
 escreveu:
>
> I think it is better to put it at apps/netutils/mqttc
>
> On 3/25/21, Abdelatif Guettouche  wrote:
> > Espressif has already signed an SGA, licensing shouldn't be an issue.
> > That said, I can submit it later if you guys want.
> > One question: where do we put the library?
> > A new "mqtt" folder?
> >
> > On Thu, Mar 25, 2021 at 10:59 PM Alan Carvalho de Assis
> >  wrote:
> >>
> >> On 3/25/21, Matias N.  wrote:
> >> >
> >> >
> >> > On Thu, Mar 25, 2021, at 15:21, Alan Carvalho de Assis wrote:
> >> >> Hi Matias,
> >> >>
> >> >> On 3/25/21, Matias N. mailto:matias%40imap.cc>>
> >> >> wrote:
> >> >> >
> >> >> >
> >> >> > On Thu, Mar 25, 2021, at 15:02, Abdelatif Guettouche wrote:
> >> >> >> Someone was asking the other day on Linkedin, so I pushed this:
> >> >> >> https://github.com/Ouss4/MQTTC_NuttX
> >> >> >
> >> >> > Great, thanks! I see the wrapper app is quite simple. Could we
> >> >> > submit
> >> >> > it
> >> >> > to nuttx apps repo?
> >> >> >
> >> >>
> >> >> Yes, please!
> >> >
> >> > The copyright header is from Espressif so I guess it would be best if
> >> > someone at Espressif can submit it
> >> > (not sure if it would require a SGA).
> >> >
> >>
> >> It is not a code from IDF, it was Abdelatif whom added it :-)
> >>
> >> But you are right, maybe it is better if we submit it because there is
> >> an Espressif copyright on it.
> >>
> >> BR,
> >>
> >> Alan
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Problem with SmartFS access

2021-03-22 Thread Flavio Castro Alves Filho
Hello Abdelatif,

At first, it didn't work.

But then I restarted the whole test and it is finally working.

Here is my output:

ABCDF
SmartFS initialized
INFO: mx25l MTD Flash driver initialized
up_rtc_getdatetime: Warning: PCF8563 RTC integrity is not guaranteed
(bit 7 in VL_SECONDS register is set)
.
NuttShell (NSH) NuttX-10.0.1
nsh>ls
/:
 dev/
 proc/
nsh>mount -t smartfs /dev/smart0 /mnt
nsh: mount: mount failed: 19
nsh>mksmartfs /dev/smart0
nsh>mount -t smartfs /dev/smart0 /mnt
nsh>cd /mnt
nsh>echo test > test.txt
nsh>ls
/mnt:
 test.txt
nsh>umount /mnt
nsh>ABCDF
SmartFS initialized
INFO: mx25l MTD Flash driver initialized
up_rtc_getdatetime: Warning: PCF8563 RTC integrity is not guaranteed
(bit 7 in VL_SECONDS register is set)
.
NuttShell (NSH) NuttX-10.0.1
nsh>mount -t smartfs /dev/smart0 /mnt
nsh>cd /mnt
nsh>ls
/mnt:
 test.txt
nsh>cat test.txt
test
nsh>

Thank you for your help.

Best regards,

Flavio

Em seg., 22 de mar. de 2021 às 09:55, Abdelatif Guettouche
 escreveu:
>
> Try: mount -t smartfs /dev/smart0 --> mount -t smartfs /dev/smart0 /mnt
>
> On Mon, Mar 22, 2021 at 1:17 PM Flavio Castro Alves Filho
>  wrote:
> >
> > Hello Alan,
> >
> > Enabling the CONFIG_BCH, I could finally run flash_eraseall and
> > mksmartfs commands.
> >
> > But the mount command is not working.
> >
> > Below there is my NuttX output:
> >
> > ABCDF
> > SmartFS initialized
> > INFO: mx25l MTD Flash driver initialized
> > up_rtc_getdatetime: Warning: PCF8563 RTC integrity is not guaranteed
> > (bit 7 in VL_SECONDS register is set)
> > .
> > NuttShell (NSH) NuttX-10.0.1
> > nsh>flash_eraseall /dev/smart0
> > nsh>mksmartfs /dev/smart0
> > nsh>mount -t smartfs /dev/smart0
> > nsh: mount: mount failed: 15
> > nsh>cat /proc/fs/usage
> >   FilesystemSize  Used  Available Mounted on
> >   procfs  0B0B 0B /proc
> > nsh>
> >
> > And here is my configuration file:
> >
> > CONFIG_ARCH="arm"
> > CONFIG_ARCH_BOARD="stm32f4discovery"
> > CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
> > CONFIG_ARCH_CHIP="stm32"
> > CONFIG_ARCH_CHIP_STM32=y
> > CONFIG_ARCH_CHIP_STM32F407VG=y
> > CONFIG_ARCH_STACKDUMP=y
> > CONFIG_BCH=y
> > CONFIG_BOARDCTL_USBDEVCTRL=y
> > CONFIG_BOARD_LATE_INITIALIZE=y
> > CONFIG_BOARD_LOOPSPERMSEC=16717
> > CONFIG_BUILTIN=y
> > CONFIG_C99_BOOL8=y
> > CONFIG_CDCACM=y
> > CONFIG_DEBUG_ERROR=y
> > CONFIG_DEBUG_FEATURES=y
> > CONFIG_DEBUG_HARDFAULT_ALERT=y
> > CONFIG_DEBUG_INFO=y
> > CONFIG_DEBUG_WARN=y
> > CONFIG_ETH0_PHY_LAN8742A=y
> > CONFIG_EXAMPLES_TCPECHO=y
> > CONFIG_FS_PROCFS=y
> > CONFIG_FS_PROCFS_REGISTER=y
> > CONFIG_FS_SMARTFS=y
> > CONFIG_HAVE_CXX=y
> > CONFIG_INTELHEX_BINARY=y
> > CONFIG_LIBCXX=y
> > CONFIG_LIBC_FLOATINGPOINT=y
> > CONFIG_LIBC_LOCALTIME=y
> > CONFIG_LIBM=y
> > CONFIG_MAX_TASKS=16
> > CONFIG_MM_REGIONS=2
> > CONFIG_MTD=y
> > CONFIG_MTD_MX25L=y
> > CONFIG_MTD_SMART=y
> > CONFIG_MTD_SMART_FSCK=y
> > CONFIG_NET=y
> > CONFIG_NETDB_DNSCLIENT=y
> > CONFIG_NETDEV_PHY_IOCTL=y
> > CONFIG_NETINIT_DHCPC=y
> > CONFIG_NETINIT_DNS=y
> > CONFIG_NETINIT_DNSIPADDR=0x08080808
> > CONFIG_NETINIT_NOMAC=y
> > CONFIG_NETINIT_THREAD=y
> > CONFIG_NETUTILS_DHCPC=y
> > CONFIG_NET_BROADCAST=y
> > CONFIG_NET_ICMP=y
> > CONFIG_NET_ICMP_SOCKET=y
> > CONFIG_NET_LOCAL=y
> > CONFIG_NET_PKT=y
> > CONFIG_NET_SOCKOPTS=y
> > CONFIG_NET_TCP=y
> > CONFIG_NET_TCPBACKLOG=y
> > CONFIG_NET_TCP_KEEPALIVE=y
> > CONFIG_NET_UDP=y
> > CONFIG_NFILE_DESCRIPTORS=8
> > CONFIG_NSH_BUILTIN_APPS=y
> > CONFIG_NSH_DISABLE_DATE=y
> > CONFIG_NSH_DISABLE_IFCONFIG=y
> > CONFIG_NSH_DISABLE_IFUPDOWN=y
> > CONFIG_NSH_DISABLE_LOSMART=y
> > CONFIG_NSH_DISABLE_PS=y
> > CONFIG_NSH_FILEIOSIZE=512
> > CONFIG_PREALLOC_TIMERS=4
> > CONFIG_PSEUDOFS_SOFTLINKS=y
> > CONFIG_RAM_SIZE=114688
> > CONFIG_RAM_START=0x2000
> > CONFIG_RAW_BINARY=y
> > CONFIG_RR_INTERVAL=200
> > CONFIG_RTC=y
> > CONFIG_RTC_EXTERNAL=y
> > CONFIG_RTC_PCF8563=y
> > CONFIG_SCHED_HPWORK=y
> > CONFIG_SCHED_ONEXIT=y
> > CONFIG_SCHED_ONEXIT_MAX=4
> > CONFIG_SCHED_WAITPID=y
> > CONFIG_SDCLONE_DISABLE=y
> > CONFIG_SERIAL_TERMIOS=y
> > CONFIG_STACK_CANARIES=y
> > CONFIG_START_DAY=2
> > CONFIG_START_MONTH=11
> > CONFIG_START_YEAR=2012
> > CONFIG_STM32F4DISBB=y
> > CONFIG_STM32_ETHMAC=y
&g

Re: Using C++ STL in Nuttx

2021-03-22 Thread Flavio Castro Alves Filho
Hello Xiang,

I found it out and created the pull request :-)

Em dom., 21 de mar. de 2021 às 12:11, Flavio Castro Alves Filho
 escreveu:
>
> Hello Xiang,
>
> I create the documentation in my fork:
> https://github.com/Phi-Innovations/incubator-nuttx/blob/master/Documentation/guides/cpp_cmake.rst
>
> I don't know now to to submit for the main project for revision.
>
> Best regards,
>
> Flavio
>
> Em sex., 19 de mar. de 2021 às 08:38, Flavio Castro Alves Filho
>  escreveu:
> >
> > Hello Xiang,
> >
> > Sorry for the late reply.
> >
> > Absolutely. I will do that.
> >
> > Best regards,
> >
> > Flavio
> >
> > Em qua., 17 de mar. de 2021 às 10:57, Xiang Xiao
> >  escreveu:
> > >
> > > Good news. It will be great if you can document your experience in the
> > > Documentation folder when you find some free time.
> > >
> > > On Wed, Mar 17, 2021 at 9:54 PM Flavio Castro Alves Filho <
> > > flavio.al...@gmail.com> wrote:
> > >
> > > > Hello Xiang,
> > > >
> > > > I could finally build an C++ project using CMake and exported NuttX.
> > > >   - Before that, I made a test creating the same project inside the
> > > > NuttX apps structure, and it worked fine.
> > > >
> > > > My sample project is here:
> > > > https://github.com/Phi-Innovations/nuttx-apps/tree/main/hellocpp
> > > >
> > > > I compiled JsonCpp (https://github.com/nlohmann/json) together and it
> > > > worked fine.
> > > >
> > > > Thank you for all your support.
> > > >
> > > > Best regards,
> > > >
> > > > Flavio
> > > >
> > > >
> > > > Em ter., 16 de mar. de 2021 às 21:04, Flavio Castro Alves Filho
> > > >  escreveu:
> > > > >
> > > > > Xiang,
> > > > >
> > > > > I believe the problem was related to something on my branch.
> > > > >
> > > > > I was using a quite old version, based on release 10 branch.
> > > > >
> > > > > Now using master as branch, the testlibcxx compiled correctly.
> > > > > Tomorrow I will try my experiments and report here.
> > > > >
> > > > > Best regards,
> > > > >
> > > > > Flavio
> > > > >
> > > > > Em ter., 16 de mar. de 2021 às 16:24, Xiang Xiao
> > > > >  escreveu:
> > > > > >
> > > > > > Try to remove CONFIG_ARCH_FLOAT_H
> > > > > >
> > > > > > On Tue, Mar 16, 2021 at 12:15 PM Flavio Castro Alves Filho <
> > > > > > flavio.al...@gmail.com> wrote:
> > > > > >
> > > > > > > Hello Xiang,
> > > > > > >
> > > > > > > It is still not working. The error persists.
> > > > > > >
> > > > > > > Here is my defconfig file:
> > > > > > >
> > > > > > > #
> > > > > > > # This file is autogenerated: PLEASE DO NOT EDIT IT.
> > > > > > > #
> > > > > > > # You can use "make menuconfig" to make any modifications to the
> > > > > > > installed .config file.
> > > > > > > # You can then do "make savedefconfig" to generate a new defconfig
> > > > > > > file that includes your
> > > > > > > # modifications.
> > > > > > > #
> > > > > > > # CONFIG_ARCH_FPU is not set
> > > > > > > CONFIG_ARCH="arm"
> > > > > > > CONFIG_ARCH_BOARD="stm32f4discovery"
> > > > > > > CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
> > > > > > > CONFIG_ARCH_CHIP="stm32"
> > > > > > > CONFIG_ARCH_CHIP_STM32=y
> > > > > > > CONFIG_ARCH_CHIP_STM32F407VG=y
> > > > > > > CONFIG_ARCH_FLOAT_H=y
> > > > > > > CONFIG_ARCH_STACKDUMP=y
> > > > > > > CONFIG_BOARD_LOOPSPERMSEC=16717
> > > > > > > CONFIG_BUILTIN=y
> > > > > > > CONFIG_C99_BOOL8=y
> > > > > > > CONFIG_DISABLE_MOUNTPOINT=y
> > > > > > > CONFIG_EXAMPLES_HELLOXX=y
> > > > > > > CONFIG_HAVE_CXX=y
> > > > > > > CONFIG_INTELHEX_BINARY=y
> &

Re: Problem with SmartFS access

2021-03-22 Thread Flavio Castro Alves Filho
Hello Alan,

Enabling the CONFIG_BCH, I could finally run flash_eraseall and
mksmartfs commands.

But the mount command is not working.

Below there is my NuttX output:

ABCDF
SmartFS initialized
INFO: mx25l MTD Flash driver initialized
up_rtc_getdatetime: Warning: PCF8563 RTC integrity is not guaranteed
(bit 7 in VL_SECONDS register is set)
.
NuttShell (NSH) NuttX-10.0.1
nsh>flash_eraseall /dev/smart0
nsh>mksmartfs /dev/smart0
nsh>mount -t smartfs /dev/smart0
nsh: mount: mount failed: 15
nsh>cat /proc/fs/usage
  FilesystemSize  Used  Available Mounted on
  procfs  0B0B 0B /proc
nsh>

And here is my configuration file:

CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="stm32f4discovery"
CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
CONFIG_ARCH_CHIP="stm32"
CONFIG_ARCH_CHIP_STM32=y
CONFIG_ARCH_CHIP_STM32F407VG=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BCH=y
CONFIG_BOARDCTL_USBDEVCTRL=y
CONFIG_BOARD_LATE_INITIALIZE=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_C99_BOOL8=y
CONFIG_CDCACM=y
CONFIG_DEBUG_ERROR=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_HARDFAULT_ALERT=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_WARN=y
CONFIG_ETH0_PHY_LAN8742A=y
CONFIG_EXAMPLES_TCPECHO=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_SMARTFS=y
CONFIG_HAVE_CXX=y
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBCXX=y
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LOCALTIME=y
CONFIG_LIBM=y
CONFIG_MAX_TASKS=16
CONFIG_MM_REGIONS=2
CONFIG_MTD=y
CONFIG_MTD_MX25L=y
CONFIG_MTD_SMART=y
CONFIG_MTD_SMART_FSCK=y
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDEV_PHY_IOCTL=y
CONFIG_NETINIT_DHCPC=y
CONFIG_NETINIT_DNS=y
CONFIG_NETINIT_DNSIPADDR=0x08080808
CONFIG_NETINIT_NOMAC=y
CONFIG_NETINIT_THREAD=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_LOCAL=y
CONFIG_NET_PKT=y
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_TCP=y
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_TCP_KEEPALIVE=y
CONFIG_NET_UDP=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_DISABLE_DATE=y
CONFIG_NSH_DISABLE_IFCONFIG=y
CONFIG_NSH_DISABLE_IFUPDOWN=y
CONFIG_NSH_DISABLE_LOSMART=y
CONFIG_NSH_DISABLE_PS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_PREALLOC_TIMERS=4
CONFIG_PSEUDOFS_SOFTLINKS=y
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x2000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_EXTERNAL=y
CONFIG_RTC_PCF8563=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_ONEXIT_MAX=4
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SERIAL_TERMIOS=y
CONFIG_STACK_CANARIES=y
CONFIG_START_DAY=2
CONFIG_START_MONTH=11
CONFIG_START_YEAR=2012
CONFIG_STM32F4DISBB=y
CONFIG_STM32_ETHMAC=y
CONFIG_STM32_I2C1=y
CONFIG_STM32_JTAG_SW_ENABLE=y
CONFIG_STM32_OTGFS=y
CONFIG_STM32_PHYADDR=0
CONFIG_STM32_PHYSR=31
CONFIG_STM32_PHYSR_100FD=0x0018
CONFIG_STM32_PHYSR_100HD=0x0008
CONFIG_STM32_PHYSR_10FD=0x0014
CONFIG_STM32_PHYSR_10HD=0x0004
CONFIG_STM32_PHYSR_ALTCONFIG=y
CONFIG_STM32_PHYSR_ALTMODE=0x001c
CONFIG_STM32_RMII_EXTCLK=y
CONFIG_STM32_SPI1=y
CONFIG_STM32_USART1=y
CONFIG_STM32_USART2=y
CONFIG_STM32_USART3=y
CONFIG_SYMTAB_ORDEREDBYNAME=y
CONFIG_SYSLOG_CONSOLE=y
CONFIG_SYSTEM_FLASH_ERASEALL=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_USART1_SERIAL_CONSOLE=y
CONFIG_USART2_RXBUFSIZE=128
CONFIG_USART2_TXBUFSIZE=128
CONFIG_USART3_2STOP=1
CONFIG_USART3_BAUD=9600
CONFIG_USART3_RS485=y
CONFIG_USBDEV=y
CONFIG_USER_ENTRYPOINT="nsh_main"

Am I still missing anything?

What I realized is that the /mnt directory is not showing when I list
the directories on the root. Is it normal?

Best regards,

Flavio

Em dom., 21 de mar. de 2021 às 12:22, Alan Carvalho de Assis
 escreveu:
>
> Hi Flavio,
>
> You need to enable also the CONFIG_BCH, some recent modification in
> the BCH created this side-effect.
>
> BR,
>
> Alan
>
> On 3/21/21, Flavio Castro Alves Filho  wrote:
> > Hello,
> >
> > I am trying to use my stm32f4discovery board with MX25L800 dataflash
> > memory, through SPI and SmartFS file system.
> >
> > I installed a NuttX driver for this memory type and I am having
> > problems making this memory work. I cannot format the memory.
> >
> > Here is the output on the console, with FS Debug enabled and the commands
> > used:
> >
> > ABCDF
> > smart_scan: Entry
> > smart_scan: Scan sector 0
> > ...
> > smart_scan: Scan sector 511
> > smart_fsck: Entry
> > smart_fsck_directory: ERROR: Invalid phys sector 65535
> > smart_readsector: Entry
> > smart_readsector: ERROR: Logical sector 0 not allocated
> > smart_scan: SMART Scan
> > smart_scan:Erase size: 4096
> > smart_scan:Erase count: 256
> > smart_scan:Sect/block:2
> > smart_scan:MTD Blk/Sect:  8
> > SmartFS initialized
> > INFO: mx25l MTD Flash driver initialized
> > up_rtc_getdatetime: Warning: PCF

Problem with SmartFS access

2021-03-21 Thread Flavio Castro Alves Filho
Hello,

I am trying to use my stm32f4discovery board with MX25L800 dataflash
memory, through SPI and SmartFS file system.

I installed a NuttX driver for this memory type and I am having
problems making this memory work. I cannot format the memory.

Here is the output on the console, with FS Debug enabled and the commands used:

ABCDF
smart_scan: Entry
smart_scan: Scan sector 0
...
smart_scan: Scan sector 511
smart_fsck: Entry
smart_fsck_directory: ERROR: Invalid phys sector 65535
smart_readsector: Entry
smart_readsector: ERROR: Logical sector 0 not allocated
smart_scan: SMART Scan
smart_scan:Erase size: 4096
smart_scan:Erase count: 256
smart_scan:Sect/block:2
smart_scan:MTD Blk/Sect:  8
SmartFS initialized
INFO: mx25l MTD Flash driver initialized
up_rtc_getdatetime: Warning: PCF8563 RTC integrity is not guaranteed
(bit 7 in VL_SECONDS register is set)
.
NuttShell (NSH) NuttX-10.0.1
nsh>mksmartfs /dev/smart0
nsh: mksmartfs: mksmartfs failed: 2
nsh>flash_eraseall /dev/smart0
flash_eraseall: ERROR: Failed to open '/dev/smart0': 6
nsh>

Can anybody give me any advice on where to start searching for the solution?

Here is my configuration file:

CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="stm32f4discovery"
CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
CONFIG_ARCH_CHIP="stm32"
CONFIG_ARCH_CHIP_STM32=y
CONFIG_ARCH_CHIP_STM32F407VG=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BOARDCTL_USBDEVCTRL=y
CONFIG_BOARD_LATE_INITIALIZE=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_C99_BOOL8=y
CONFIG_CDCACM=y
CONFIG_DEBUG_ERROR=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ERROR=y
CONFIG_DEBUG_FS_INFO=y
CONFIG_DEBUG_FS_WARN=y
CONFIG_DEBUG_HARDFAULT_ALERT=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_WARN=y
CONFIG_ETH0_PHY_LAN8742A=y
CONFIG_EXAMPLES_TCPECHO=y
CONFIG_FS_PROCFS=y
CONFIG_FS_PROCFS_REGISTER=y
CONFIG_FS_SMARTFS=y
CONFIG_HAVE_CXX=y
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBCXX=y
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LOCALTIME=y
CONFIG_LIBM=y
CONFIG_MAX_TASKS=16
CONFIG_MM_REGIONS=2
CONFIG_MTD=y
CONFIG_MTD_MX25L=y
CONFIG_MTD_SMART=y
CONFIG_MTD_SMART_FSCK=y
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETDEV_PHY_IOCTL=y
CONFIG_NETINIT_DHCPC=y
CONFIG_NETINIT_DNS=y
CONFIG_NETINIT_DNSIPADDR=0x08080808
CONFIG_NETINIT_NOMAC=y
CONFIG_NETINIT_THREAD=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_LOCAL=y
CONFIG_NET_PKT=y
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_TCP=y
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_TCP_KEEPALIVE=y
CONFIG_NET_UDP=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_DISABLE_DATE=y
CONFIG_NSH_DISABLE_IFCONFIG=y
CONFIG_NSH_DISABLE_IFUPDOWN=y
CONFIG_NSH_DISABLE_LOSMART=y
CONFIG_NSH_DISABLE_PS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_PREALLOC_TIMERS=4
CONFIG_PSEUDOFS_SOFTLINKS=y
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x2000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_EXTERNAL=y
CONFIG_RTC_PCF8563=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_ONEXIT_MAX=4
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_SERIAL_TERMIOS=y
CONFIG_STACK_CANARIES=y
CONFIG_START_DAY=2
CONFIG_START_MONTH=11
CONFIG_START_YEAR=2012
CONFIG_STM32F4DISBB=y
CONFIG_STM32_ETHMAC=y
CONFIG_STM32_I2C1=y
CONFIG_STM32_JTAG_SW_ENABLE=y
CONFIG_STM32_OTGFS=y
CONFIG_STM32_PHYADDR=0
CONFIG_STM32_PHYSR=31
CONFIG_STM32_PHYSR_100FD=0x0018
CONFIG_STM32_PHYSR_100HD=0x0008
CONFIG_STM32_PHYSR_10FD=0x0014
CONFIG_STM32_PHYSR_10HD=0x0004
CONFIG_STM32_PHYSR_ALTCONFIG=y
CONFIG_STM32_PHYSR_ALTMODE=0x001c
CONFIG_STM32_RMII_EXTCLK=y
CONFIG_STM32_SPI1=y
CONFIG_STM32_USART1=y
CONFIG_STM32_USART2=y
CONFIG_STM32_USART3=y
CONFIG_SYMTAB_ORDEREDBYNAME=y
CONFIG_SYSLOG_CONSOLE=y
CONFIG_SYSTEM_FLASH_ERASEALL=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_USART1_SERIAL_CONSOLE=y
CONFIG_USART2_RXBUFSIZE=128
CONFIG_USART2_TXBUFSIZE=128
CONFIG_USART3_2STOP=1
CONFIG_USART3_BAUD=9600
CONFIG_USART3_RS485=y
CONFIG_USBDEV=y
CONFIG_USER_ENTRYPOINT="nsh_main"

Best regards,

Flavio


-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Using C++ STL in Nuttx

2021-03-21 Thread Flavio Castro Alves Filho
Hello Xiang,

I create the documentation in my fork:
https://github.com/Phi-Innovations/incubator-nuttx/blob/master/Documentation/guides/cpp_cmake.rst

I don't know now to to submit for the main project for revision.

Best regards,

Flavio

Em sex., 19 de mar. de 2021 às 08:38, Flavio Castro Alves Filho
 escreveu:
>
> Hello Xiang,
>
> Sorry for the late reply.
>
> Absolutely. I will do that.
>
> Best regards,
>
> Flavio
>
> Em qua., 17 de mar. de 2021 às 10:57, Xiang Xiao
>  escreveu:
> >
> > Good news. It will be great if you can document your experience in the
> > Documentation folder when you find some free time.
> >
> > On Wed, Mar 17, 2021 at 9:54 PM Flavio Castro Alves Filho <
> > flavio.al...@gmail.com> wrote:
> >
> > > Hello Xiang,
> > >
> > > I could finally build an C++ project using CMake and exported NuttX.
> > >   - Before that, I made a test creating the same project inside the
> > > NuttX apps structure, and it worked fine.
> > >
> > > My sample project is here:
> > > https://github.com/Phi-Innovations/nuttx-apps/tree/main/hellocpp
> > >
> > > I compiled JsonCpp (https://github.com/nlohmann/json) together and it
> > > worked fine.
> > >
> > > Thank you for all your support.
> > >
> > > Best regards,
> > >
> > > Flavio
> > >
> > >
> > > Em ter., 16 de mar. de 2021 às 21:04, Flavio Castro Alves Filho
> > >  escreveu:
> > > >
> > > > Xiang,
> > > >
> > > > I believe the problem was related to something on my branch.
> > > >
> > > > I was using a quite old version, based on release 10 branch.
> > > >
> > > > Now using master as branch, the testlibcxx compiled correctly.
> > > > Tomorrow I will try my experiments and report here.
> > > >
> > > > Best regards,
> > > >
> > > > Flavio
> > > >
> > > > Em ter., 16 de mar. de 2021 às 16:24, Xiang Xiao
> > > >  escreveu:
> > > > >
> > > > > Try to remove CONFIG_ARCH_FLOAT_H
> > > > >
> > > > > On Tue, Mar 16, 2021 at 12:15 PM Flavio Castro Alves Filho <
> > > > > flavio.al...@gmail.com> wrote:
> > > > >
> > > > > > Hello Xiang,
> > > > > >
> > > > > > It is still not working. The error persists.
> > > > > >
> > > > > > Here is my defconfig file:
> > > > > >
> > > > > > #
> > > > > > # This file is autogenerated: PLEASE DO NOT EDIT IT.
> > > > > > #
> > > > > > # You can use "make menuconfig" to make any modifications to the
> > > > > > installed .config file.
> > > > > > # You can then do "make savedefconfig" to generate a new defconfig
> > > > > > file that includes your
> > > > > > # modifications.
> > > > > > #
> > > > > > # CONFIG_ARCH_FPU is not set
> > > > > > CONFIG_ARCH="arm"
> > > > > > CONFIG_ARCH_BOARD="stm32f4discovery"
> > > > > > CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
> > > > > > CONFIG_ARCH_CHIP="stm32"
> > > > > > CONFIG_ARCH_CHIP_STM32=y
> > > > > > CONFIG_ARCH_CHIP_STM32F407VG=y
> > > > > > CONFIG_ARCH_FLOAT_H=y
> > > > > > CONFIG_ARCH_STACKDUMP=y
> > > > > > CONFIG_BOARD_LOOPSPERMSEC=16717
> > > > > > CONFIG_BUILTIN=y
> > > > > > CONFIG_C99_BOOL8=y
> > > > > > CONFIG_DISABLE_MOUNTPOINT=y
> > > > > > CONFIG_EXAMPLES_HELLOXX=y
> > > > > > CONFIG_HAVE_CXX=y
> > > > > > CONFIG_INTELHEX_BINARY=y
> > > > > > CONFIG_LIBCXX=y
> > > > > > CONFIG_LIBC_FLOATINGPOINT=y
> > > > > > CONFIG_LIBC_LOCALTIME=y
> > > > > > CONFIG_MAX_TASKS=16
> > > > > > CONFIG_MM_REGIONS=2
> > > > > > CONFIG_NFILE_DESCRIPTORS=8
> > > > > > CONFIG_NSH_BUILTIN_APPS=y
> > > > > > CONFIG_NSH_FILEIOSIZE=512
> > > > > > CONFIG_PREALLOC_TIMERS=4
> > > > > > CONFIG_RAM_SIZE=114688
> > > > > > CONFIG_RAM_START=0x2000
> > > > > > CONFIG_RAW_BINARY=y
> > > > > > CONFIG_RR_INTERVAL=200
> &

Re: Problem using USART Console and USB-CDC together on STM32F4 Discovery

2021-03-21 Thread Flavio Castro Alves Filho
Hello Alan,

In addition to the ID pin, there is another pin, VBUS, which is optional.

In the case of the VBUS pin, it is set on the board.

Similar procedures must be done.

Best regards,

Flavio

Em dom., 21 de mar. de 2021 às 09:35, Alan Carvalho de Assis
 escreveu:
>
> Hi Flávio,
>
> I agree, this pin is optional and only will be active when OTG is really used.
>
> Maybe a solution should be verifying if the USB Host support is
> enabled, since the pin is not required when using as USB Device:
>
> #ifdef CONFIG_USBHOST
>   stm32_configgpio(GPIO_OTGFS_ID);/* Only needed for OTG */
> #endif
>
> I think this the right solution, but let hear from others to know if
> there is a better solution.
>
> BR,
>
> Alan
>
> On 3/21/21, Flavio Castro Alves Filho  wrote:
> > Hello Allan,
> >
> > I found the solution.
> >
> > The PA10 pin has been initialized as a GPIO in USB OTG driver. More
> > specifically, in file stm32_otgfsdev.c file, line 5602.
> >
> > I commented this line and everything worked.
> >
> > This is a solution for me, but it is a problem for the project,
> > because it is better that this pin be flexible. The ID pin is not
> > mandatory when we intend to implement USB device software.
> >
> > I will think of an option in menuconfig and I will propose to you.
> >
> > Best regards,
> >
> > Flavio
> >
> >
> >
> > Em sáb., 20 de mar. de 2021 às 14:59, Flavio Castro Alves Filho
> >  escreveu:
> >>
> >> Hello Allan,
> >>
> >> I believe that rx pin from usart1 (PA10) is not yet operational.
> >>
> >> I could not find in code why.
> >>
> >> Best regards,
> >>
> >> Flavio
> >>
> >>
> >>
> >> Em sáb, 20 de mar de 2021 14:18, Alan Carvalho de Assis
> >>  escreveu:
> >>>
> >>> On 3/20/21, Flavio Castro Alves Filho  wrote:
> >>> > Updating:
> >>> >
> >>> > * with the great help from Allan, I could verify that that using usart2
> >>> > it
> >>> > works fine
> >>> >   - stm32f4discovery uses usart2 as console
> >>> >   - my board, similar to stm32f4discovery, uses usart1 as console
> >>> >
> >>> > * there is a conflict between the usart1 pins and usb device for
> >>> > stm32f4discovery configuration in nuttx
> >>> >   - according to the kit, the same pins (pa9 and pa10) are used for
> >>> > USB
> >>> > host device detection
> >>> >
> >>> > What I have done:
> >>> >
> >>> > * replaced the vbus pin (pa9) to another not used pin
> >>> > * searched for references about pa10 on the source code, and I
> >>> > couldn't
> >>> > find anything
> >>> >
> >>> > For now, I can see the nuttshell prompt on the serial, but it is not
> >>> > accepting inputs from the keyboard.
> >>> >
> >>> > And USB device is not working. PC is not detecting the device.
> >>> >
> >>>
> >>> Of course, you need to run in the NuttX terminal:
> >>>
> >>> nsh> sercon
> >>> DCD register : 
> >>> sercon: Registering CDC/ACM serial driver
> >>> sercon: Successfully registered the CDC/ACM serial driver
> >>> stm32_usbsuspend: resume: 0
> >>>
> >>> nsh> ls /dev
> >>> /dev:
> >>> console
> >>> null
> >>> ttyACM0
> >>> ttyS0
> >>> nsh>
> >>>
> >>> After doing it the USB CDC/ACM will be detected.
> >>>
> >>> BR,
> >>>
> >>> Alan
> >
> >
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.al...@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Problem using USART Console and USB-CDC together on STM32F4 Discovery

2021-03-21 Thread Flavio Castro Alves Filho
Hello Allan,

I found the solution.

The PA10 pin has been initialized as a GPIO in USB OTG driver. More
specifically, in file stm32_otgfsdev.c file, line 5602.

I commented this line and everything worked.

This is a solution for me, but it is a problem for the project,
because it is better that this pin be flexible. The ID pin is not
mandatory when we intend to implement USB device software.

I will think of an option in menuconfig and I will propose to you.

Best regards,

Flavio



Em sáb., 20 de mar. de 2021 às 14:59, Flavio Castro Alves Filho
 escreveu:
>
> Hello Allan,
>
> I believe that rx pin from usart1 (PA10) is not yet operational.
>
> I could not find in code why.
>
> Best regards,
>
> Flavio
>
>
>
> Em sáb, 20 de mar de 2021 14:18, Alan Carvalho de Assis  
> escreveu:
>>
>> On 3/20/21, Flavio Castro Alves Filho  wrote:
>> > Updating:
>> >
>> > * with the great help from Allan, I could verify that that using usart2 it
>> > works fine
>> >   - stm32f4discovery uses usart2 as console
>> >   - my board, similar to stm32f4discovery, uses usart1 as console
>> >
>> > * there is a conflict between the usart1 pins and usb device for
>> > stm32f4discovery configuration in nuttx
>> >   - according to the kit, the same pins (pa9 and pa10) are used for USB
>> > host device detection
>> >
>> > What I have done:
>> >
>> > * replaced the vbus pin (pa9) to another not used pin
>> > * searched for references about pa10 on the source code, and I couldn't
>> > find anything
>> >
>> > For now, I can see the nuttshell prompt on the serial, but it is not
>> > accepting inputs from the keyboard.
>> >
>> > And USB device is not working. PC is not detecting the device.
>> >
>>
>> Of course, you need to run in the NuttX terminal:
>>
>> nsh> sercon
>> DCD register : 
>> sercon: Registering CDC/ACM serial driver
>> sercon: Successfully registered the CDC/ACM serial driver
>> stm32_usbsuspend: resume: 0
>>
>> nsh> ls /dev
>> /dev:
>> console
>> null
>> ttyACM0
>> ttyS0
>> nsh>
>>
>> After doing it the USB CDC/ACM will be detected.
>>
>> BR,
>>
>> Alan



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Problem using USART Console and USB-CDC together on STM32F4 Discovery

2021-03-20 Thread Flavio Castro Alves Filho
Hello Allan,

I believe that rx pin from usart1 (PA10) is not yet operational.

I could not find in code why.

Best regards,

Flavio



Em sáb, 20 de mar de 2021 14:18, Alan Carvalho de Assis 
escreveu:

> On 3/20/21, Flavio Castro Alves Filho  wrote:
> > Updating:
> >
> > * with the great help from Allan, I could verify that that using usart2
> it
> > works fine
> >   - stm32f4discovery uses usart2 as console
> >   - my board, similar to stm32f4discovery, uses usart1 as console
> >
> > * there is a conflict between the usart1 pins and usb device for
> > stm32f4discovery configuration in nuttx
> >   - according to the kit, the same pins (pa9 and pa10) are used for USB
> > host device detection
> >
> > What I have done:
> >
> > * replaced the vbus pin (pa9) to another not used pin
> > * searched for references about pa10 on the source code, and I couldn't
> > find anything
> >
> > For now, I can see the nuttshell prompt on the serial, but it is not
> > accepting inputs from the keyboard.
> >
> > And USB device is not working. PC is not detecting the device.
> >
>
> Of course, you need to run in the NuttX terminal:
>
> nsh> sercon
> DCD register : 
> sercon: Registering CDC/ACM serial driver
> sercon: Successfully registered the CDC/ACM serial driver
> stm32_usbsuspend: resume: 0
>
> nsh> ls /dev
> /dev:
> console
> null
> ttyACM0
> ttyS0
> nsh>
>
> After doing it the USB CDC/ACM will be detected.
>
> BR,
>
> Alan
>


Re: Problem using USART Console and USB-CDC together on STM32F4 Discovery

2021-03-20 Thread Flavio Castro Alves Filho
Updating:

* with the great help from Allan, I could verify that that using usart2 it
works fine
  - stm32f4discovery uses usart2 as console
  - my board, similar to stm32f4discovery, uses usart1 as console

* there is a conflict between the usart1 pins and usb device for
stm32f4discovery configuration in nuttx
  - according to the kit, the same pins (pa9 and pa10) are used for USB
host device detection

What I have done:

* replaced the vbus pin (pa9) to another not used pin
* searched for references about pa10 on the source code, and I couldn't
find anything

For now, I can see the nuttshell prompt on the serial, but it is not
accepting inputs from the keyboard.

And USB device is not working. PC is not detecting the device.

The debug outputs are all turned on, and it shows only the ABC.

I am new on nuttx and I would some advice on how to debug this early stage
initialization of the software, to identify what's running wrong.

Best regards,

Flavio


Em sáb, 20 de mar de 2021 08:11, Flavio Castro Alves Filho <
flavio.al...@gmail.com> escreveu:

> Hello,
>
> I am trying to enable USB CDC support with base NSH Serial in a
> STM32F4 Discovery board.
>
> When I build using usbnsh configuration, it works.
> When I build using nsh configuration (in my case, replacing USART2 to
> USART1), it works.
>
> Now, when I try to add USB CDC support in nsh configuration, I cannot
> see the nsh prompt on the serial anymore. And USB is not initializing
> either.
>
> Here is the defconfig file that I am using. Am I missing something?
>
> # CONFIG_ARCH_FPU is not set
> # CONFIG_NSH_ARGCAT is not set
> # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> # CONFIG_NSH_CMDPARMS is not set
> # CONFIG_STM32_CCMEXCLUDE is not set
> CONFIG_ARCH="arm"
> CONFIG_ARCH_BOARD="stm32f4discovery"
> CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
> CONFIG_ARCH_BUTTONS=y
> CONFIG_ARCH_CHIP="stm32"
> CONFIG_ARCH_CHIP_STM32=y
> CONFIG_ARCH_CHIP_STM32F407VG=y
> CONFIG_ARCH_STACKDUMP=y
> CONFIG_BOARD_LATE_INITIALIZE=y
> CONFIG_BOARD_LOOPSPERMSEC=16717
> CONFIG_BUILTIN=y
> CONFIG_CDCACM=y
> CONFIG_EXAMPLES_HELLO=y
> CONFIG_FS_PROCFS=y
> CONFIG_HAVE_CXX=y
> CONFIG_HAVE_CXXINITIALIZE=y
> CONFIG_INTELHEX_BINARY=y
> CONFIG_MAX_TASKS=16
> CONFIG_MM_REGIONS=2
> CONFIG_NFILE_DESCRIPTORS=8
> CONFIG_NSH_BUILTIN_APPS=y
> CONFIG_NSH_FILEIOSIZE=512
> CONFIG_NSH_LINELEN=64
> CONFIG_NSH_READLINE=y
> CONFIG_PREALLOC_TIMERS=4
> CONFIG_RAM_SIZE=114688
> CONFIG_RAM_START=0x2000
> CONFIG_RAW_BINARY=y
> CONFIG_RR_INTERVAL=200
> CONFIG_SCHED_WAITPID=y
> CONFIG_SDCLONE_DISABLE=y
> CONFIG_START_DAY=6
> CONFIG_START_MONTH=12
> CONFIG_START_YEAR=2011
> CONFIG_STM32_DMA1=y
> CONFIG_STM32_JTAG_SW_ENABLE=y
> CONFIG_STM32_OTGFS=y
> CONFIG_STM32_PWR=y
> CONFIG_STM32_SPI1=y
> CONFIG_STM32_USART1=y
> CONFIG_SYSTEM_CDCACM=y
> CONFIG_SYSTEM_NSH=y
> CONFIG_USART1_RXBUFSIZE=128
> CONFIG_USART1_SERIAL_CONSOLE=y
> CONFIG_USART1_TXBUFSIZE=128
> CONFIG_USBDEV=y
> CONFIG_USER_ENTRYPOINT="nsh_main"
>
>
> Best regards,
>
> Flavio
>
> --
> Flavio de Castro Alves Filho
>
> flavio.al...@gmail.com
> Twitter: http://twitter.com/#!/fraviofii
> LinkedIn profile: www.linkedin.com/in/flaviocastroalves
>


Problem using USART Console and USB-CDC together on STM32F4 Discovery

2021-03-20 Thread Flavio Castro Alves Filho
Hello,

I am trying to enable USB CDC support with base NSH Serial in a
STM32F4 Discovery board.

When I build using usbnsh configuration, it works.
When I build using nsh configuration (in my case, replacing USART2 to
USART1), it works.

Now, when I try to add USB CDC support in nsh configuration, I cannot
see the nsh prompt on the serial anymore. And USB is not initializing
either.

Here is the defconfig file that I am using. Am I missing something?

# CONFIG_ARCH_FPU is not set
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
# CONFIG_NSH_CMDPARMS is not set
# CONFIG_STM32_CCMEXCLUDE is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="stm32f4discovery"
CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
CONFIG_ARCH_BUTTONS=y
CONFIG_ARCH_CHIP="stm32"
CONFIG_ARCH_CHIP_STM32=y
CONFIG_ARCH_CHIP_STM32F407VG=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BOARD_LATE_INITIALIZE=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_CDCACM=y
CONFIG_EXAMPLES_HELLO=y
CONFIG_FS_PROCFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_INTELHEX_BINARY=y
CONFIG_MAX_TASKS=16
CONFIG_MM_REGIONS=2
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x2000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_START_DAY=6
CONFIG_START_MONTH=12
CONFIG_START_YEAR=2011
CONFIG_STM32_DMA1=y
CONFIG_STM32_JTAG_SW_ENABLE=y
CONFIG_STM32_OTGFS=y
CONFIG_STM32_PWR=y
CONFIG_STM32_SPI1=y
CONFIG_STM32_USART1=y
CONFIG_SYSTEM_CDCACM=y
CONFIG_SYSTEM_NSH=y
CONFIG_USART1_RXBUFSIZE=128
CONFIG_USART1_SERIAL_CONSOLE=y
CONFIG_USART1_TXBUFSIZE=128
CONFIG_USBDEV=y
CONFIG_USER_ENTRYPOINT="nsh_main"


Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Using C++ STL in Nuttx

2021-03-19 Thread Flavio Castro Alves Filho
Hello Xiang,

Sorry for the late reply.

Absolutely. I will do that.

Best regards,

Flavio

Em qua., 17 de mar. de 2021 às 10:57, Xiang Xiao
 escreveu:
>
> Good news. It will be great if you can document your experience in the
> Documentation folder when you find some free time.
>
> On Wed, Mar 17, 2021 at 9:54 PM Flavio Castro Alves Filho <
> flavio.al...@gmail.com> wrote:
>
> > Hello Xiang,
> >
> > I could finally build an C++ project using CMake and exported NuttX.
> >   - Before that, I made a test creating the same project inside the
> > NuttX apps structure, and it worked fine.
> >
> > My sample project is here:
> > https://github.com/Phi-Innovations/nuttx-apps/tree/main/hellocpp
> >
> > I compiled JsonCpp (https://github.com/nlohmann/json) together and it
> > worked fine.
> >
> > Thank you for all your support.
> >
> > Best regards,
> >
> > Flavio
> >
> >
> > Em ter., 16 de mar. de 2021 às 21:04, Flavio Castro Alves Filho
> >  escreveu:
> > >
> > > Xiang,
> > >
> > > I believe the problem was related to something on my branch.
> > >
> > > I was using a quite old version, based on release 10 branch.
> > >
> > > Now using master as branch, the testlibcxx compiled correctly.
> > > Tomorrow I will try my experiments and report here.
> > >
> > > Best regards,
> > >
> > > Flavio
> > >
> > > Em ter., 16 de mar. de 2021 às 16:24, Xiang Xiao
> > >  escreveu:
> > > >
> > > > Try to remove CONFIG_ARCH_FLOAT_H
> > > >
> > > > On Tue, Mar 16, 2021 at 12:15 PM Flavio Castro Alves Filho <
> > > > flavio.al...@gmail.com> wrote:
> > > >
> > > > > Hello Xiang,
> > > > >
> > > > > It is still not working. The error persists.
> > > > >
> > > > > Here is my defconfig file:
> > > > >
> > > > > #
> > > > > # This file is autogenerated: PLEASE DO NOT EDIT IT.
> > > > > #
> > > > > # You can use "make menuconfig" to make any modifications to the
> > > > > installed .config file.
> > > > > # You can then do "make savedefconfig" to generate a new defconfig
> > > > > file that includes your
> > > > > # modifications.
> > > > > #
> > > > > # CONFIG_ARCH_FPU is not set
> > > > > CONFIG_ARCH="arm"
> > > > > CONFIG_ARCH_BOARD="stm32f4discovery"
> > > > > CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
> > > > > CONFIG_ARCH_CHIP="stm32"
> > > > > CONFIG_ARCH_CHIP_STM32=y
> > > > > CONFIG_ARCH_CHIP_STM32F407VG=y
> > > > > CONFIG_ARCH_FLOAT_H=y
> > > > > CONFIG_ARCH_STACKDUMP=y
> > > > > CONFIG_BOARD_LOOPSPERMSEC=16717
> > > > > CONFIG_BUILTIN=y
> > > > > CONFIG_C99_BOOL8=y
> > > > > CONFIG_DISABLE_MOUNTPOINT=y
> > > > > CONFIG_EXAMPLES_HELLOXX=y
> > > > > CONFIG_HAVE_CXX=y
> > > > > CONFIG_INTELHEX_BINARY=y
> > > > > CONFIG_LIBCXX=y
> > > > > CONFIG_LIBC_FLOATINGPOINT=y
> > > > > CONFIG_LIBC_LOCALTIME=y
> > > > > CONFIG_MAX_TASKS=16
> > > > > CONFIG_MM_REGIONS=2
> > > > > CONFIG_NFILE_DESCRIPTORS=8
> > > > > CONFIG_NSH_BUILTIN_APPS=y
> > > > > CONFIG_NSH_FILEIOSIZE=512
> > > > > CONFIG_PREALLOC_TIMERS=4
> > > > > CONFIG_RAM_SIZE=114688
> > > > > CONFIG_RAM_START=0x2000
> > > > > CONFIG_RAW_BINARY=y
> > > > > CONFIG_RR_INTERVAL=200
> > > > > CONFIG_SCHED_ONEXIT=y
> > > > > CONFIG_SCHED_ONEXIT_MAX=4
> > > > > CONFIG_SCHED_WAITPID=y
> > > > > CONFIG_SDCLONE_DISABLE=y
> > > > > CONFIG_START_DAY=2
> > > > > CONFIG_START_MONTH=11
> > > > > CONFIG_START_YEAR=2012
> > > > > CONFIG_STM32_JTAG_SW_ENABLE=y
> > > > > CONFIG_STM32_USART2=y
> > > > > CONFIG_SYMTAB_ORDEREDBYNAME=y
> > > > > CONFIG_SYSTEM_NSH=y
> > > > > CONFIG_USART2_RXBUFSIZE=128
> > > > > CONFIG_USART2_SERIAL_CONSOLE=y
> > > > > CONFIG_USART2_TXBUFSIZE=128
> > > > > CONFIG_USER_ENTRYPOINT="nsh_main"
> > > > >
> > > > > Any idea of wh

Netlib headers missing in make export

2021-03-18 Thread Flavio Castro Alves Filho
Hello,

I started to implement code in Nuttx, using it as an external library approach.

When reimplementing (recompiling, in fact) the tcpechoserver
application, there was a compilation issue where netlib was not found
on nuttx-export headers.

I solved this issue manually copying only the header files to my
project, inside the nutt-export directory. The net library was there
and the software worked fine.

Am I missing any configuration when I built the make export in NuttX?
Or is an issue?

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Using C++ STL in Nuttx

2021-03-17 Thread Flavio Castro Alves Filho
Hello Xiang,

I could finally build an C++ project using CMake and exported NuttX.
  - Before that, I made a test creating the same project inside the
NuttX apps structure, and it worked fine.

My sample project is here:
https://github.com/Phi-Innovations/nuttx-apps/tree/main/hellocpp

I compiled JsonCpp (https://github.com/nlohmann/json) together and it
worked fine.

Thank you for all your support.

Best regards,

Flavio


Em ter., 16 de mar. de 2021 às 21:04, Flavio Castro Alves Filho
 escreveu:
>
> Xiang,
>
> I believe the problem was related to something on my branch.
>
> I was using a quite old version, based on release 10 branch.
>
> Now using master as branch, the testlibcxx compiled correctly.
> Tomorrow I will try my experiments and report here.
>
> Best regards,
>
> Flavio
>
> Em ter., 16 de mar. de 2021 às 16:24, Xiang Xiao
>  escreveu:
> >
> > Try to remove CONFIG_ARCH_FLOAT_H
> >
> > On Tue, Mar 16, 2021 at 12:15 PM Flavio Castro Alves Filho <
> > flavio.al...@gmail.com> wrote:
> >
> > > Hello Xiang,
> > >
> > > It is still not working. The error persists.
> > >
> > > Here is my defconfig file:
> > >
> > > #
> > > # This file is autogenerated: PLEASE DO NOT EDIT IT.
> > > #
> > > # You can use "make menuconfig" to make any modifications to the
> > > installed .config file.
> > > # You can then do "make savedefconfig" to generate a new defconfig
> > > file that includes your
> > > # modifications.
> > > #
> > > # CONFIG_ARCH_FPU is not set
> > > CONFIG_ARCH="arm"
> > > CONFIG_ARCH_BOARD="stm32f4discovery"
> > > CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
> > > CONFIG_ARCH_CHIP="stm32"
> > > CONFIG_ARCH_CHIP_STM32=y
> > > CONFIG_ARCH_CHIP_STM32F407VG=y
> > > CONFIG_ARCH_FLOAT_H=y
> > > CONFIG_ARCH_STACKDUMP=y
> > > CONFIG_BOARD_LOOPSPERMSEC=16717
> > > CONFIG_BUILTIN=y
> > > CONFIG_C99_BOOL8=y
> > > CONFIG_DISABLE_MOUNTPOINT=y
> > > CONFIG_EXAMPLES_HELLOXX=y
> > > CONFIG_HAVE_CXX=y
> > > CONFIG_INTELHEX_BINARY=y
> > > CONFIG_LIBCXX=y
> > > CONFIG_LIBC_FLOATINGPOINT=y
> > > CONFIG_LIBC_LOCALTIME=y
> > > CONFIG_MAX_TASKS=16
> > > CONFIG_MM_REGIONS=2
> > > CONFIG_NFILE_DESCRIPTORS=8
> > > CONFIG_NSH_BUILTIN_APPS=y
> > > CONFIG_NSH_FILEIOSIZE=512
> > > CONFIG_PREALLOC_TIMERS=4
> > > CONFIG_RAM_SIZE=114688
> > > CONFIG_RAM_START=0x2000
> > > CONFIG_RAW_BINARY=y
> > > CONFIG_RR_INTERVAL=200
> > > CONFIG_SCHED_ONEXIT=y
> > > CONFIG_SCHED_ONEXIT_MAX=4
> > > CONFIG_SCHED_WAITPID=y
> > > CONFIG_SDCLONE_DISABLE=y
> > > CONFIG_START_DAY=2
> > > CONFIG_START_MONTH=11
> > > CONFIG_START_YEAR=2012
> > > CONFIG_STM32_JTAG_SW_ENABLE=y
> > > CONFIG_STM32_USART2=y
> > > CONFIG_SYMTAB_ORDEREDBYNAME=y
> > > CONFIG_SYSTEM_NSH=y
> > > CONFIG_USART2_RXBUFSIZE=128
> > > CONFIG_USART2_SERIAL_CONSOLE=y
> > > CONFIG_USART2_TXBUFSIZE=128
> > > CONFIG_USER_ENTRYPOINT="nsh_main"
> > >
> > > Any idea of what is missing?
> > >
> > > Best regards,
> > >
> > > Flavio
> > >
> > > Em ter., 16 de mar. de 2021 às 14:32, Xiang Xiao
> > >  escreveu:
> > > >
> > > > On Tue, Mar 16, 2021 at 10:20 AM Flavio Castro Alves Filho <
> > > > flavio.al...@gmail.com> wrote:
> > > >
> > > > > Hello Xiang,
> > > > >
> > > > > Em ter., 16 de mar. de 2021 às 14:01, Xiang Xiao
> > > > >  escreveu:
> > > > > >
> > > > > > On Tu
> > > > > > >
> > > > > > This project use the modern C++ feature, so you must enable llvm
> > > > > > ibc++(CONFIG_LIBCXX=y)
> > > > >
> > > > > I tried a new build, executing:
> > > > >
> > > > > $ make distclean
> > > > > $ ./tools/configure.sh -l stm32f4discovery:testlibcxx
> > > > > $ make
> > > > >
> > > > > I can see the library being downloaded from git, but it is not
> > > compiling.
> > > > >
> > > > > In file included from
> > > > > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/random:1637,
> > > > >  from libcxx/src/random.cpp:16:
> > > > > /home/ub

Re: Using C++ STL in Nuttx

2021-03-16 Thread Flavio Castro Alves Filho
Xiang,

I believe the problem was related to something on my branch.

I was using a quite old version, based on release 10 branch.

Now using master as branch, the testlibcxx compiled correctly.
Tomorrow I will try my experiments and report here.

Best regards,

Flavio

Em ter., 16 de mar. de 2021 às 16:24, Xiang Xiao
 escreveu:
>
> Try to remove CONFIG_ARCH_FLOAT_H
>
> On Tue, Mar 16, 2021 at 12:15 PM Flavio Castro Alves Filho <
> flavio.al...@gmail.com> wrote:
>
> > Hello Xiang,
> >
> > It is still not working. The error persists.
> >
> > Here is my defconfig file:
> >
> > #
> > # This file is autogenerated: PLEASE DO NOT EDIT IT.
> > #
> > # You can use "make menuconfig" to make any modifications to the
> > installed .config file.
> > # You can then do "make savedefconfig" to generate a new defconfig
> > file that includes your
> > # modifications.
> > #
> > # CONFIG_ARCH_FPU is not set
> > CONFIG_ARCH="arm"
> > CONFIG_ARCH_BOARD="stm32f4discovery"
> > CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
> > CONFIG_ARCH_CHIP="stm32"
> > CONFIG_ARCH_CHIP_STM32=y
> > CONFIG_ARCH_CHIP_STM32F407VG=y
> > CONFIG_ARCH_FLOAT_H=y
> > CONFIG_ARCH_STACKDUMP=y
> > CONFIG_BOARD_LOOPSPERMSEC=16717
> > CONFIG_BUILTIN=y
> > CONFIG_C99_BOOL8=y
> > CONFIG_DISABLE_MOUNTPOINT=y
> > CONFIG_EXAMPLES_HELLOXX=y
> > CONFIG_HAVE_CXX=y
> > CONFIG_INTELHEX_BINARY=y
> > CONFIG_LIBCXX=y
> > CONFIG_LIBC_FLOATINGPOINT=y
> > CONFIG_LIBC_LOCALTIME=y
> > CONFIG_MAX_TASKS=16
> > CONFIG_MM_REGIONS=2
> > CONFIG_NFILE_DESCRIPTORS=8
> > CONFIG_NSH_BUILTIN_APPS=y
> > CONFIG_NSH_FILEIOSIZE=512
> > CONFIG_PREALLOC_TIMERS=4
> > CONFIG_RAM_SIZE=114688
> > CONFIG_RAM_START=0x2000
> > CONFIG_RAW_BINARY=y
> > CONFIG_RR_INTERVAL=200
> > CONFIG_SCHED_ONEXIT=y
> > CONFIG_SCHED_ONEXIT_MAX=4
> > CONFIG_SCHED_WAITPID=y
> > CONFIG_SDCLONE_DISABLE=y
> > CONFIG_START_DAY=2
> > CONFIG_START_MONTH=11
> > CONFIG_START_YEAR=2012
> > CONFIG_STM32_JTAG_SW_ENABLE=y
> > CONFIG_STM32_USART2=y
> > CONFIG_SYMTAB_ORDEREDBYNAME=y
> > CONFIG_SYSTEM_NSH=y
> > CONFIG_USART2_RXBUFSIZE=128
> > CONFIG_USART2_SERIAL_CONSOLE=y
> > CONFIG_USART2_TXBUFSIZE=128
> > CONFIG_USER_ENTRYPOINT="nsh_main"
> >
> > Any idea of what is missing?
> >
> > Best regards,
> >
> > Flavio
> >
> > Em ter., 16 de mar. de 2021 às 14:32, Xiang Xiao
> >  escreveu:
> > >
> > > On Tue, Mar 16, 2021 at 10:20 AM Flavio Castro Alves Filho <
> > > flavio.al...@gmail.com> wrote:
> > >
> > > > Hello Xiang,
> > > >
> > > > Em ter., 16 de mar. de 2021 às 14:01, Xiang Xiao
> > > >  escreveu:
> > > > >
> > > > > On Tu
> > > > > >
> > > > > This project use the modern C++ feature, so you must enable llvm
> > > > > ibc++(CONFIG_LIBCXX=y)
> > > >
> > > > I tried a new build, executing:
> > > >
> > > > $ make distclean
> > > > $ ./tools/configure.sh -l stm32f4discovery:testlibcxx
> > > > $ make
> > > >
> > > > I can see the library being downloaded from git, but it is not
> > compiling.
> > > >
> > > > In file included from
> > > > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/random:1637,
> > > >  from libcxx/src/random.cpp:16:
> > > > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath: At global scope:
> > > > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:321:9: error:
> > > > '::signbit' has not been declared
> > > >   321 | using ::signbit;
> > > >   | ^~~
> > > > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:322:9: error:
> > > > '::fpclassify' has not been declared
> > > >   322 | using ::fpclassify;
> > > >   | ^~
> > > > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:326:9: error:
> > > > '::isnormal' has not been declared
> > > >   326 | using ::isnormal;
> > > >   | ^~~~
> > > > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:327:9: error:
> > > > '::isgreater' has not been declared
> > > >   327 | using ::isgreater;
> > > >
> > > > How should I solve this issue?
> > > >
> > >
> > > CONFIG_LIBM has to be disabled, since NuttX match library implementation
> > > lacks many standard defined functions which is required by the new libc++
> > > library.
> > >
> > >
> > > >
> > > > > >
> > > > > You need tell compiler stop to search the toolchain provided c++
> > library
> > > > > by -nostdinc++
> > > > >
> > > >
> > > > I believe it will solve my cmake issue.
> > > >
> > > > Best regards,
> > > >
> > > > Flavio
> > > >
> >
> >
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.al...@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Using C++ STL in Nuttx

2021-03-16 Thread Flavio Castro Alves Filho
Hello Xiang,

It is still not working. The error persists.

Here is my defconfig file:

#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the
installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig
file that includes your
# modifications.
#
# CONFIG_ARCH_FPU is not set
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="stm32f4discovery"
CONFIG_ARCH_BOARD_STM32F4_DISCOVERY=y
CONFIG_ARCH_CHIP="stm32"
CONFIG_ARCH_CHIP_STM32=y
CONFIG_ARCH_CHIP_STM32F407VG=y
CONFIG_ARCH_FLOAT_H=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_C99_BOOL8=y
CONFIG_DISABLE_MOUNTPOINT=y
CONFIG_EXAMPLES_HELLOXX=y
CONFIG_HAVE_CXX=y
CONFIG_INTELHEX_BINARY=y
CONFIG_LIBCXX=y
CONFIG_LIBC_FLOATINGPOINT=y
CONFIG_LIBC_LOCALTIME=y
CONFIG_MAX_TASKS=16
CONFIG_MM_REGIONS=2
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x2000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_SCHED_ONEXIT=y
CONFIG_SCHED_ONEXIT_MAX=4
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_START_DAY=2
CONFIG_START_MONTH=11
CONFIG_START_YEAR=2012
CONFIG_STM32_JTAG_SW_ENABLE=y
CONFIG_STM32_USART2=y
CONFIG_SYMTAB_ORDEREDBYNAME=y
CONFIG_SYSTEM_NSH=y
CONFIG_USART2_RXBUFSIZE=128
CONFIG_USART2_SERIAL_CONSOLE=y
CONFIG_USART2_TXBUFSIZE=128
CONFIG_USER_ENTRYPOINT="nsh_main"

Any idea of what is missing?

Best regards,

Flavio

Em ter., 16 de mar. de 2021 às 14:32, Xiang Xiao
 escreveu:
>
> On Tue, Mar 16, 2021 at 10:20 AM Flavio Castro Alves Filho <
> flavio.al...@gmail.com> wrote:
>
> > Hello Xiang,
> >
> > Em ter., 16 de mar. de 2021 às 14:01, Xiang Xiao
> >  escreveu:
> > >
> > > On Tu
> > > >
> > > This project use the modern C++ feature, so you must enable llvm
> > > ibc++(CONFIG_LIBCXX=y)
> >
> > I tried a new build, executing:
> >
> > $ make distclean
> > $ ./tools/configure.sh -l stm32f4discovery:testlibcxx
> > $ make
> >
> > I can see the library being downloaded from git, but it is not compiling.
> >
> > In file included from
> > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/random:1637,
> >  from libcxx/src/random.cpp:16:
> > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath: At global scope:
> > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:321:9: error:
> > '::signbit' has not been declared
> >   321 | using ::signbit;
> >   | ^~~
> > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:322:9: error:
> > '::fpclassify' has not been declared
> >   322 | using ::fpclassify;
> >   | ^~
> > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:326:9: error:
> > '::isnormal' has not been declared
> >   326 | using ::isnormal;
> >   | ^~~~
> > /home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:327:9: error:
> > '::isgreater' has not been declared
> >   327 | using ::isgreater;
> >
> > How should I solve this issue?
> >
>
> CONFIG_LIBM has to be disabled, since NuttX match library implementation
> lacks many standard defined functions which is required by the new libc++
> library.
>
>
> >
> > > >
> > > You need tell compiler stop to search the toolchain provided c++ library
> > > by -nostdinc++
> > >
> >
> > I believe it will solve my cmake issue.
> >
> > Best regards,
> >
> > Flavio
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Using C++ STL in Nuttx

2021-03-16 Thread Flavio Castro Alves Filho
Hello Xiang,

Em ter., 16 de mar. de 2021 às 14:01, Xiang Xiao
 escreveu:
>
> On Tu
> >
> This project use the modern C++ feature, so you must enable llvm
> ibc++(CONFIG_LIBCXX=y)

I tried a new build, executing:

$ make distclean
$ ./tools/configure.sh -l stm32f4discovery:testlibcxx
$ make

I can see the library being downloaded from git, but it is not compiling.

In file included from /home/ubuntu/nuttx_ws/nuttx/include/libcxx/random:1637,
 from libcxx/src/random.cpp:16:
/home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath: At global scope:
/home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:321:9: error:
'::signbit' has not been declared
  321 | using ::signbit;
  | ^~~
/home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:322:9: error:
'::fpclassify' has not been declared
  322 | using ::fpclassify;
  | ^~
/home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:326:9: error:
'::isnormal' has not been declared
  326 | using ::isnormal;
  | ^~~~
/home/ubuntu/nuttx_ws/nuttx/include/libcxx/cmath:327:9: error:
'::isgreater' has not been declared
  327 | using ::isgreater;

How should I solve this issue?

> >
> You need tell compiler stop to search the toolchain provided c++ library
> by -nostdinc++
>

I believe it will solve my cmake issue.

Best regards,

Flavio


Re: Using C++ STL in Nuttx

2021-03-16 Thread Flavio Castro Alves Filho
Concerning cxx or cpp ... I have to tell you that I was not used for
cxx ... but it is not a problem anyway.

What is disturbing me now is that there are problems regarding newlib
c++ and uClib++.

I tried to add this json project: https://github.com/nlohmann/json, in
single header mode.

I am facing the following error:

CXX:  Log.cxx
make[1]: 'libc.a' is up to date.
make[1]: Leaving directory '/home/ubuntu/nuttx_ws/nuttx/libs/libc'
make[3]: Nothing to be done for 'all'.
make[3]: Leaving directory '/home/ubuntu/nuttx_ws/apps/platform'
In file included from /usr/include/newlib/c++/9.2.1/bits/hashtable_policy.h:35,
 from /usr/include/newlib/c++/9.2.1/bits/hashtable.h:35,
 from /usr/include/newlib/c++/9.2.1/unordered_map:46,
 from json.hpp:70,
 from Log.cxx:2:
/home/ubuntu/nuttx_ws/nuttx/include/uClibc++/limits:24:2: warning:
#warning limits header is nowhere complete or accurate [-Wcpp]
   24 | #warning limits header is nowhere complete or accurate
  |  ^~~
In file included from /usr/include/newlib/c++/9.2.1/bits/stl_algobase.h:61,
 from /usr/include/newlib/c++/9.2.1/array:40,
 from json.hpp:62,
 from Log.cxx:2:
/usr/include/newlib/c++/9.2.1/bits/cpp_type_traits.h:73:10: error:
redefinition of 'struct std::__true_type'
   73 |   struct __true_type { };
  |  ^~~
In file included from /home/ubuntu/nuttx_ws/nuttx/include/uClibc++/vector:26,
 from /home/ubuntu/nuttx_ws/nuttx/include/uClibc++/string:25,
 from /home/ubuntu/nuttx_ws/nuttx/include/uClibc++/locale:22,
 from /home/ubuntu/nuttx_ws/nuttx/include/uClibc++/ios:22,
 from /home/ubuntu/nuttx_ws/nuttx/include/uClibc++/iostream:26,
 from Log.h:4,
 from Log.cxx:1:

How should I address this kind of problem?

Best regards,

Flavio

Em ter., 16 de mar. de 2021 às 12:34, Xiang Xiao
 escreveu:
>
> On Tue, Mar 16, 2021 at 11:24 PM Gregory Nutt  wrote:
>
> >
> > >> I had to change my file names, from cpp to cxx. Is it mandatory to
> > >> change the file extension to use C++?
> > >>
> > > No, .cxx is just the default extension. You can change the default value
> > in
> > > Makefile like this:
> > > CXXEXT=.cpp
> > > But this feature just exists in Makefile under the apps folder.
> >
> > Again, the coding standard does currently require the .cxx extension:
> > https://cwiki.apache.org/confluence/display/NUTTX/Coding+Standard#cplusplus
> >
> > I would consider that up for discussion and subject to community
> > concurrence.  Which ever is selected, the extension should be used
> > consistently.  All C++ files under apps follow the coding standard for
> > file naming EXCEPT for some ELF loadable modules and some test-releated
> > files that are currently in violation of the coding standard:
> >
> > ./examples/elf/tests/helloxx/hello++1.cpp
> > ./examples/elf/tests/helloxx/hello++2.cpp
> > ./examples/elf/tests/helloxx/hello++3.cpp
> > ./examples/elf/tests/helloxx/hello++4.cpp
> > ./examples/elf/tests/helloxx/hello++5.cpp
> > ./examples/nxflat/tests/hello++/hello++1.cpp
> > ./examples/nxflat/tests/hello++/hello++2.cpp
> > ./examples/nxflat/tests/hello++/hello++3.cpp
> > ./examples/nxflat/tests/hello++/hello++4.cpp
> > ./testing/irtest/cmd.cpp
> > ./testing/irtest/enum.cpp
> > ./testing/irtest/main.cpp
> >
> >
> All these sources can change to .cxx suffix.
>
>
> > We do require strong motivation before any changes are made to the
> > coding stardard.  We want to avoid the case where the coding standard is
> > changed to meet the preferences a single person or a single
> > organization.  Any changes must have a broad community mandate.
> >
> >
> CXXEXT is for code which doesn't plan to be upstreamed. Actually, after
> joining Apache, I don't think we can freely include 3rd party code into
> repo like before even with the compatible license and not in active
> development. So



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Using C++ STL in Nuttx

2021-03-16 Thread Flavio Castro Alves Filho
Hello Xiang,

I could execute my example inside the NuttX infrastructure.

I had to change my file names, from cpp to cxx. Is it mandatory to
change the file extension to use C++?

Reviewing my cmake file, it seems that it is not using uClibc++ to
build, but newlib ... probably that's the reason for the linking
error. I need to figure out how to address this. If you have any
suggestions, please let me know.

Best regards,

Flavio


Em seg., 15 de mar. de 2021 às 08:24, Flavio Castro Alves Filho
 escreveu:
>
> Hello Xiang,
>
> Thank you for your fast response.
>
> I was trying to build out of the NuttX structure, using NuttX as a library.
>
> I tested and checked what you showed and it worked.
>
> I exported the configuration (running make export and uncompressing
> the zip file into my environment) and tried to build again and I it is
> still not compiling.
>
> Finally, I added the '#include  and it is still not working.
>
> I wil test now inside the NuttX structure.
>
> Thank you very much.
>
> Best regards,
>
> Flavio
>
> Em seg., 15 de mar. de 2021 às 07:14, Xiang Xiao
>  escreveu:
> >
> > On Mon, Mar 15, 2021 at 6:00 PM Flavio Castro Alves Filho <
> > flavio.al...@gmail.com> wrote:
> >
> > > Hello,
> > >
> > > I am trying to use STL in a simple C++ Hello project and I am getting
> > > compilation error.s
> > >
> > > Is STL supported in NuttX? Can I use it?
> > >
> > >
> > Yes, you can. Please reference the following config and Make.defs to setup
> > your C++ environment:
> > nuttx/boards/arm/stm32/stm32f4discovery/configs/cxxtest/defconfig
> > nuttx/boards/sim/sim/sim/configs/cxxtest/defconfig
> > nuttx/nuttx/boards/sim/sim/sim/configs/libcxxtest/defconfig
> >
> >
> > > Here is my sample code:
> > >
> > > === Hello.cpp ===
> > > #include 
> > > #include "HelloWorld.h"
> > >
> > > CHelloWorld::CHelloWorld() {
> > > mSecret = 42;
> > > printf("Constructor: mSecret=%d\n",mSecret);
> > > }
> > >
> > > CHelloWorld::~CHelloWorld() {
> > >
> > > }
> > >
> > > bool CHelloWorld::HelloWorld(void) {
> > > printf("HelloWorld: mSecret=%d\n",mSecret);
> > >
> > > if (mSecret == 42) {
> > > printf("CHelloWorld: HelloWorld: Hello, world!");
> > > return true;
> > > }
> > > else {
> > > printf("CHelloWorld: HelloWorld: CONSTRUCTION FAILED!\n");
> > > return false;
> > > }
> > > }
> > > =
> > >
> > > === Hello.h ===
> > > class CHelloWorld
> > > {
> > > public:
> > > CHelloWorld();
> > > ~CHelloWorld();
> > > bool HelloWorld(void);
> > > private:
> > > int mSecret;
> > > };
> > > =
> > >
> > > === Log.cpp ===
> > > #include "Log.h"
> > > #include 
> > > #include 
> > >
> > > void Log::print(std::string_view message) {
> > >
> > > FILE *fp = fopen("/dev/ttyS0", "w");
> > > if (fp == NULL) {
> > > printf("Error opening serial port!\n");
> > > return;
> > > }
> > >
> > > std::string msgStr { message };
> > >
> > > /* Try to force input data on stdin */
> > > fwrite(msgStr.c_str(), sizeof(char), message.length(), fp);
> > >
> > > fclose(fp);
> > > }
> > > =
> > >
> > > === Log.h ===
> > > #include 
> > >
> > > class Log {
> > > public:
> > > static void print(std::string_view message);
> > > };
> > > =
> > >
> > > And there the compilation error:
> > > =
> > > -- Build files have been written to: 
> > > /home/ubuntu/nuttx-apps/hellocpp/build
> > > [4/4] Linking CXX executable src/hellocpp
> > > FAILED: src/hellocpp
> > > : && arm-none-eabi-ld --entry=__start -nostartfiles -nostdlib
> > > -nodefaultlibs
> > > -T/home/ubuntu/nuttx-apps/hellocpp/nuttx-export-9.1.0/scripts/ld.script
> > > -o hellocpp.elf src/CMakeFiles/hellocpp.dir/HelloWorld.cpp.o
> > > src/CMakeFiles/hellocpp.dir/Log.cpp.o
> > > src/CMakeFiles/hellocpp.dir/main.cpp.o
> > > -L/home/ubuntu/nuttx-apps/hellocp

Re: Using C++ STL in Nuttx

2021-03-15 Thread Flavio Castro Alves Filho
Hello Xiang,

Thank you for your fast response.

I was trying to build out of the NuttX structure, using NuttX as a library.

I tested and checked what you showed and it worked.

I exported the configuration (running make export and uncompressing
the zip file into my environment) and tried to build again and I it is
still not compiling.

Finally, I added the '#include  and it is still not working.

I wil test now inside the NuttX structure.

Thank you very much.

Best regards,

Flavio

Em seg., 15 de mar. de 2021 às 07:14, Xiang Xiao
 escreveu:
>
> On Mon, Mar 15, 2021 at 6:00 PM Flavio Castro Alves Filho <
> flavio.al...@gmail.com> wrote:
>
> > Hello,
> >
> > I am trying to use STL in a simple C++ Hello project and I am getting
> > compilation error.s
> >
> > Is STL supported in NuttX? Can I use it?
> >
> >
> Yes, you can. Please reference the following config and Make.defs to setup
> your C++ environment:
> nuttx/boards/arm/stm32/stm32f4discovery/configs/cxxtest/defconfig
> nuttx/boards/sim/sim/sim/configs/cxxtest/defconfig
> nuttx/nuttx/boards/sim/sim/sim/configs/libcxxtest/defconfig
>
>
> > Here is my sample code:
> >
> > === Hello.cpp ===
> > #include 
> > #include "HelloWorld.h"
> >
> > CHelloWorld::CHelloWorld() {
> > mSecret = 42;
> > printf("Constructor: mSecret=%d\n",mSecret);
> > }
> >
> > CHelloWorld::~CHelloWorld() {
> >
> > }
> >
> > bool CHelloWorld::HelloWorld(void) {
> > printf("HelloWorld: mSecret=%d\n",mSecret);
> >
> > if (mSecret == 42) {
> > printf("CHelloWorld: HelloWorld: Hello, world!");
> > return true;
> > }
> > else {
> > printf("CHelloWorld: HelloWorld: CONSTRUCTION FAILED!\n");
> > return false;
> > }
> > }
> > =
> >
> > === Hello.h ===
> > class CHelloWorld
> > {
> > public:
> > CHelloWorld();
> > ~CHelloWorld();
> > bool HelloWorld(void);
> > private:
> > int mSecret;
> > };
> > =
> >
> > === Log.cpp ===
> > #include "Log.h"
> > #include 
> > #include 
> >
> > void Log::print(std::string_view message) {
> >
> > FILE *fp = fopen("/dev/ttyS0", "w");
> > if (fp == NULL) {
> > printf("Error opening serial port!\n");
> > return;
> > }
> >
> > std::string msgStr { message };
> >
> > /* Try to force input data on stdin */
> > fwrite(msgStr.c_str(), sizeof(char), message.length(), fp);
> >
> > fclose(fp);
> > }
> > =
> >
> > === Log.h ===
> > #include 
> >
> > class Log {
> > public:
> > static void print(std::string_view message);
> > };
> > =
> >
> > And there the compilation error:
> > =
> > -- Build files have been written to: /home/ubuntu/nuttx-apps/hellocpp/build
> > [4/4] Linking CXX executable src/hellocpp
> > FAILED: src/hellocpp
> > : && arm-none-eabi-ld --entry=__start -nostartfiles -nostdlib
> > -nodefaultlibs
> > -T/home/ubuntu/nuttx-apps/hellocpp/nuttx-export-9.1.0/scripts/ld.script
> > -o hellocpp.elf src/CMakeFiles/hellocpp.dir/HelloWorld.cpp.o
> > src/CMakeFiles/hellocpp.dir/Log.cpp.o
> > src/CMakeFiles/hellocpp.dir/main.cpp.o
> > -L/home/ubuntu/nuttx-apps/hellocpp/src/hellocpp
> > -L/home/ubuntu/nuttx-apps/hellocpp/nuttx-export-9.1.0/libs
> > --start-group  -lc  -larch  -lbinfmt  -lboard  -lboards  -ldrivers
> > -lfs  -lmm  -lsched  -lxx  -lnet  -lsupc++
> > /usr/lib/gcc/arm-none-eabi/9.2.1/thumb/v7e-m/nofp/libgcc.a
> > --end-group && cd /home/ubuntu/nuttx-apps/hellocpp/build/src &&
> > arm-none-eabi-objcopy -S -O binary
> > /home/ubuntu/nuttx-apps/hellocpp/build/hellocpp.elf
> > /home/ubuntu/nuttx-apps/hellocpp/build/hellocpp.bin
> > arm-none-eabi-ld: src/CMakeFiles/hellocpp.dir/Log.cpp.o: in function
> > `void std::__cxx11::basic_string,
> > std::allocator >::_M_construct(char const*, char
> > const*, std::forward_iterator_tag)':
> > /usr/include/newlib/c++/9.2.1/bits/basic_string.tcc:212: undefined
> > reference to `std::__throw_logic_error(char const*)'
> > arm-none-eabi-ld:
> > /usr/include/newlib/c++/9.2.1/bits/basic_string.tcc:219: undefined
> > reference to `std::__cxx11::basic_string,
> > std::allocator >::_M_create(unsigned int&, unsigned int)'
> > arm-no

Using C++ STL in Nuttx

2021-03-15 Thread Flavio Castro Alves Filho
Hello,

I am trying to use STL in a simple C++ Hello project and I am getting
compilation error.s

Is STL supported in NuttX? Can I use it?

Here is my sample code:

=== Hello.cpp ===
#include 
#include "HelloWorld.h"

CHelloWorld::CHelloWorld() {
mSecret = 42;
printf("Constructor: mSecret=%d\n",mSecret);
}

CHelloWorld::~CHelloWorld() {

}

bool CHelloWorld::HelloWorld(void) {
printf("HelloWorld: mSecret=%d\n",mSecret);

if (mSecret == 42) {
printf("CHelloWorld: HelloWorld: Hello, world!");
return true;
}
else {
printf("CHelloWorld: HelloWorld: CONSTRUCTION FAILED!\n");
return false;
}
}
=

=== Hello.h ===
class CHelloWorld
{
public:
CHelloWorld();
~CHelloWorld();
bool HelloWorld(void);
private:
int mSecret;
};
=

=== Log.cpp ===
#include "Log.h"
#include 
#include 

void Log::print(std::string_view message) {

FILE *fp = fopen("/dev/ttyS0", "w");
if (fp == NULL) {
printf("Error opening serial port!\n");
return;
}

std::string msgStr { message };

/* Try to force input data on stdin */
fwrite(msgStr.c_str(), sizeof(char), message.length(), fp);

fclose(fp);
}
=

=== Log.h ===
#include 

class Log {
public:
static void print(std::string_view message);
};
=

And there the compilation error:
=
-- Build files have been written to: /home/ubuntu/nuttx-apps/hellocpp/build
[4/4] Linking CXX executable src/hellocpp
FAILED: src/hellocpp
: && arm-none-eabi-ld --entry=__start -nostartfiles -nostdlib
-nodefaultlibs 
-T/home/ubuntu/nuttx-apps/hellocpp/nuttx-export-9.1.0/scripts/ld.script
-o hellocpp.elf src/CMakeFiles/hellocpp.dir/HelloWorld.cpp.o
src/CMakeFiles/hellocpp.dir/Log.cpp.o
src/CMakeFiles/hellocpp.dir/main.cpp.o
-L/home/ubuntu/nuttx-apps/hellocpp/src/hellocpp
-L/home/ubuntu/nuttx-apps/hellocpp/nuttx-export-9.1.0/libs
--start-group  -lc  -larch  -lbinfmt  -lboard  -lboards  -ldrivers
-lfs  -lmm  -lsched  -lxx  -lnet  -lsupc++
/usr/lib/gcc/arm-none-eabi/9.2.1/thumb/v7e-m/nofp/libgcc.a
--end-group && cd /home/ubuntu/nuttx-apps/hellocpp/build/src &&
arm-none-eabi-objcopy -S -O binary
/home/ubuntu/nuttx-apps/hellocpp/build/hellocpp.elf
/home/ubuntu/nuttx-apps/hellocpp/build/hellocpp.bin
arm-none-eabi-ld: src/CMakeFiles/hellocpp.dir/Log.cpp.o: in function
`void std::__cxx11::basic_string,
std::allocator >::_M_construct(char const*, char
const*, std::forward_iterator_tag)':
/usr/include/newlib/c++/9.2.1/bits/basic_string.tcc:212: undefined
reference to `std::__throw_logic_error(char const*)'
arm-none-eabi-ld:
/usr/include/newlib/c++/9.2.1/bits/basic_string.tcc:219: undefined
reference to `std::__cxx11::basic_string,
std::allocator >::_M_create(unsigned int&, unsigned int)'
arm-none-eabi-ld:
/usr/include/newlib/c++/9.2.1/bits/basic_string.tcc:225: undefined
reference to `std::__cxx11::basic_string,
std::allocator >::_S_copy_chars(char*, char const*, char
const*)'
arm-none-eabi-ld: src/CMakeFiles/hellocpp.dir/Log.cpp.o: in function
`std::__cxx11::basic_string,
std::allocator >::~basic_string()':
/usr/include/newlib/c++/9.2.1/bits/basic_string.h:658: undefined
reference to `std::__cxx11::basic_string,
std::allocator >::_M_dispose()'
arm-none-eabi-ld:
/usr/include/newlib/c++/9.2.1/bits/basic_string.h:658: undefined
reference to `std::__cxx11::basic_string,
std::allocator >::_M_dispose()'
ninja: build stopped: subcommand failed.
make[1]: *** [Makefile:13: _build] Error 1
make[1]: Leaving directory '/home/ubuntu/nuttx-apps/hellocpp'
make: *** [Makefile:25: default] Error 2
=

My CMakelists:

=== CMakeLists.txt ===
cmake_minimum_required(VERSION 3.2...3.15)

project(hellocpp
VERSION 1.0
DESCRIPTION "Hello world C++ Nuttx"
)

set(CMAKE_CXX_STANDARD 17)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 99)

set(NUTTX_PATH "${CMAKE_SOURCE_DIR}/nuttx-export-9.1.0")

include(cmake/phigw.cmake)

set(AC_COMMON_FLAGS "${AC_COMMON_FLAGS} -fno-builtin -Wall -Wshadow -Wundef -g")

set(AC_DEFINES "${AC_DEFINES} -DCONFIG_WCHAR_BUILTIN")

include_directories(
src
${NUTTX_PATH}/include
${NUTTX_PATH}/arch/chip
)

set(EXE_NAME hellocpp)

set(CMAKE_CXX_FLAGS "${AC_HW_FLAGS} ${AC_DEFINES} ${AC_COMMON_FLAGS}
${AC_CXX_EXTRA_FLAGS}")
if (PARAM_DEBUG)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -g")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os")
endif()

set(CMAKE_SKIP_RPATH ON)
set(CMAKE_CXX_LINK_EXECUTABLE "${CMAKE_LINKER} ${AC_LINKER_FLAGS} -o
${EXE_NAME}.elf  ")

set(BUILD_SHARED_LIBS OFF)

add_subdirectory(src)
=

=== src/CMakelists.txt ===
set(HEADER_FILES
HelloWorld.h
Log.h
)

set(SOURCE_FILES
HelloWorld.cpp
Log.cpp
)

link_directories(${EXE_NAME} ${NUTTX_PATH}/libs)

add_executable(${EXE_NAME} ${SOURCE_FILES} main.cpp ${HEADER_FILES})

add_custom_command(
TARGET ${EXE_NAME}
POST_BUILD
COMMAND ${CMAKE_OBJCOPY} ARGS -S -O binary

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

2021-01-18 Thread Flavio Castro Alves Filho
Hello,

Confirming: it is not working.

I tried to see the syslog messages on an UART port while using
nutshell on usb but it didn't work.

Best regards,

Flavio

Em dom., 17 de jan. de 2021 às 13:52, Gregory Nutt
 escreveu:
>
> I don't think that this combination will work:
>
> CONFIG_CDCACM_CONSOLE=y
> CONFIG_CONSOLE_SYSLOG=y
>
> I think that the syslog console device would have to be available at
> bootup. Normally a RAM log is is used to hold syslog data if a USB
> console is used.
>
> I might be wrong about that and this should not prevent the USB device
> connecting.
>
> On 1/17/2021 9:10 AM, Flavio Castro Alves Filho wrote:
> > Thank you very much for your fast response.
> >
> > I checked the boot calls and they are the same, regarding USB 
> > initialization.
> >
> > I compared the include/nuttx/config.h files too ... at least regarding
> > USB, I couldn't see anything critical.
> >
> > The development approach that I am working was exactly starting with
> > stm32discovery board and increasing features. Maybe I have to restart,
> > checking first the USB.
> >
> > Best regards,
> >
> > Flavio
> >
> > Em dom., 17 de jan. de 2021 às 11:39, Grr  escreveu:
> >> What you can do is compare .config generated from that defconfig to .config
> >> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
> >> the differences. You can also compare include/nuttx/config.h from both
> >> configs
> >>
> >> Another approach is to start from discovery config and do the modifications
> >> for your board. After you have it working, clone the config to a different
> >> board name. With "make savedefconfig" you can save your working defconfig
> >>
> >> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
> >> flavio.al...@gmail.com>) escribió:
> >>
> >>> As an additional information, if I load the STM32F4DISCO on my board, USB
> >>> works.
> >>>
> >>> Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
> >>>  escreveu:
> >>>> Hello,
> >>>>
> >>>> I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> >>>> microcontroller is the STM32F407VET6.
> >>>>
> >>>> USB CDC support is not initializing.
> >>>>
> >>>> When I plug the USB on the board, I have the following dmesg response in
> >>> Linux:
> >>>> [517062.075048] usb usb1-port2: attempt power cycle
> >>>> [517062.726922] usb 1-2: new full-speed USB device number 47 using
> >>> xhci_hcd
> >>>> [517062.727170] usb 1-2: Device not responding to setup address.
> >>>> [517062.935148] usb 1-2: Device not responding to setup address.
> >>>> [517063.142906] usb 1-2: device not accepting address 47, error -71
> >>>> [517063.270916] usb 1-2: new full-speed USB device number 48 using
> >>> xhci_hcd
> >>>> [517063.271141] usb 1-2: Device not responding to setup address.
> >>>> [517063.479134] usb 1-2: Device not responding to setup address.
> >>>>
> >>>> When I run stm32f4discovery:usbnsh on my discovery board, it works.
> >>>>
> >>>> I compared the defconfig from the base project and from mine and I
> >>>> believe I have initialized everything that is related to the USB.
> >>>>
> >>>> Here is the defconfig for my board:
> >>>>
> >>>> #
> >>>> # This file is autogenerated: PLEASE DO NOT EDIT IT.
> >>>> #
> >>>> # You can use "make menuconfig" to make any modifications to the
> >>>> installed .config file.
> >>>> # You can then do "make savedefconfig" to generate a new defconfig
> >>>> file that includes your
> >>>> # modifications.
> >>>> #
> >>>> # CONFIG_ARCH_FPU is not set
> >>>> # CONFIG_MMCSD_MMCSUPPORT is not set
> >>>> # CONFIG_MMCSD_SPI is not set
> >>>> # CONFIG_NSH_ARGCAT is not set
> >>>> # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> >>>> # CONFIG_NSH_CMDPARMS is not set
> >>>> CONFIG_ADC=y
> >>>> CONFIG_ANALOG=y
> >>>> CONFIG_ARCH="arm"
> >>>> CONFIG_ARCH_BOARD="phi-innovations"
> >>>> CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> >>>> CONFIG_ARCH_CHIP=&q

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

2021-01-18 Thread Flavio Castro Alves Filho
I have good news (for me) :-)

I've built my customization using the stm32discovery:usbnsh
configuration and it worked.

I will restart from there.

Thank you for all your considerations.

Best regards,

Flavio

Em dom., 17 de jan. de 2021 às 19:16, spudaneco  escreveu:
>
> This probably explains why you get no USB log.  How could you?  It is 
> configured to go to the console (i.e., /dev/console) but there is no console 
> device.Sent from my Galaxy
>  Original message ----From: Flavio Castro Alves Filho 
>  Date: 1/17/21  3:50 PM  (GMT-06:00) To: 
> dev@nuttx.apache.org Subject: Re: Problem with USB CDC initialization on 
> board based on STM32F4DISCO Em dom, 17 de jan de 2021 13:52, Gregory Nutt 
> escreveu:> I don't think that this combination will 
> work:>> CONFIG_CDCACM_CONSOLE=y> CONFIG_CONSOLE_SYSLOG=y>> I think that the 
> syslog console device would have to be available at> bootup. Normally a RAM 
> log is is used to hold syslog data if a USB> console is used.>In my case, I 
> am following the implementation from discovery board, wheresyslog is pointing 
> to the uart and console on the USB.I will review if it was done 
> correctly.Thank you for your remark.Best regardsFlavio> I might be wrong 
> about that and this should not prevent the USB device> connecting.>> On 
> 1/17/2021 9:10 AM, Flavio Castro Alves Filho wrote:> > Thank you very much 
> for your fast response.> >> > I checked the boot calls and they are the same, 
> regarding USB> initialization.> >> > I compared the include/nuttx/config.h 
> files too ... at least regarding> > USB, I couldn't see anything critical.> 
> >> > The development approach that I am working was exactly starting with> > 
> stm32discovery board and increasing features. Maybe I have to restart,> > 
> checking first the USB.> >> > Best regards,> >> > Flavio> >> > Em dom., 17 de 
> jan. de 2021 às 11:39, Grr  escreveu:> >> What you can do 
> is compare .config generated from that defconfig to> .config> >> generated 
> from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see> >> the 
> differences. You can also compare include/nuttx/config.h from both> >> 
> configs> >>> >> Another approach is to start from discovery config and do 
> the> modifications> >> for your board. After you have it working, clone the 
> config to a> different> >> board name. With "make savedefconfig" you can save 
> your working> defconfig> >>> >> El dom, 17 ene 2021 a las 7:51, Flavio Castro 
> Alves Filho (<> >> flavio.al...@gmail.com>) escribió:> >>> >>> As an 
> additional information, if I load the STM32F4DISCO on my board,> USB> >>> 
> works.> >>>> >>> Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves 
> Filho> >>>  escreveu:> >>>> Hello,> >>>>> >>>> I am 
> working to port NuttX on a board based on STM32F4DISCOVERY. The> >>>> 
> microcontroller is the STM32F407VET6.> >>>>> >>>> USB CDC support is not 
> initializing.> >>>>> >>>> When I plug the USB on the board, I have the 
> following dmesg response> in> >>> Linux:> >>>> [517062.075048] usb 
> usb1-port2: attempt power cycle> >>>> [517062.726922] usb 1-2: new full-speed 
> USB device number 47 using> >>> xhci_hcd> >>>> [517062.727170] usb 1-2: 
> Device not responding to setup address.> >>>> [517062.935148] usb 1-2: Device 
> not responding to setup address.> >>>> [517063.142906] usb 1-2: device not 
> accepting address 47, error -71> >>>> [517063.270916] usb 1-2: new full-speed 
> USB device number 48 using> >>> xhci_hcd> >>>> [517063.271141] usb 1-2: 
> Device not responding to setup address.> >>>> [517063.479134] usb 1-2: Device 
> not responding to setup address.> >>>>> >>>> When I run 
> stm32f4discovery:usbnsh on my discovery board, it works.> >>>>> >>>> I 
> compared the defconfig from the base project and from mine and I> >>>> 
> believe I have initialized everything that is related to the USB.> >>>>> >>>> 
> Here is the defconfig for my board:> >>>>> >>>> #> >>>> # This file is 
> autogenerated: PLEASE DO NOT EDIT IT.> >>>> #> >>>> # You can use &qu

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

2021-01-17 Thread Flavio Castro Alves Filho
What I realized is that there is no USB log message showing.

I checked the options on USB monitor to show initialization messages but
got no messages. :-(

Best regards,

Flavio

Em dom, 17 de jan de 2021 14:08, Alan Carvalho de Assis 
escreveu:

> Hi Flávio,
>
> Other file to compare is the System.map, it will give you some hints
> about which functions are missing in your board. Then you can
> investigate why the function is missing.
>
> Maybe it is just an #ifdef that is not entering because you forgot the
> rename the board's name.
>
> Try to do it and let's us know if you see some difference.
>
> BR,
>
> Alan
>
> On 1/17/21, Flavio Castro Alves Filho  wrote:
> > Thank you very much for your fast response.
> >
> > I checked the boot calls and they are the same, regarding USB
> > initialization.
> >
> > I compared the include/nuttx/config.h files too ... at least regarding
> > USB, I couldn't see anything critical.
> >
> > The development approach that I am working was exactly starting with
> > stm32discovery board and increasing features. Maybe I have to restart,
> > checking first the USB.
> >
> > Best regards,
> >
> > Flavio
> >
> > Em dom., 17 de jan. de 2021 às 11:39, Grr  escreveu:
> >>
> >> What you can do is compare .config generated from that defconfig to
> >> .config
> >> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
> >> the differences. You can also compare include/nuttx/config.h from both
> >> configs
> >>
> >> Another approach is to start from discovery config and do the
> >> modifications
> >> for your board. After you have it working, clone the config to a
> >> different
> >> board name. With "make savedefconfig" you can save your working
> defconfig
> >>
> >> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
> >> flavio.al...@gmail.com>) escribió:
> >>
> >> > As an additional information, if I load the STM32F4DISCO on my board,
> >> > USB
> >> > works.
> >> >
> >> > Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
> >> >  escreveu:
> >> > >
> >> > > Hello,
> >> > >
> >> > > I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> >> > > microcontroller is the STM32F407VET6.
> >> > >
> >> > > USB CDC support is not initializing.
> >> > >
> >> > > When I plug the USB on the board, I have the following dmesg
> response
> >> > > in
> >> > Linux:
> >> > >
> >> > > [517062.075048] usb usb1-port2: attempt power cycle
> >> > > [517062.726922] usb 1-2: new full-speed USB device number 47 using
> >> > xhci_hcd
> >> > > [517062.727170] usb 1-2: Device not responding to setup address.
> >> > > [517062.935148] usb 1-2: Device not responding to setup address.
> >> > > [517063.142906] usb 1-2: device not accepting address 47, error -71
> >> > > [517063.270916] usb 1-2: new full-speed USB device number 48 using
> >> > xhci_hcd
> >> > > [517063.271141] usb 1-2: Device not responding to setup address.
> >> > > [517063.479134] usb 1-2: Device not responding to setup address.
> >> > >
> >> > > When I run stm32f4discovery:usbnsh on my discovery board, it works.
> >> > >
> >> > > I compared the defconfig from the base project and from mine and I
> >> > > believe I have initialized everything that is related to the USB.
> >> > >
> >> > > Here is the defconfig for my board:
> >> > >
> >> > > #
> >> > > # This file is autogenerated: PLEASE DO NOT EDIT IT.
> >> > > #
> >> > > # You can use "make menuconfig" to make any modifications to the
> >> > > installed .config file.
> >> > > # You can then do "make savedefconfig" to generate a new defconfig
> >> > > file that includes your
> >> > > # modifications.
> >> > > #
> >> > > # CONFIG_ARCH_FPU is not set
> >> > > # CONFIG_MMCSD_MMCSUPPORT is not set
> >> > > # CONFIG_MMCSD_SPI is not set
> >> > > # CONFIG_NSH_ARGCAT is not set
> >> > > # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> >> > > # CONFIG_NSH_CMD

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

2021-01-17 Thread Flavio Castro Alves Filho
Thank you very much for your fast response.

I checked the boot calls and they are the same, regarding USB initialization.

I compared the include/nuttx/config.h files too ... at least regarding
USB, I couldn't see anything critical.

The development approach that I am working was exactly starting with
stm32discovery board and increasing features. Maybe I have to restart,
checking first the USB.

Best regards,

Flavio

Em dom., 17 de jan. de 2021 às 11:39, Grr  escreveu:
>
> What you can do is compare .config generated from that defconfig to .config
> generated from "./tools/configure.sh -l stm32f4discovery:usbnsh" and see
> the differences. You can also compare include/nuttx/config.h from both
> configs
>
> Another approach is to start from discovery config and do the modifications
> for your board. After you have it working, clone the config to a different
> board name. With "make savedefconfig" you can save your working defconfig
>
> El dom, 17 ene 2021 a las 7:51, Flavio Castro Alves Filho (<
> flavio.al...@gmail.com>) escribió:
>
> > As an additional information, if I load the STM32F4DISCO on my board, USB
> > works.
> >
> > Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
> >  escreveu:
> > >
> > > Hello,
> > >
> > > I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> > > microcontroller is the STM32F407VET6.
> > >
> > > USB CDC support is not initializing.
> > >
> > > When I plug the USB on the board, I have the following dmesg response in
> > Linux:
> > >
> > > [517062.075048] usb usb1-port2: attempt power cycle
> > > [517062.726922] usb 1-2: new full-speed USB device number 47 using
> > xhci_hcd
> > > [517062.727170] usb 1-2: Device not responding to setup address.
> > > [517062.935148] usb 1-2: Device not responding to setup address.
> > > [517063.142906] usb 1-2: device not accepting address 47, error -71
> > > [517063.270916] usb 1-2: new full-speed USB device number 48 using
> > xhci_hcd
> > > [517063.271141] usb 1-2: Device not responding to setup address.
> > > [517063.479134] usb 1-2: Device not responding to setup address.
> > >
> > > When I run stm32f4discovery:usbnsh on my discovery board, it works.
> > >
> > > I compared the defconfig from the base project and from mine and I
> > > believe I have initialized everything that is related to the USB.
> > >
> > > Here is the defconfig for my board:
> > >
> > > #
> > > # This file is autogenerated: PLEASE DO NOT EDIT IT.
> > > #
> > > # You can use "make menuconfig" to make any modifications to the
> > > installed .config file.
> > > # You can then do "make savedefconfig" to generate a new defconfig
> > > file that includes your
> > > # modifications.
> > > #
> > > # CONFIG_ARCH_FPU is not set
> > > # CONFIG_MMCSD_MMCSUPPORT is not set
> > > # CONFIG_MMCSD_SPI is not set
> > > # CONFIG_NSH_ARGCAT is not set
> > > # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> > > # CONFIG_NSH_CMDPARMS is not set
> > > CONFIG_ADC=y
> > > CONFIG_ANALOG=y
> > > CONFIG_ARCH="arm"
> > > CONFIG_ARCH_BOARD="phi-innovations"
> > > CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> > > CONFIG_ARCH_CHIP="stm32"
> > > CONFIG_ARCH_CHIP_STM32=y
> > > CONFIG_ARCH_CHIP_STM32F407VG=y
> > > CONFIG_ARCH_STACKDUMP=y
> > > CONFIG_ARMV7M_MEMCPY=y
> > > CONFIG_BOARDCTL_RESET=y
> > > CONFIG_BOARDCTL_UNIQUEID=y
> > > CONFIG_BOARDCTL_USBDEVCTRL=y
> > > CONFIG_BOARD_LOOPSPERMSEC=16717
> > > CONFIG_BUILTIN=y
> > > CONFIG_CDCACM=y
> > > CONFIG_CDCACM_CONSOLE=y
> > > CONFIG_CDCACM_RXBUFSIZE=256
> > > CONFIG_CDCACM_TXBUFSIZE=256
> > > CONFIG_CLOCK_MONOTONIC=y
> > > CONFIG_CONSOLE_SYSLOG=y
> > > CONFIG_DEBUG_ASSERTIONS=y
> > > CONFIG_DEBUG_DMA=y
> > > CONFIG_DEBUG_DMA_ERROR=y
> > > CONFIG_DEBUG_DMA_INFO=y
> > > CONFIG_DEBUG_DMA_WARN=y
> > > CONFIG_DEBUG_ERROR=y
> > > CONFIG_DEBUG_FEATURES=y
> > > CONFIG_DEBUG_FS=y
> > > CONFIG_DEBUG_FS_ERROR=y
> > > CONFIG_DEBUG_FS_WARN=y
> > > CONFIG_DEBUG_FULLOPT=y
> > > CONFIG_DEBUG_HARDFAULT_ALERT=y
> > > CONFIG_DEBUG_INFO=y
> > > CONFIG_DEBUG_NET=y
> > > CONFIG_DEBUG_NET_ERROR=y
> > > CONFIG_DEBUG_NET_INFO=y
> > > CONFIG_DEBUG_NET_WARN=y
> >

Re: Problem with USB CDC initialization on board based on STM32F4DISCO

2021-01-17 Thread Flavio Castro Alves Filho
As an additional information, if I load the STM32F4DISCO on my board, USB works.

Em dom., 17 de jan. de 2021 às 10:43, Flavio Castro Alves Filho
 escreveu:
>
> Hello,
>
> I am working to port NuttX on a board based on STM32F4DISCOVERY. The
> microcontroller is the STM32F407VET6.
>
> USB CDC support is not initializing.
>
> When I plug the USB on the board, I have the following dmesg response in 
> Linux:
>
> [517062.075048] usb usb1-port2: attempt power cycle
> [517062.726922] usb 1-2: new full-speed USB device number 47 using xhci_hcd
> [517062.727170] usb 1-2: Device not responding to setup address.
> [517062.935148] usb 1-2: Device not responding to setup address.
> [517063.142906] usb 1-2: device not accepting address 47, error -71
> [517063.270916] usb 1-2: new full-speed USB device number 48 using xhci_hcd
> [517063.271141] usb 1-2: Device not responding to setup address.
> [517063.479134] usb 1-2: Device not responding to setup address.
>
> When I run stm32f4discovery:usbnsh on my discovery board, it works.
>
> I compared the defconfig from the base project and from mine and I
> believe I have initialized everything that is related to the USB.
>
> Here is the defconfig for my board:
>
> #
> # This file is autogenerated: PLEASE DO NOT EDIT IT.
> #
> # You can use "make menuconfig" to make any modifications to the
> installed .config file.
> # You can then do "make savedefconfig" to generate a new defconfig
> file that includes your
> # modifications.
> #
> # CONFIG_ARCH_FPU is not set
> # CONFIG_MMCSD_MMCSUPPORT is not set
> # CONFIG_MMCSD_SPI is not set
> # CONFIG_NSH_ARGCAT is not set
> # CONFIG_NSH_CMDOPT_HEXDUMP is not set
> # CONFIG_NSH_CMDPARMS is not set
> CONFIG_ADC=y
> CONFIG_ANALOG=y
> CONFIG_ARCH="arm"
> CONFIG_ARCH_BOARD="phi-innovations"
> CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
> CONFIG_ARCH_CHIP="stm32"
> CONFIG_ARCH_CHIP_STM32=y
> CONFIG_ARCH_CHIP_STM32F407VG=y
> CONFIG_ARCH_STACKDUMP=y
> CONFIG_ARMV7M_MEMCPY=y
> CONFIG_BOARDCTL_RESET=y
> CONFIG_BOARDCTL_UNIQUEID=y
> CONFIG_BOARDCTL_USBDEVCTRL=y
> CONFIG_BOARD_LOOPSPERMSEC=16717
> CONFIG_BUILTIN=y
> CONFIG_CDCACM=y
> CONFIG_CDCACM_CONSOLE=y
> CONFIG_CDCACM_RXBUFSIZE=256
> CONFIG_CDCACM_TXBUFSIZE=256
> CONFIG_CLOCK_MONOTONIC=y
> CONFIG_CONSOLE_SYSLOG=y
> CONFIG_DEBUG_ASSERTIONS=y
> CONFIG_DEBUG_DMA=y
> CONFIG_DEBUG_DMA_ERROR=y
> CONFIG_DEBUG_DMA_INFO=y
> CONFIG_DEBUG_DMA_WARN=y
> CONFIG_DEBUG_ERROR=y
> CONFIG_DEBUG_FEATURES=y
> CONFIG_DEBUG_FS=y
> CONFIG_DEBUG_FS_ERROR=y
> CONFIG_DEBUG_FS_WARN=y
> CONFIG_DEBUG_FULLOPT=y
> CONFIG_DEBUG_HARDFAULT_ALERT=y
> CONFIG_DEBUG_INFO=y
> CONFIG_DEBUG_NET=y
> CONFIG_DEBUG_NET_ERROR=y
> CONFIG_DEBUG_NET_INFO=y
> CONFIG_DEBUG_NET_WARN=y
> CONFIG_DEBUG_RTC=y
> CONFIG_DEBUG_RTC_ERROR=y
> CONFIG_DEBUG_RTC_INFO=y
> CONFIG_DEBUG_RTC_WARN=y
> CONFIG_DEBUG_SYMBOLS=y
> CONFIG_DEBUG_WARN=y
> CONFIG_DEV_GPIO=y
> CONFIG_ETH0_PHY_LAN8742A=y
> CONFIG_EXAMPLES_PPPD=y
> CONFIG_FAT_LCNAMES=y
> CONFIG_FAT_LFN=y
> CONFIG_FS_FAT=y
> CONFIG_FS_PROCFS=y
> CONFIG_FS_SMARTFS=y
> CONFIG_HAVE_CXX=y
> CONFIG_HAVE_CXXINITIALIZE=y
> CONFIG_HEAP_COLORATION=y
> CONFIG_IDLETHREAD_STACKSIZE=2048
> CONFIG_INTELHEX_BINARY=y
> CONFIG_IOEXPANDER=y
> CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
> CONFIG_MAX_TASKS=16
> CONFIG_MMCSD=y
> CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
> CONFIG_MMCSD_SDIO=y
> CONFIG_MTD=y
> CONFIG_MTD_MX25L=y
> CONFIG_MTD_SMART=y
> CONFIG_MTD_SMART_FSCK=y
> CONFIG_MX25L_SPIFREQUENCY=2100
> CONFIG_NET=y
> CONFIG_NETDB_DNSCLIENT=y
> CONFIG_NETINIT_DEBUG=y
> CONFIG_NETINIT_DHCPC=y
> CONFIG_NETINIT_DNS=y
> CONFIG_NETINIT_DNSIPADDR=0x08080808
> CONFIG_NETINIT_DRIPADDR=0x0a010101
> CONFIG_NETINIT_NOMAC=y
> CONFIG_NETINIT_THREAD=y
> CONFIG_NETUTILS_DHCPC=y
> CONFIG_NETUTILS_NETCAT=y
> CONFIG_NETUTILS_PPPD_PAP=y
> CONFIG_NET_ARP_DUMP=y
> CONFIG_NET_ARP_SEND=y
> CONFIG_NET_BROADCAST=y
> CONFIG_NET_ETH_PKTSIZE=1294
> CONFIG_NET_ICMP=y
> CONFIG_NET_ICMP_SOCKET=y
> CONFIG_NET_SOCKOPTS=y
> CONFIG_NET_SOLINGER=y
> CONFIG_NET_STATISTICS=y
> CONFIG_NET_TCP=y
> CONFIG_NET_TCPBACKLOG=y
> CONFIG_NET_TCPURGDATA=y
> CONFIG_NET_TCP_KEEPALIVE=y
> CONFIG_NET_TCP_WRITE_BUFFERS=y
> CONFIG_NET_UDP=y
> CONFIG_NET_UDP_CHECKSUMS=y
> CONFIG_NFILE_DESCRIPTORS=8
> CONFIG_NSH_ARCHINIT=y
> CONFIG_NSH_BUILTIN_APPS=y
> CONFIG_NSH_DISABLE_LOSMART=y
> CONFIG_NSH_FILEIOSIZE=512
> CONFIG_NSH_LINELEN=64
> CONFIG_NSH_PROMPT_STRING="nsh$ "
> CONFIG_NSH_READLINE=y
> CONFIG_PREALLOC_TIMERS=4
> CONFIG_RAM_SIZE=114688
> CONFIG_RAM_START=0x2000

Problem with USB CDC initialization on board based on STM32F4DISCO

2021-01-17 Thread Flavio Castro Alves Filho
Hello,

I am working to port NuttX on a board based on STM32F4DISCOVERY. The
microcontroller is the STM32F407VET6.

USB CDC support is not initializing.

When I plug the USB on the board, I have the following dmesg response in Linux:

[517062.075048] usb usb1-port2: attempt power cycle
[517062.726922] usb 1-2: new full-speed USB device number 47 using xhci_hcd
[517062.727170] usb 1-2: Device not responding to setup address.
[517062.935148] usb 1-2: Device not responding to setup address.
[517063.142906] usb 1-2: device not accepting address 47, error -71
[517063.270916] usb 1-2: new full-speed USB device number 48 using xhci_hcd
[517063.271141] usb 1-2: Device not responding to setup address.
[517063.479134] usb 1-2: Device not responding to setup address.

When I run stm32f4discovery:usbnsh on my discovery board, it works.

I compared the defconfig from the base project and from mine and I
believe I have initialized everything that is related to the USB.

Here is the defconfig for my board:

#
# This file is autogenerated: PLEASE DO NOT EDIT IT.
#
# You can use "make menuconfig" to make any modifications to the
installed .config file.
# You can then do "make savedefconfig" to generate a new defconfig
file that includes your
# modifications.
#
# CONFIG_ARCH_FPU is not set
# CONFIG_MMCSD_MMCSUPPORT is not set
# CONFIG_MMCSD_SPI is not set
# CONFIG_NSH_ARGCAT is not set
# CONFIG_NSH_CMDOPT_HEXDUMP is not set
# CONFIG_NSH_CMDPARMS is not set
CONFIG_ADC=y
CONFIG_ANALOG=y
CONFIG_ARCH="arm"
CONFIG_ARCH_BOARD="phi-innovations"
CONFIG_ARCH_BOARD_STM32F4_PHI_IOT_GATEWAY=y
CONFIG_ARCH_CHIP="stm32"
CONFIG_ARCH_CHIP_STM32=y
CONFIG_ARCH_CHIP_STM32F407VG=y
CONFIG_ARCH_STACKDUMP=y
CONFIG_ARMV7M_MEMCPY=y
CONFIG_BOARDCTL_RESET=y
CONFIG_BOARDCTL_UNIQUEID=y
CONFIG_BOARDCTL_USBDEVCTRL=y
CONFIG_BOARD_LOOPSPERMSEC=16717
CONFIG_BUILTIN=y
CONFIG_CDCACM=y
CONFIG_CDCACM_CONSOLE=y
CONFIG_CDCACM_RXBUFSIZE=256
CONFIG_CDCACM_TXBUFSIZE=256
CONFIG_CLOCK_MONOTONIC=y
CONFIG_CONSOLE_SYSLOG=y
CONFIG_DEBUG_ASSERTIONS=y
CONFIG_DEBUG_DMA=y
CONFIG_DEBUG_DMA_ERROR=y
CONFIG_DEBUG_DMA_INFO=y
CONFIG_DEBUG_DMA_WARN=y
CONFIG_DEBUG_ERROR=y
CONFIG_DEBUG_FEATURES=y
CONFIG_DEBUG_FS=y
CONFIG_DEBUG_FS_ERROR=y
CONFIG_DEBUG_FS_WARN=y
CONFIG_DEBUG_FULLOPT=y
CONFIG_DEBUG_HARDFAULT_ALERT=y
CONFIG_DEBUG_INFO=y
CONFIG_DEBUG_NET=y
CONFIG_DEBUG_NET_ERROR=y
CONFIG_DEBUG_NET_INFO=y
CONFIG_DEBUG_NET_WARN=y
CONFIG_DEBUG_RTC=y
CONFIG_DEBUG_RTC_ERROR=y
CONFIG_DEBUG_RTC_INFO=y
CONFIG_DEBUG_RTC_WARN=y
CONFIG_DEBUG_SYMBOLS=y
CONFIG_DEBUG_WARN=y
CONFIG_DEV_GPIO=y
CONFIG_ETH0_PHY_LAN8742A=y
CONFIG_EXAMPLES_PPPD=y
CONFIG_FAT_LCNAMES=y
CONFIG_FAT_LFN=y
CONFIG_FS_FAT=y
CONFIG_FS_PROCFS=y
CONFIG_FS_SMARTFS=y
CONFIG_HAVE_CXX=y
CONFIG_HAVE_CXXINITIALIZE=y
CONFIG_HEAP_COLORATION=y
CONFIG_IDLETHREAD_STACKSIZE=2048
CONFIG_INTELHEX_BINARY=y
CONFIG_IOEXPANDER=y
CONFIG_LIB_HOSTNAME="STM32F4-Discovery"
CONFIG_MAX_TASKS=16
CONFIG_MMCSD=y
CONFIG_MMCSD_MULTIBLOCK_DISABLE=y
CONFIG_MMCSD_SDIO=y
CONFIG_MTD=y
CONFIG_MTD_MX25L=y
CONFIG_MTD_SMART=y
CONFIG_MTD_SMART_FSCK=y
CONFIG_MX25L_SPIFREQUENCY=2100
CONFIG_NET=y
CONFIG_NETDB_DNSCLIENT=y
CONFIG_NETINIT_DEBUG=y
CONFIG_NETINIT_DHCPC=y
CONFIG_NETINIT_DNS=y
CONFIG_NETINIT_DNSIPADDR=0x08080808
CONFIG_NETINIT_DRIPADDR=0x0a010101
CONFIG_NETINIT_NOMAC=y
CONFIG_NETINIT_THREAD=y
CONFIG_NETUTILS_DHCPC=y
CONFIG_NETUTILS_NETCAT=y
CONFIG_NETUTILS_PPPD_PAP=y
CONFIG_NET_ARP_DUMP=y
CONFIG_NET_ARP_SEND=y
CONFIG_NET_BROADCAST=y
CONFIG_NET_ETH_PKTSIZE=1294
CONFIG_NET_ICMP=y
CONFIG_NET_ICMP_SOCKET=y
CONFIG_NET_SOCKOPTS=y
CONFIG_NET_SOLINGER=y
CONFIG_NET_STATISTICS=y
CONFIG_NET_TCP=y
CONFIG_NET_TCPBACKLOG=y
CONFIG_NET_TCPURGDATA=y
CONFIG_NET_TCP_KEEPALIVE=y
CONFIG_NET_TCP_WRITE_BUFFERS=y
CONFIG_NET_UDP=y
CONFIG_NET_UDP_CHECKSUMS=y
CONFIG_NFILE_DESCRIPTORS=8
CONFIG_NSH_ARCHINIT=y
CONFIG_NSH_BUILTIN_APPS=y
CONFIG_NSH_DISABLE_LOSMART=y
CONFIG_NSH_FILEIOSIZE=512
CONFIG_NSH_LINELEN=64
CONFIG_NSH_PROMPT_STRING="nsh$ "
CONFIG_NSH_READLINE=y
CONFIG_PREALLOC_TIMERS=4
CONFIG_RAM_SIZE=114688
CONFIG_RAM_START=0x2000
CONFIG_RAW_BINARY=y
CONFIG_RR_INTERVAL=200
CONFIG_RTC=y
CONFIG_RTC_EXTERNAL=y
CONFIG_RTC_PCF8563=y
CONFIG_SCHED_HPWORK=y
CONFIG_SCHED_HPWORKPRIORITY=192
CONFIG_SCHED_WAITPID=y
CONFIG_SDCLONE_DISABLE=y
CONFIG_STACK_COLORATION=y
CONFIG_START_DAY=13
CONFIG_START_MONTH=9
CONFIG_START_YEAR=2014
CONFIG_STM32F4DISBB=y
CONFIG_STM32_ADC1=y
CONFIG_STM32_DMA1=y
CONFIG_STM32_DMA2=y
CONFIG_STM32_DMACAPABLE=y
CONFIG_STM32_ETHMAC=y
CONFIG_STM32_I2C1=y
CONFIG_STM32_JTAG_SW_ENABLE=y
CONFIG_STM32_OTGFS=y
CONFIG_STM32_PHYADDR=0
CONFIG_STM32_PHYSR=31
CONFIG_STM32_PHYSR_100FD=0x0018
CONFIG_STM32_PHYSR_100HD=0x0008
CONFIG_STM32_PHYSR_10FD=0x0014
CONFIG_STM32_PHYSR_10HD=0x0004
CONFIG_STM32_PHYSR_ALTCONFIG=y
CONFIG_STM32_PHYSR_ALTMODE=0x001c
CONFIG_STM32_PWR=y
CONFIG_STM32_RMII_EXTCLK=y
CONFIG_STM32_SDIO=y
CONFIG_STM32_SPI1=y
CONFIG_STM32_USART1=y
CONFIG_STM32_USART2=y
CONFIG_STM32_USART3=y
CONFIG_STM32_USART6=y
CONFIG_SYSTEM_NSH=y
CONFIG_SYSTEM_PING=y
CONFIG_USART2_IFLOWCONTROL=y

Re: Build environment using cmake, c++ and NuttX as a library

2021-01-10 Thread Flavio Castro Alves Filho
Hello Matt,

I'm sorry for the long delay. I'm still trying to find a way to work
more time with Nuttx.

Here the link for my cmake base hellocpp for Nuttx:

https://github.com/Phi-Innovations/nuttx-apps/tree/main/hellocpp

Hope it is still useful for you.

Best regards,

Flavio


Em sáb., 12 de dez. de 2020 às 20:55, Matt DeWall  escreveu:
>
> Hi Flavio,
>
> I'm looking to do something similar and have been putting the cmake stuff
> on the back-burner.
>
> Is your cmake config something you'd be willing to share?  No problem if
> not, just looking to save some headaches on my end.  Thanks!
>
> Matt
>
> On Fri, Dec 11, 2020 at 10:07 AM Flavio Castro Alves Filho <
> flavio.al...@gmail.com> wrote:
>
> > Hello Marc,
> >
> > Thank you for your response.
> >
> > In fact, it was a little more than that: I didn't set the library
> > group in cmake and also didn't set the correct linker.
> >
> > Solving these issues, I could have it working and running.
> >
> > Thank you very much.
> >
> > Best regards,
> >
> > Flavio
> >
> >
> >
> > Em sex., 11 de dez. de 2020 às 09:31, Marc Rosen
> >  escreveu:
> > >
> > > Hi Flavio,
> > >
> > > well I think there are two problems:
> > >
> > > 1. it seems either you are missing libarch.a or you have a library order
> > > problem.
> > > Because ld can not find up_exit etc. those are arch specific functions.
> > >
> > > 2. I would recommend you to add the flag -nostdlib. At least it is going
> > > to avoid newlib symbol problems.
> > >
> > > regards,
> > > marc
> > > Am 11.12.2020 um 13:07 schrieb Flavio Castro Alves Filho:
> > > > Hello,
> > > >
> > > > Has anybody here used NuttX as a library and a C++ project with cmake?
> > > >
> > > > I tried to create a project (using hellocxx example) with this setup,
> > > > but I was not successful. I can build, but I cannot link.
> > > >
> > > > My link errors are the following:
> > > >
> > > > [ 33%] Linking CXX executable hellocpp
> > > >
> > > >
> > > > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > > >
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v7e-m/nofp/crt0.o:
> > > > in function `_mainCRTStartup':
> > > >
> > /build/newlib-CVVEyx/newlib-3.3.0/build/arm-none-eabi/thumb/v7e-m/nofp/libgloss/arm/semihv2m/../../../../../../../../libgloss/arm/crt0.S:545:
> > > > undefined reference to `main'
> > > > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > > >
> > /home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(exit.o):
> > > > in function `_exit':
> > > > /home/ubuntu/Documents/nuttx/nuttx/sched/task/exit.c:56: undefined
> > > > reference to `up_exit'
> > > >
> > > > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > > > /home/ubuntu/Documents/nuttx/nuttx/sched/task/exit.c:56: undefined
> > > > reference to `up_exit'
> > > >/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > > >
> > /home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(nx_start.o):
> > > > in function `nx_start':
> > > > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:537:
> > > > undefined reference to `up_initial_state'
> > > >
> > > >  /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > > > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:566:
> > > > undefined reference to `up_allocate_heap'
> > > > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > > > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:567:
> > > > undefined reference to `umm_initialize'
> > > > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > > > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:598:
> > > > undefined reference to `iob_initialize'
> > > > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > > > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:618:
> > > > undefined reference to `fs_initialize'
> > > > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > > > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:701:
> > > > undefined reference

Re: Build environment using cmake, c++ and NuttX as a library

2020-12-11 Thread Flavio Castro Alves Filho
Hello Marc,

Thank you for your response.

In fact, it was a little more than that: I didn't set the library
group in cmake and also didn't set the correct linker.

Solving these issues, I could have it working and running.

Thank you very much.

Best regards,

Flavio



Em sex., 11 de dez. de 2020 às 09:31, Marc Rosen
 escreveu:
>
> Hi Flavio,
>
> well I think there are two problems:
>
> 1. it seems either you are missing libarch.a or you have a library order
> problem.
> Because ld can not find up_exit etc. those are arch specific functions.
>
> 2. I would recommend you to add the flag -nostdlib. At least it is going
> to avoid newlib symbol problems.
>
> regards,
> marc
> Am 11.12.2020 um 13:07 schrieb Flavio Castro Alves Filho:
> > Hello,
> >
> > Has anybody here used NuttX as a library and a C++ project with cmake?
> >
> > I tried to create a project (using hellocxx example) with this setup,
> > but I was not successful. I can build, but I cannot link.
> >
> > My link errors are the following:
> >
> > [ 33%] Linking CXX executable hellocpp
> >
> >
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v7e-m/nofp/crt0.o:
> > in function `_mainCRTStartup':
> > /build/newlib-CVVEyx/newlib-3.3.0/build/arm-none-eabi/thumb/v7e-m/nofp/libgloss/arm/semihv2m/../../../../../../../../libgloss/arm/crt0.S:545:
> > undefined reference to `main'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(exit.o):
> > in function `_exit':
> > /home/ubuntu/Documents/nuttx/nuttx/sched/task/exit.c:56: undefined
> > reference to `up_exit'
> >
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/nuttx/sched/task/exit.c:56: undefined
> > reference to `up_exit'
> >/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(nx_start.o):
> > in function `nx_start':
> > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:537:
> > undefined reference to `up_initial_state'
> >
> >  /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:566:
> > undefined reference to `up_allocate_heap'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:567:
> > undefined reference to `umm_initialize'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:598:
> > undefined reference to `iob_initialize'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:618:
> > undefined reference to `fs_initialize'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:701:
> > undefined reference to `up_initialize'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:733:
> > undefined reference to `binfmt_initialize'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:785:
> > undefined reference to `syslog_initialize'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:832:
> > undefined reference to `up_idle'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(sched_lock.o):
> > in function `sched_lock':
> > /home/ubuntu/Documents/nuttx/nuttx/sched/sched/sched_lock.c:242:
> > undefined reference to `up_interrupt_context'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(sched_unlock.o):
> > in function `sched_unlock':
> > /home/ubuntu/Documents/nuttx/nuttx/sched/sched/sched_unlock.c:227:
> > undefined reference to `up_interrupt_context'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu/Documents/nuttx/nuttx/sched/sched/sched_unlock.c:273:
> > undefined reference to `up_release_pending'
> > /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
> > /home/ubuntu

Build environment using cmake, c++ and NuttX as a library

2020-12-11 Thread Flavio Castro Alves Filho
Hello,

Has anybody here used NuttX as a library and a C++ project with cmake?

I tried to create a project (using hellocxx example) with this setup,
but I was not successful. I can build, but I cannot link.

My link errors are the following:

[ 33%] Linking CXX executable hellocpp


/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/lib/thumb/v7e-m/nofp/crt0.o:
in function `_mainCRTStartup':
/build/newlib-CVVEyx/newlib-3.3.0/build/arm-none-eabi/thumb/v7e-m/nofp/libgloss/arm/semihv2m/../../../../../../../../libgloss/arm/crt0.S:545:
undefined reference to `main'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(exit.o):
in function `_exit':
/home/ubuntu/Documents/nuttx/nuttx/sched/task/exit.c:56: undefined
reference to `up_exit'

/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/task/exit.c:56: undefined
reference to `up_exit'
  /usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(nx_start.o):
in function `nx_start':
/home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:537:
undefined reference to `up_initial_state'

/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:566:
undefined reference to `up_allocate_heap'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:567:
undefined reference to `umm_initialize'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:598:
undefined reference to `iob_initialize'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:618:
undefined reference to `fs_initialize'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:701:
undefined reference to `up_initialize'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:733:
undefined reference to `binfmt_initialize'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:785:
undefined reference to `syslog_initialize'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/init/nx_start.c:832:
undefined reference to `up_idle'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(sched_lock.o):
in function `sched_lock':
/home/ubuntu/Documents/nuttx/nuttx/sched/sched/sched_lock.c:242:
undefined reference to `up_interrupt_context'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(sched_unlock.o):
in function `sched_unlock':
/home/ubuntu/Documents/nuttx/nuttx/sched/sched/sched_unlock.c:227:
undefined reference to `up_interrupt_context'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/sched/sched_unlock.c:273:
undefined reference to `up_release_pending'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(task_create.o):
in function `nxthread_create':
/home/ubuntu/Documents/nuttx/nuttx/sched/task/task_create.c:81:
undefined reference to `zalloc'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(task_init.o):
in function `nxtask_init':
/home/ubuntu/Documents/nuttx/nuttx/sched/task/task_init.c:115:
undefined reference to `up_use_stack'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/task/task_init.c:121:
undefined reference to `up_create_stack'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/task/task_init.c:174:
undefined reference to `up_release_stack'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(task_setup.o):
in function `nxthread_setup_scheduler':
/home/ubuntu/Documents/nuttx/nuttx/sched/task/task_setup.c:415:
undefined reference to `up_initial_state'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/nuttx/sched/task/task_setup.c:415:
undefined reference to `up_initial_state'
/usr/lib/gcc/arm-none-eabi/9.2.1/../../../arm-none-eabi/bin/ld:
/home/ubuntu/Documents/nuttx/hellocpp/nuttx-export-9.1.0/libs/libsched.a(task_setup.o):
in function `nxtask_setup_stackargs':

Re: Build problems - nuttx as an external library

2020-11-22 Thread Flavio Castro Alves Filho
Hello Alan,

It worked. Thank you very much.

An additional remark: during the link phase on your document, in my
case, it missed the net lib on the command line.

Best regards,

Flavio

Em seg., 16 de nov. de 2020 às 16:24, Alan Carvalho de Assis
 escreveu:
>
> Hi Flávio,
>
> A simple band-aid fix: add this typedef inside
> "arch/chip/stm32_gpio.h" just before it is called at
> stm32_gpiosetevent():
>
>  typedef CODE int (*xcpt_t)(int irq, FAR void *context, FAR void *arg);
>
> int stm32_gpiosetevent(uint32_t pinset, bool risingedge, bool fallingedge,
>bool event, xcpt_t func, void *arg);
>
> We need investigate which patch broke the "make export" and fix it.
>
> BR,
>
> Alan
>
> On 11/16/20, Flavio Castro Alves Filho  wrote:
> > Hello,
> >
> > I intend to build a nuttx application using the operating system as an
> > external library.
> >
> > I am working on a custom board running stm32f417 and I am following
> > the instructions from the following link:
> > https://acassis.wordpress.com/2020/06/28/using-nuttx-as-library-once-again/
> >
> > For the first compilation, I am having the following compilation error:
> >
> > ubuntu@pc-ubuntu:~/Documents/nuttx/hello/nuttx-export-9.1.0$
> > arm-none-eabi-gcc -c -fno-builtin -Wall -Wstrict-prototypes -Wshadow
> > -Wundef -g -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -I. -isystem
> > ./include   -pipe -I "./include" -I "./arch/chip" hello.c -o  hello.o
> > In file included from ./arch/chip/hardware/stm32f40xxx_pinmap.h:48:0,
> >  from ./arch/chip/hardware/stm32_pinmap.h:133,
> >  from ./arch/chip/chip.h:59,
> >  from ./include/arch/armv7-m/nvicpri.h:28,
> >  from ./include/arch/armv7-m/irq.h:37,
> >  from ./include/arch/irq.h:49,
> >  from ./include/nuttx/irq.h:53,
> >  from ./include/nuttx/sched.h:40,
> >  from ./include/sched.h:34,
> >  from ./include/stdio.h:48,
> >  from hello.c:1:
> > ./arch/chip/stm32_gpio.h:538:36: error: unknown type name 'xcpt_t'
> > bool event, xcpt_t func, void *arg);
> > ^~
> >
> > Could you give some advice on how to address this issue?
> >
> > Best regards,
> >
> > Flavio
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.al...@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Build problems - nuttx as an external library

2020-11-16 Thread Flavio Castro Alves Filho
Hello,

I intend to build a nuttx application using the operating system as an
external library.

I am working on a custom board running stm32f417 and I am following
the instructions from the following link:
https://acassis.wordpress.com/2020/06/28/using-nuttx-as-library-once-again/

For the first compilation, I am having the following compilation error:

ubuntu@pc-ubuntu:~/Documents/nuttx/hello/nuttx-export-9.1.0$
arm-none-eabi-gcc -c -fno-builtin -Wall -Wstrict-prototypes -Wshadow
-Wundef -g -mcpu=cortex-m4 -mthumb -mfloat-abi=soft -I. -isystem
./include   -pipe -I "./include" -I "./arch/chip" hello.c -o  hello.o
In file included from ./arch/chip/hardware/stm32f40xxx_pinmap.h:48:0,
 from ./arch/chip/hardware/stm32_pinmap.h:133,
 from ./arch/chip/chip.h:59,
 from ./include/arch/armv7-m/nvicpri.h:28,
 from ./include/arch/armv7-m/irq.h:37,
 from ./include/arch/irq.h:49,
 from ./include/nuttx/irq.h:53,
 from ./include/nuttx/sched.h:40,
 from ./include/sched.h:34,
 from ./include/stdio.h:48,
 from hello.c:1:
./arch/chip/stm32_gpio.h:538:36: error: unknown type name 'xcpt_t'
bool event, xcpt_t func, void *arg);
^~

Could you give some advice on how to address this issue?

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Nuttx for Nucleo-F429ZI

2020-09-23 Thread Flavio Castro Alves Filho
Hello Nathan,

Thank you for your return.

I found this procedure on another similar tutorial :-)

I could see the network interface up.

Best regards,

Flavio

Em seg., 21 de set. de 2020 às 13:34, Nathan Hartman
 escreveu:
>
> On Sat, Sep 19, 2020 at 7:36 AM Flavio Castro Alves Filho
>  wrote:
> > The problem that I am facing now is that is that the network interface
> > is not initializing:
> >
> > nsh> ifconfig
> > nsh: ifconfig: opendir failed: 20
>
> Need to mount procfs for ifconfig to work.
>
> nsh> mount -t procfs /proc
>
> Nathan



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Nuttx for Nucleo-F429ZI

2020-09-19 Thread Flavio Castro Alves Filho
Well,

I don't know how to explain, but I was reviewing here the process for
setup, writing down the commands that I used ... and now everything is
working fine. :-/

Maybe during yesterday's tests maybe something may be lost
during menuconfig.

I am sorry for the inconvenience.

But ... maybe I found my answer. I believe that the
nucleo-f429zi:netnsh is the configuration that I was looking for.

The problem that I am facing now is that is that the network interface
is not initializing:

nsh> ifconfig
nsh: ifconfig: opendir failed: 20

Best regards,,

Flavio


Em sex., 18 de set. de 2020 às 20:16, Brennan Ashton
 escreveu:

>
> On Fri, Sep 18, 2020 at 3:16 PM Flavio Castro Alves Filho
>  wrote:
> >
> > Hello Matias,
> >
> > Em sex., 18 de set. de 2020 às 16:26, Matias N.  escreveu:
> > >
> > > Hi Flavio,
> > > please have a look at our new documentation, which you may find helpful:
> > >
> > > https://nuttx.apache.org/docs/latest/
> > >
> >
> > I did ... that's how I found most of the problems to have this initial
> > version running.
> >
> > > Most boards have a "nsh" documentation which should be a good start (this
> > > is also explained in the documentation).
> > >
> >
> > ok. I will check this out.
> >
> > > I don't know the particular status of this board, but usually STM32 
> > > boards are
> > > well supported.
> > >
> >
> > Probably there is something with this board.
> >
> > > Best,
> > > Matias
> > >
> >
> > Thank you for your response.
> >
> > Best regards,
> >
> > Flavio
>
> Flavio,
> I do have the STM32F439ZI version which as far as NuttX is concerned
> should be the same.  I can give it a try this weekend, in the meantime
> if you could post your steps and where you got stuck in an issue, we
> can work through exactly what went wrong and fix the documentation.
>
> --Brennan



--
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Re: Nuttx for Nucleo-F429ZI

2020-09-18 Thread Flavio Castro Alves Filho
Hello Matias,

Em sex., 18 de set. de 2020 às 16:26, Matias N.  escreveu:
>
> Hi Flavio,
> please have a look at our new documentation, which you may find helpful:
>
> https://nuttx.apache.org/docs/latest/
>

I did ... that's how I found most of the problems to have this initial
version running.

> Most boards have a "nsh" documentation which should be a good start (this
> is also explained in the documentation).
>

ok. I will check this out.

> I don't know the particular status of this board, but usually STM32 boards are
> well supported.
>

Probably there is something with this board.

> Best,
> Matias
>

Thank you for your response.

Best regards,

Flavio

> On Fri, Sep 18, 2020, at 16:16, Flavio Castro Alves Filho wrote:
> > Hello,
> >
> > I am studying NuttX for a new project. I am using Nucleo-F429ZI as
> > reference, which is quite a complete board and has a large memory for
> > testing.
> >
> > I followed some instructions from the internet (mostly from NuttX
> > website) and I could compile and run a binary on the board. Including
> > executing a Hello Application located at the menuconfig.
> >
> > My question is if there is an initial configuration file (defconfig)
> > for this board that initializes the base features of the board.
> > Something similar to an initial configuration on the STM32CubeIDE new
> > project, where all the base peripherals (leds, buttons, ethernet, usb,
> > serial, ...) are previously initialized.
> >
> > In my first test here, serial was not enabled, compilation failed and
> > ls command in Nuttshell didn't work (only the call for the
> > application).
> >
> > Best regards,
> >
> > Flavio
> >
> > --
> > Flavio de Castro Alves Filho
> >
> > flavio.al...@gmail.com
> > Twitter: http://twitter.com/#!/fraviofii
> > LinkedIn profile: www.linkedin.com/in/flaviocastroalves
> >



-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves


Nuttx for Nucleo-F429ZI

2020-09-18 Thread Flavio Castro Alves Filho
Hello,

I am studying NuttX for a new project. I am using Nucleo-F429ZI as
reference, which is quite a complete board and has a large memory for
testing.

I followed some instructions from the internet (mostly from NuttX
website) and I could compile and run a binary on the board. Including
executing a Hello Application located at the menuconfig.

My question is if there is an initial configuration file (defconfig)
for this board that initializes the base features of the board.
Something similar to an initial configuration on the STM32CubeIDE new
project, where all the base peripherals (leds, buttons, ethernet, usb,
serial, ...) are previously initialized.

In my first test here, serial was not enabled, compilation failed and
ls command in Nuttshell didn't work (only the call for the
application).

Best regards,

Flavio

-- 
Flavio de Castro Alves Filho

flavio.al...@gmail.com
Twitter: http://twitter.com/#!/fraviofii
LinkedIn profile: www.linkedin.com/in/flaviocastroalves