Re: C++ Support

2023-06-25 Thread Mark Stevens
With the patch I am seeing the application exit, it is not excepting my main 
program loop.

Also, version is now listed as 10.4 not 12.1.

Re comment about LLVm - I’m just looking for something that works and at the 
moment uCLib++ and LLVm do not work in 12.1.

Regards,
Mark
_
Blog: blog.thepcsite.co.uk
Twitter: @nevynuk





> On 25 Jun 2023, at 08:50, Mark Stevens  wrote:
> 
> So a little more progress on this one.
> 
> Turning on C++ Exception support for the PicoW:nsh build configuration 
> generates errors:
> 
> CC:  pthread/pthread_testcancel.c machine/arm/gnu_unwind_find_exidx.c:32:8: 
> error: unknown type name '__EIT_entry'
>   32 | static __EIT_entry *__exidx_start_elf;
>  |^~~
> 
> Configuration is:
> 
> - C++ enabled
> - uCLib++ library
> - GNU low level support
> - Exceptions enabled.
> 
> Turning exceptions off gives me missing symbols, guess that is going to be a 
> missing library in the link phase.
> 
> Regards,
> Mark
> _
> Blog: blog.thepcsite.co.uk
> Twitter: @nevynuk
> 
> 
> 
> 
> 
>> On 24 Jun 2023, at 18:59, Mark Stevens  wrote:
>> 
>> I’m currently working on a home project with NuttX and my preferred language 
>> is really C++ for what I am doing.  I can work in C if necessary but I’d 
>> like to use some C++ features.
>> 
>> So far I have managed to get the framework of what is needed configured and 
>> the next step is to start some application implementation.  So I’m thinking 
>> core logic unit tested using the simulator and basic C++ application on the 
>> laptop.
>> 
>> So I have started a fairly basic test scenario and hit a problem with the 
>> C++ support in NuttX.
>> 
>> My application is going to be using some of the STL, at the moment I’m 
>> hitting issues with string and vector, two fairly basic and simple classes.  
>> I’m not getting any application to compile successfully.  I have tried:
>> 
>> - Basic C++ support
>> - LLVM with both the LLVM and GNU low level libraries
>> - uCLib++ with both LLVM and GNU libraries
>> 
>> I have tried this with both the sim:nsh and the raspberrypi-pico-w:nsh 
>> configurations.
>> 
>> The classes I am using are fairly basic so I could implement them myself, I 
>> would prefer to use a library version though.
>> 
>> Has anyone managed to use the C++ libraries with NuttX ?
>> 
>> Regards,
>> Mark
>> _
>> Blog: blog.thepcsite.co.uk
>> Twitter: @nevynuk
>> 
>> 
>> 
>> 
>> 
> 



Re: C++ Support

2023-06-25 Thread Mark Stevens
So figured out what the problem was with the patch - it compiles.

Just testing execution at the moment.


Regards,
Mark
__
mark.stev...@wildernesslabs.co




> On 25 Jun 2023, at 17:53, Mark Stevens  wrote:
> 
> So here is what I have run:
> 
> git checkout master
> git clean -dfx
> git reset —hard
> gh pr checkout 9610
> make distclean
> ./tools/configure.sh -l raspberrypi-pico-w:nsh
> make -j
> 
> So should just be a base configuration and this compiles OK.
> 
> I then reconfigured to system to add
> 
> C++
> uCLib++
> hellowxx
> Removed some applications and tests that I’m not interested in and add my 
> application.
> 
> make -j clean && make -j
> 
> And this results in:
> 
> Create version.h
> sed: 1: "/CONFIG_BASE_DEFCONFIG/ ...": bad flag in substitute command: '}'
> make: *** [include/nuttx/config.h] Error 1
> make: *** Waiting for unfinished jobs
> 
> Regards,
> Mark
> __
> mark.stev...@wildernesslabs.co
> 
> 
> 
> 
>> On 25 Jun 2023, at 11:39, Xiang Xiao  wrote:
>> 
>> Mark, could you try this patch:
>> https://github.com/apache/nuttx/pull/9610
>> 
>> On Sun, Jun 25, 2023 at 3:50 PM Mark Stevens  wrote:
>> 
>>> So a little more progress on this one.
>>> 
>>> Turning on C++ Exception support for the PicoW:nsh build configuration
>>> generates errors:
>>> 
>>> CC:  pthread/pthread_testcancel.c
>>> machine/arm/gnu_unwind_find_exidx.c:32:8: error: unknown type name
>>> '__EIT_entry'
>>>   32 | static __EIT_entry *__exidx_start_elf;
>>>  |^~~
>>> 
>>> Configuration is:
>>> 
>>> - C++ enabled
>>> - uCLib++ library
>>> - GNU low level support
>>> - Exceptions enabled.
>>> 
>>> Turning exceptions off gives me missing symbols, guess that is going to be
>>> a missing library in the link phase.
>>> 
>>> Regards,
>>> Mark
>>> _
>>> Blog: blog.thepcsite.co.uk
>>> Twitter: @nevynuk
>>> 
>>> 
>>> 
>>> 
>>> 
 On 24 Jun 2023, at 18:59, Mark Stevens  wrote:
 
 I’m currently working on a home project with NuttX and my preferred
>>> language is really C++ for what I am doing.  I can work in C if necessary
>>> but I’d like to use some C++ features.
 
 So far I have managed to get the framework of what is needed configured
>>> and the next step is to start some application implementation.  So I’m
>>> thinking core logic unit tested using the simulator and basic C++
>>> application on the laptop.
 
 So I have started a fairly basic test scenario and hit a problem with
>>> the C++ support in NuttX.
 
 My application is going to be using some of the STL, at the moment I’m
>>> hitting issues with string and vector, two fairly basic and simple
>>> classes.  I’m not getting any application to compile successfully.  I have
>>> tried:
 
 - Basic C++ support
 - LLVM with both the LLVM and GNU low level libraries
 - uCLib++ with both LLVM and GNU libraries
 
 I have tried this with both the sim:nsh and the raspberrypi-pico-w:nsh
>>> configurations.
 
 The classes I am using are fairly basic so I could implement them
>>> myself, I would prefer to use a library version though.
 
 Has anyone managed to use the C++ libraries with NuttX ?
 
 Regards,
 Mark
 _
 Blog: blog.thepcsite.co.uk
 Twitter: @nevynuk
 
 
 
 
 
>>> 
>>> 
> 



Re: C++ Support

2023-06-25 Thread Mark Stevens
So here is what I have run:

git checkout master
git clean -dfx
git reset —hard
gh pr checkout 9610
make distclean
./tools/configure.sh -l raspberrypi-pico-w:nsh
make -j

So should just be a base configuration and this compiles OK.

I then reconfigured to system to add

C++
uCLib++
hellowxx
Removed some applications and tests that I’m not interested in and add my 
application.

make -j clean && make -j

And this results in:

Create version.h
sed: 1: "/CONFIG_BASE_DEFCONFIG/ ...": bad flag in substitute command: '}'
make: *** [include/nuttx/config.h] Error 1
make: *** Waiting for unfinished jobs

Regards,
Mark
__
mark.stev...@wildernesslabs.co




> On 25 Jun 2023, at 11:39, Xiang Xiao  wrote:
> 
> Mark, could you try this patch:
> https://github.com/apache/nuttx/pull/9610
> 
> On Sun, Jun 25, 2023 at 3:50 PM Mark Stevens  wrote:
> 
>> So a little more progress on this one.
>> 
>> Turning on C++ Exception support for the PicoW:nsh build configuration
>> generates errors:
>> 
>> CC:  pthread/pthread_testcancel.c
>> machine/arm/gnu_unwind_find_exidx.c:32:8: error: unknown type name
>> '__EIT_entry'
>>   32 | static __EIT_entry *__exidx_start_elf;
>>  |^~~
>> 
>> Configuration is:
>> 
>> - C++ enabled
>> - uCLib++ library
>> - GNU low level support
>> - Exceptions enabled.
>> 
>> Turning exceptions off gives me missing symbols, guess that is going to be
>> a missing library in the link phase.
>> 
>> Regards,
>> Mark
>> _
>> Blog: blog.thepcsite.co.uk
>> Twitter: @nevynuk
>> 
>> 
>> 
>> 
>> 
>>> On 24 Jun 2023, at 18:59, Mark Stevens  wrote:
>>> 
>>> I’m currently working on a home project with NuttX and my preferred
>> language is really C++ for what I am doing.  I can work in C if necessary
>> but I’d like to use some C++ features.
>>> 
>>> So far I have managed to get the framework of what is needed configured
>> and the next step is to start some application implementation.  So I’m
>> thinking core logic unit tested using the simulator and basic C++
>> application on the laptop.
>>> 
>>> So I have started a fairly basic test scenario and hit a problem with
>> the C++ support in NuttX.
>>> 
>>> My application is going to be using some of the STL, at the moment I’m
>> hitting issues with string and vector, two fairly basic and simple
>> classes.  I’m not getting any application to compile successfully.  I have
>> tried:
>>> 
>>> - Basic C++ support
>>> - LLVM with both the LLVM and GNU low level libraries
>>> - uCLib++ with both LLVM and GNU libraries
>>> 
>>> I have tried this with both the sim:nsh and the raspberrypi-pico-w:nsh
>> configurations.
>>> 
>>> The classes I am using are fairly basic so I could implement them
>> myself, I would prefer to use a library version though.
>>> 
>>> Has anyone managed to use the C++ libraries with NuttX ?
>>> 
>>> Regards,
>>> Mark
>>> _
>>> Blog: blog.thepcsite.co.uk
>>> Twitter: @nevynuk
>>> 
>>> 
>>> 
>>> 
>>> 
>> 
>> 



Re: [RFC] Add "Description:" header to defconfig file

2023-06-25 Thread Alan C. Assis
Hi Tomek,

On 6/24/23, Tomek CEDRO  wrote:
> On Sat, Jun 24, 2023 at 3:53 PM Alan C. Assis wrote:
>> Dear NuttXers,
>> As some people here know, recently Espressif added support for USB OTG
>> Device on ESP32S3 (thanks to Dong Heng).
>
> BIG TANKS!! :-)
>
>> And it opened the possibility to have USB Console using this USB OTG
>> Device or using the USB_SERIAL_JTAG (see TRM: "33 USB Serial/JTAG
>> Controller (USB_SERIAL_JTAG)" ).
>>
>> So, to "avoid" confusion we will follow this convention: usbconsole
>> when referring to USB console using USB_SERIAL_JTAG and usbnsh when
>> referring to USB console using USB Device.
>>
>> However for a newcomer who never saw his email, it will be difficult
>> to understand what each one does. Same apply to many board profiles we
>> already have currently.
>
> The defconfig name should and can be self-explanatory:
>
> 1. usbconsole when referring to USB console using USB_SERIAL_JTAG is
> not self-explanatory. Why not just use usbnshespserialjtag? I know it
> looks ugly (can be usbnsh_esp_serialjtag?) but its grepable and most
> times it is copied / typed only once? :-)
>

Exactly because of this usbnshespserialjtag and usbnsh_esp_serialjtag
are not good names and didn't help much to explain the differences.

> 2. usbnsh when referring to USB console using USB Device... as for
> other devices so there is no confusion.
>

Yes, usbnsh is default across all platforms with USB Device CDC/ACM as
console, so we reserve it to be 100% compatible.
In theory the console over USB_SERIAL_JTAG is a "usb nsh", just using
an Espressif-only USB IP that is not real USB Device, imagine it as a
USB Device that only can be a CDC.

>> Of course, the best way to solve it is creating a documentation for
>> each board profile, but it is something that doesn't happen easily.
>
> Just let me know what to put and where and I will help with updating
> the documentation.. lets keep things coherent and make folks used to
> the process :-)
>

Just look some examples of supported boards:
https://nuttx.apache.org/docs/latest/platforms/index.html and add the
missing boards and board profiles.

I think we could create some board Template/Skeleton to be used when
submitting now boards.

I see a lot of inconsistencies and quality issues, let see just 3
random examples:


https://nuttx.apache.org/docs/latest/platforms/arm/rp2040/boards/waveshare-rp2040-lcd-1.28/index.html

Good things:
1) included board image;
2) included pinout diagrams;
3) include Feature session

Bad things:
1) didn't explain how to flash NuttX in the board
2) shallow/non-existent explanation about each board profile (read the
descriptions and you will see)


https://nuttx.apache.org/docs/latest/platforms/risc-v/mpfs/boards/icicle/index.html

Good things:
1) included board image;

Bad things:
1) didn't include Feature session; Although it is separated by CPU,
Memory and storage, Interfaces, Sensor, etc
2) didn't include all board profiles: hwtest, knsh, network, nsh,
opensbi, pnsh, rpmsg-ch1, rpmsg-ch2, rpmsg-sbi, usb


https://nuttx.apache.org/docs/latest/platforms/risc-v/esp32c3/boards/esp32c3-devkit/index.html

Good things:
1) included board image;
2) explained how to flash NuttX in the board
3) all board profiles really well explained

Bad things:
1) missing pinout diagrams;
2) didn't include Feature session;

>> So, I think having a "Description: " in the defconfig could help here.
>> People could read it to know what it does or we could use:
>> "./tools/configure.sh info boardname:profile" to print this information.
>
> I like the idea! It would be nice to have "Description" field within
> the "Defconfig" itself, that would create self-explanatory solution
> right at the code and on the `-L` list :-) Right now some options are
> obvious only for people who already know them and this is not the
> way.. for instance some CONFIG options also could be more verbose :-)
>

Nice to know you liked it. I think Brennan is worried that this
"Description:" field could make people more lazy about creating the
board documentation, but I don't think so.
I think "Description: " and Documentation are different thing, that
are not "OR Exclusive".

>
>> This is just a RFC, I opened it here:
>> https://github.com/apache/nuttx/issues/9598
>
> My comments inside too :-)
>

Thanks!

BR,

Alan


Re: C++ Support

2023-06-25 Thread spudaneco
UCLibc++ is very old.  Most people use libxx from LLVMSent from my Galaxy
 Original message From: Mark Stevens  
Date: 6/25/23  1:50 AM  (GMT-06:00) To: dev@nuttx.apache.org Subject: Re: C++ 
Support So a little more progress on this one.Turning on C++ Exception support 
for the PicoW:nsh build configuration generates errors:CC:  
pthread/pthread_testcancel.c machine/arm/gnu_unwind_find_exidx.c:32:8: error: 
unknown type name '__EIT_entry'   32 | static __EIT_entry *__exidx_start_elf;   
   |    ^~~Configuration is:- C++ enabled- uCLib++ library- GNU low 
level support- Exceptions enabled.Turning exceptions off gives me missing 
symbols, guess that is going to be a missing library in the link 
phase.Regards,Mark_Blog: 
blog.thepcsite.co.ukTwitter: @nevynuk> On 24 Jun 2023, at 18:59, Mark Stevens 
 wrote:> > I’m currently working on a home project with 
NuttX and my preferred language is really C++ for what I am doing.  I can work 
in C if necessary but I’d like to use some C++ features.> > So far I have 
managed to get the framework of what is needed configured and the next step is 
to start some application implementation.  So I’m thinking core logic unit 
tested using the simulator and basic C++ application on the laptop.> > So I 
have started a fairly basic test scenario and hit a problem with the C++ 
support in NuttX.> > My application is going to be using some of the STL, at 
the moment I’m hitting issues with string and vector, two fairly basic and 
simple classes.  I’m not getting any application to compile successfully.  I 
have tried:> > - Basic C++ support> - LLVM with both the LLVM and GNU low level 
libraries> - uCLib++ with both LLVM and GNU libraries> > I have tried this with 
both the sim:nsh and the raspberrypi-pico-w:nsh configurations.> > The classes 
I am using are fairly basic so I could implement them myself, I would prefer to 
use a library version though.> > Has anyone managed to use the C++ libraries 
with NuttX ?> > Regards,> Mark> _> Blog: 
blog.thepcsite.co.uk> Twitter: @nevynuk> > > > > 

Re: C++ Support

2023-06-25 Thread Xiang Xiao
Mark, could you try this patch:
https://github.com/apache/nuttx/pull/9610

On Sun, Jun 25, 2023 at 3:50 PM Mark Stevens  wrote:

> So a little more progress on this one.
>
> Turning on C++ Exception support for the PicoW:nsh build configuration
> generates errors:
>
> CC:  pthread/pthread_testcancel.c
> machine/arm/gnu_unwind_find_exidx.c:32:8: error: unknown type name
> '__EIT_entry'
>32 | static __EIT_entry *__exidx_start_elf;
>   |^~~
>
> Configuration is:
>
> - C++ enabled
> - uCLib++ library
> - GNU low level support
> - Exceptions enabled.
>
> Turning exceptions off gives me missing symbols, guess that is going to be
> a missing library in the link phase.
>
> Regards,
> Mark
> _
> Blog: blog.thepcsite.co.uk
> Twitter: @nevynuk
>
>
>
>
>
> > On 24 Jun 2023, at 18:59, Mark Stevens  wrote:
> >
> > I’m currently working on a home project with NuttX and my preferred
> language is really C++ for what I am doing.  I can work in C if necessary
> but I’d like to use some C++ features.
> >
> > So far I have managed to get the framework of what is needed configured
> and the next step is to start some application implementation.  So I’m
> thinking core logic unit tested using the simulator and basic C++
> application on the laptop.
> >
> > So I have started a fairly basic test scenario and hit a problem with
> the C++ support in NuttX.
> >
> > My application is going to be using some of the STL, at the moment I’m
> hitting issues with string and vector, two fairly basic and simple
> classes.  I’m not getting any application to compile successfully.  I have
> tried:
> >
> > - Basic C++ support
> > - LLVM with both the LLVM and GNU low level libraries
> > - uCLib++ with both LLVM and GNU libraries
> >
> > I have tried this with both the sim:nsh and the raspberrypi-pico-w:nsh
> configurations.
> >
> > The classes I am using are fairly basic so I could implement them
> myself, I would prefer to use a library version though.
> >
> > Has anyone managed to use the C++ libraries with NuttX ?
> >
> > Regards,
> > Mark
> > _
> > Blog: blog.thepcsite.co.uk
> > Twitter: @nevynuk
> >
> >
> >
> >
> >
>
>


Re: C++ Support

2023-06-25 Thread Mark Stevens
So a little more progress on this one.

Turning on C++ Exception support for the PicoW:nsh build configuration 
generates errors:

CC:  pthread/pthread_testcancel.c machine/arm/gnu_unwind_find_exidx.c:32:8: 
error: unknown type name '__EIT_entry'
   32 | static __EIT_entry *__exidx_start_elf;
  |^~~

Configuration is:

- C++ enabled
- uCLib++ library
- GNU low level support
- Exceptions enabled.

Turning exceptions off gives me missing symbols, guess that is going to be a 
missing library in the link phase.

Regards,
Mark
_
Blog: blog.thepcsite.co.uk
Twitter: @nevynuk





> On 24 Jun 2023, at 18:59, Mark Stevens  wrote:
> 
> I’m currently working on a home project with NuttX and my preferred language 
> is really C++ for what I am doing.  I can work in C if necessary but I’d like 
> to use some C++ features.
> 
> So far I have managed to get the framework of what is needed configured and 
> the next step is to start some application implementation.  So I’m thinking 
> core logic unit tested using the simulator and basic C++ application on the 
> laptop.
> 
> So I have started a fairly basic test scenario and hit a problem with the C++ 
> support in NuttX.
> 
> My application is going to be using some of the STL, at the moment I’m 
> hitting issues with string and vector, two fairly basic and simple classes.  
> I’m not getting any application to compile successfully.  I have tried:
> 
> - Basic C++ support
> - LLVM with both the LLVM and GNU low level libraries
> - uCLib++ with both LLVM and GNU libraries
> 
> I have tried this with both the sim:nsh and the raspberrypi-pico-w:nsh 
> configurations.
> 
> The classes I am using are fairly basic so I could implement them myself, I 
> would prefer to use a library version though.
> 
> Has anyone managed to use the C++ libraries with NuttX ?
> 
> Regards,
> Mark
> _
> Blog: blog.thepcsite.co.uk
> Twitter: @nevynuk
> 
> 
> 
> 
>