Re: What's the AVR32 GCC in Microchip Studio and where's its source code?

2021-10-17 Thread Tomasz CEDRO
On Sun, Oct 17, 2021 at 2:15 AM Gregory Nutt wrote:
>
> Those are pretty old.  These are old too:
> http://ww1.microchip.com/downloads/archive/avr32-gnu-toolchain-3.4.0.332-source.zip
>
> There are even old sources here:
> https://www.microchip.com/en-us/development-tools-tools-and-software/avr-and-sam-downloads-archive
>
> There slightly newer gcc-avr32 RPMs available for various Linux
> distributions (like *gcc*-*avr32*-linux-gnu-4.8.5-16.el7.1.x86_64.rpm for
> CentOS 7).  Maybe a source RPM could be modified?

On FreeBSD we have these system packages available from the list
below. All packages are built from sources in automated way (these are
called Ports) and available as binary packaged with `pkg` utility, but
still you can build everything from the sources from scratch. There
are no binary blobs here, except firmware files for some dongles.

Ity be safe to assume they are updated regularly. May add to common
denominator of the Open-Source toolchain for AVR :-)

% pkg search -x avr
arduino-avrdude-6.3_3  Program for programming the on-chip
memory of Atmel AVR Arduino CPUs
avr-binutils-2.37_1,1  GNU binary tools
avr-gcc-10.2.0 FSF GCC for Atmel AVR 8-bit RISC
cross-development
avr-gdb-7.3.1_6GNU GDB for the AVR target
avr-libc-2.0.0_4,1 C and math library for the Atmel AVR
controller family
avra-1.4.2 Macro Assembler for Atmel AVR microcontrollers
avrdude-6.3_3  Program for programming the on-chip
memory of Atmel AVR CPUs
avro-1.10.2Data serialization system
avro-c-1.10.2  C library for Apache Avro
avro-cpp-1.10.2C++ library for Apache Avro
libpololu-avr-151002_1 Support libraries for Pololu robots
simavr-1.7_1   Simulator for several Atmel AVR chips

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: What's the AVR32 GCC in Microchip Studio and where's its source code?

2021-10-17 Thread Tomasz CEDRO
On Sun, Oct 17, 2021 at 12:15 PM Tomasz CEDRO wrote:
>
> On Sun, Oct 17, 2021 at 2:15 AM Gregory Nutt wrote:
> >
> > Those are pretty old.  These are old too:
> > http://ww1.microchip.com/downloads/archive/avr32-gnu-toolchain-3.4.0.332-source.zip
> >
> > There are even old sources here:
> > https://www.microchip.com/en-us/development-tools-tools-and-software/avr-and-sam-downloads-archive
> >
> > There slightly newer gcc-avr32 RPMs available for various Linux
> > distributions (like *gcc*-*avr32*-linux-gnu-4.8.5-16.el7.1.x86_64.rpm for
> > CentOS 7).  Maybe a source RPM could be modified?
>
> On FreeBSD we have these system packages available from the list
> below. All packages are built from sources in automated way (these are
> called Ports) and available as binary packaged with `pkg` utility, but
> still you can build everything from the sources from scratch. There
> are no binary blobs here, except firmware files for some dongles.
>
> Ity be safe to assume they are updated regularly. May add to common
> denominator of the Open-Source toolchain for AVR :-)
>
> % pkg search -x avr
> arduino-avrdude-6.3_3  Program for programming the on-chip
> memory of Atmel AVR Arduino CPUs
> avr-binutils-2.37_1,1  GNU binary tools
> avr-gcc-10.2.0 FSF GCC for Atmel AVR 8-bit RISC
> cross-development
> avr-gdb-7.3.1_6GNU GDB for the AVR target
> avr-libc-2.0.0_4,1 C and math library for the Atmel AVR
> controller family
> avra-1.4.2 Macro Assembler for Atmel AVR microcontrollers
> avrdude-6.3_3  Program for programming the on-chip
> memory of Atmel AVR CPUs
> avro-1.10.2Data serialization system
> avro-c-1.10.2  C library for Apache Avro
> avro-cpp-1.10.2C++ library for Apache Avro
> libpololu-avr-151002_1 Support libraries for Pololu robots
> simavr-1.7_1   Simulator for several Atmel AVR chips

Ah, you can check the Port details at www.freshports.org and sources
at cgit.freebsd.org, where they are fetched from, how they are built,
what patches are applied, etc. I used them loong time ago, also the
MCS51 tools. When I am done with setting up NuttX and ESP32-C3 /
RISC-V I will try the AVR, ARM, I have some bunch of the boards, and I
have ATTiny10 purchased for some project but it has only 1K Flash so
pure assembly needs to be used for this one :-)

For instance here are port information:

https://www.freshports.org/devel/avr-gcc/

Here is the GIT repository with sources:

https://cgit.freebsd.org/ports/tree/

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: ESP32-C3 RISC-V

2021-10-17 Thread Tomasz CEDRO
On Sun, Oct 17, 2021 at 1:06 AM Abdelatif Guettouche wrote:
> There isn't really a big difference between IDF's toolchain and the one
> from Sifive, this is why we didn't add both.
> Are you having issues running the one from SiFive?

I know SiFive, I am following them directly at RISC-V lists, I am
(individual) member of the organization :-)

I would prefer to use system provided packages in the first place,
then ESP-IDF second, then anything external that needs manual
intervention.

The goal is to create automation bootstrap.sh in the top level of my
project source code so it sets up whole build environment and produce
the firmware for clients with only one script. Using ESP-IDF toolchain
gives me all tools necessary for that on various platforms and because
these are the same tools different compiler problems are reduced to
almost zero. I made this with MBED and Zephyr, it works quite well, I
also want to have something like this with NuttX :-)


> The CROSSDEV variable will just have the name of the toolchain.  If we want
> to add another toolchain we add another ifeq in
> riscv/rv32im/Toolchains.defs.

Thank you :-) I can see there are many variants of the RV. That would
imply changing many files. Can we put that in some sort top level
Toolchains.defs and then include that in machine variants
configuration?

Will try that and provide patches / pr :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: What's the AVR32 GCC in Microchip Studio and where's its source code?

2021-10-17 Thread Gregory Nutt
I think that the naming is:

   - avr-gcc for the still common 8-bit AVR family
   - avr32-gcc for the nearly extinct 32-bit AVR32 family


On Sun, Oct 17, 2021 at 4:16 AM Tomasz CEDRO  wrote:

> On Sun, Oct 17, 2021 at 2:15 AM Gregory Nutt wrote:
> >
> > Those are pretty old.  These are old too:
> >
> http://ww1.microchip.com/downloads/archive/avr32-gnu-toolchain-3.4.0.332-source.zip
> >
> > There are even old sources here:
> >
> https://www.microchip.com/en-us/development-tools-tools-and-software/avr-and-sam-downloads-archive
> >
> > There slightly newer gcc-avr32 RPMs available for various Linux
> > distributions (like *gcc*-*avr32*-linux-gnu-4.8.5-16.el7.1.x86_64.rpm for
> > CentOS 7).  Maybe a source RPM could be modified?
>
> On FreeBSD we have these system packages available from the list
> below. All packages are built from sources in automated way (these are
> called Ports) and available as binary packaged with `pkg` utility, but
> still you can build everything from the sources from scratch. There
> are no binary blobs here, except firmware files for some dongles.
>
> Ity be safe to assume they are updated regularly. May add to common
> denominator of the Open-Source toolchain for AVR :-)
>
> % pkg search -x avr
> arduino-avrdude-6.3_3  Program for programming the on-chip
> memory of Atmel AVR Arduino CPUs
> avr-binutils-2.37_1,1  GNU binary tools
> avr-gcc-10.2.0 FSF GCC for Atmel AVR 8-bit RISC
> cross-development
> avr-gdb-7.3.1_6GNU GDB for the AVR target
> avr-libc-2.0.0_4,1 C and math library for the Atmel AVR
> controller family
> avra-1.4.2 Macro Assembler for Atmel AVR
> microcontrollers
> avrdude-6.3_3  Program for programming the on-chip
> memory of Atmel AVR CPUs
> avro-1.10.2Data serialization system
> avro-c-1.10.2  C library for Apache Avro
> avro-cpp-1.10.2C++ library for Apache Avro
> libpololu-avr-151002_1 Support libraries for Pololu robots
> simavr-1.7_1   Simulator for several Atmel AVR chips
>
> --
> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>


Re: github nuttx/nuttx vs apache/incubator-nuttx

2021-10-17 Thread Gregory Nutt
 > Either way is fine, but we need action now. I have seen the same topic
> happen on the email list many times, but nothing happens after that
>discussion.

I would be happy to delete the whole thing.  Adbelatif has offered to
delete the contents as well.  But we would need consensus.  A few people
writing emails doesn't constitute consensus.  That is why we have formal
votes so that everyone's voice is heard and the direction is clear.

With regard to the trademark usage, it would be good to get PPMC feedback
on that.  Perhaps they would have a clear position.  I don't really know if
there is an issue here or not... certainly there is less of an issue here
than with NuttX YouTube, LinkedIN, Discord, and various NuttX named
websites.  The bitbucket nuttx repository would have the same trademark
problem, if there is any.

And there should be some position about where and how we provide OS tool
support.  If not github.com/nuttx, then where? Up until now no one has ever
made any change to kconfig-frontends other than to fix compile failures due
to toolchain differences. The only significant change has been to add
Windows Native support and that is not in either the github or bitbucket
repos.


Re: github nuttx/nuttx vs apache/incubator-nuttx

2021-10-17 Thread Abdelatif Guettouche
> I would be happy to delete the whole thing.  Adbelatif has offered to
> delete the contents as well.  But we would need consensus.  A few people
> writing emails doesn't constitute consensus.  That is why we have formal
> votes so that everyone's voice is heard and the direction is clear.

We can then create a VOTE thread to decide whether we want to delete
it or not (can we consider this one as a DISCUSS thread?)

> And there should be some position about where and how we provide OS tool
> support.  If not github.com/nuttx, then where?

We've been told before that we can host well known projects even if
they are in an incompatible license.  We discussed moving them to
Apache.
I'm not sure if we want to revive that discussion as it always went
unnoticed, but it would be ideal to have all the necessary
repositories in one place.

Otherwise, github.com/nuttx would be a good place, maybe we can also
change the name to something similar to what Alin suggested above.


On Sun, Oct 17, 2021 at 2:45 PM Gregory Nutt  wrote:
>
>  > Either way is fine, but we need action now. I have seen the same topic
> > happen on the email list many times, but nothing happens after that
> >discussion.
>
> I would be happy to delete the whole thing.  Adbelatif has offered to
> delete the contents as well.  But we would need consensus.  A few people
> writing emails doesn't constitute consensus.  That is why we have formal
> votes so that everyone's voice is heard and the direction is clear.
>
> With regard to the trademark usage, it would be good to get PPMC feedback
> on that.  Perhaps they would have a clear position.  I don't really know if
> there is an issue here or not... certainly there is less of an issue here
> than with NuttX YouTube, LinkedIN, Discord, and various NuttX named
> websites.  The bitbucket nuttx repository would have the same trademark
> problem, if there is any.
>
> And there should be some position about where and how we provide OS tool
> support.  If not github.com/nuttx, then where? Up until now no one has ever
> made any change to kconfig-frontends other than to fix compile failures due
> to toolchain differences. The only significant change has been to add
> Windows Native support and that is not in either the github or bitbucket
> repos.


Re: github nuttx/nuttx vs apache/incubator-nuttx

2021-10-17 Thread Nathan Hartman
On Sat, Oct 16, 2021 at 10:27 AM Tomasz CEDRO  wrote:
> Regarding kconfig-frontends I am in touch with Espressif and Debian
> maintainers, also contacted initial author Yann MORIN. Maybe putting
> this package into the Apache organization would be a good idea if
> possible..?

It occurred to me that if Yann MORIN doesn't want to maintain
kconfig-frontends then perhaps we could ask for a one-time SGA and
relicense; but then I think that kconfig was originally a Linux kernel
thing that Yann MORIN and/or perhaps others managed to separate from
the rest of the Linux build system and turn into a separate project.
If so, then it probably falls under GPL and I don't know whether it is
even feasible to relicense.

Let's wait to hear from Yann MORIN, who will hopefully respond to your
email, and see where to go from there.

There is also another possibility of asking ASF for permission to host
critical dependencies such as this and other tools under a separate
repo. Normally this isn't done but exceptions have been made for
projects with a long history and user base, e.g., Apache OpenOffice
has its own website, openoffice.org, rather than being under the
apache.org namespace. That was a specific exception for that project.

Nathan


menuconfig

2021-10-17 Thread Tomasz CEDRO
What I really like in NuttX that menuconfig has all available options
in one place so newcomer can see how many possible choices are out
there! :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: github nuttx/nuttx vs apache/incubator-nuttx

2021-10-17 Thread Nathan Hartman
On Sun, Oct 17, 2021 at 9:10 AM Abdelatif Guettouche
 wrote:
>
> We've been told before that we can host well known projects even if
> they are in an incompatible license.  We discussed moving them to
> Apache.
> I'm not sure if we want to revive that discussion as it always went
> unnoticed, but it would be ideal to have all the necessary
> repositories in one place.


I remember being told that as well.

I think we will have to get permission to do it. Maybe it would be a
good thing to have a [DISCUSS] and [VOTE] to determine whether the
project wants to take that course, and if so, then we need to
carefully present how/why we would like to host the tools.

In addition to kconfig-frontends, there is also a customized version
of GCC that is (IIRC) needed to make use of the FLAT (non-elf) binary
loader (???).

Nathan


Re: menuconfig

2021-10-17 Thread Tomasz CEDRO
On Sun, Oct 17, 2021 at 4:33 PM Tomasz CEDRO wrote:
> What I really like in NuttX that menuconfig has all available options
> in one place so newcomer can see how many possible choices are out
> there! :-)

Just an idea: would it be possible to estimate final firmware size
based on selected functionalities so user could see how much flash/ram
selected functionality would take and what would be final firmware
size? :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: github nuttx/nuttx vs apache/incubator-nuttx

2021-10-17 Thread Brennan Ashton
The nxflat stuff in that repository is broken for modern gcc. I fixed it
and have hosted it standalone here as well as added some basic CI.

https://github.com/btashton/nxflat

--Brennan


On Sun, Oct 17, 2021, 7:38 AM Nathan Hartman 
wrote:

> On Sun, Oct 17, 2021 at 9:10 AM Abdelatif Guettouche
>  wrote:
> >
> > We've been told before that we can host well known projects even if
> > they are in an incompatible license.  We discussed moving them to
> > Apache.
> > I'm not sure if we want to revive that discussion as it always went
> > unnoticed, but it would be ideal to have all the necessary
> > repositories in one place.
>
>
> I remember being told that as well.
>
> I think we will have to get permission to do it. Maybe it would be a
> good thing to have a [DISCUSS] and [VOTE] to determine whether the
> project wants to take that course, and if so, then we need to
> carefully present how/why we would like to host the tools.
>
> In addition to kconfig-frontends, there is also a customized version
> of GCC that is (IIRC) needed to make use of the FLAT (non-elf) binary
> loader (???).
>
> Nathan
>


Re: What's the AVR32 GCC in Microchip Studio and where's its source code?

2021-10-17 Thread Brennan Ashton
Yeah,
Microchip never upstreamer the 32bit work and if you look at the source
parts of it are very ugly and based on a quite old version of gcc. They do
still host the source but it is behind a login wall.

https://www.microchip.com/en-us/development-tools-tools-and-software/gcc-compilers-avr-and-arm

--Brennan


On Sun, Oct 17, 2021, 5:27 AM Gregory Nutt  wrote:

> I think that the naming is:
>
>- avr-gcc for the still common 8-bit AVR family
>- avr32-gcc for the nearly extinct 32-bit AVR32 family
>
>
> On Sun, Oct 17, 2021 at 4:16 AM Tomasz CEDRO  wrote:
>
> > On Sun, Oct 17, 2021 at 2:15 AM Gregory Nutt wrote:
> > >
> > > Those are pretty old.  These are old too:
> > >
> >
> http://ww1.microchip.com/downloads/archive/avr32-gnu-toolchain-3.4.0.332-source.zip
> > >
> > > There are even old sources here:
> > >
> >
> https://www.microchip.com/en-us/development-tools-tools-and-software/avr-and-sam-downloads-archive
> > >
> > > There slightly newer gcc-avr32 RPMs available for various Linux
> > > distributions (like *gcc*-*avr32*-linux-gnu-4.8.5-16.el7.1.x86_64.rpm
> for
> > > CentOS 7).  Maybe a source RPM could be modified?
> >
> > On FreeBSD we have these system packages available from the list
> > below. All packages are built from sources in automated way (these are
> > called Ports) and available as binary packaged with `pkg` utility, but
> > still you can build everything from the sources from scratch. There
> > are no binary blobs here, except firmware files for some dongles.
> >
> > Ity be safe to assume they are updated regularly. May add to common
> > denominator of the Open-Source toolchain for AVR :-)
> >
> > % pkg search -x avr
> > arduino-avrdude-6.3_3  Program for programming the on-chip
> > memory of Atmel AVR Arduino CPUs
> > avr-binutils-2.37_1,1  GNU binary tools
> > avr-gcc-10.2.0 FSF GCC for Atmel AVR 8-bit RISC
> > cross-development
> > avr-gdb-7.3.1_6GNU GDB for the AVR target
> > avr-libc-2.0.0_4,1 C and math library for the Atmel AVR
> > controller family
> > avra-1.4.2 Macro Assembler for Atmel AVR
> > microcontrollers
> > avrdude-6.3_3  Program for programming the on-chip
> > memory of Atmel AVR CPUs
> > avro-1.10.2Data serialization system
> > avro-c-1.10.2  C library for Apache Avro
> > avro-cpp-1.10.2C++ library for Apache Avro
> > libpololu-avr-151002_1 Support libraries for Pololu robots
> > simavr-1.7_1   Simulator for several Atmel AVR chips
> >
> > --
> > CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
> >
>


Re: What's the AVR32 GCC in Microchip Studio and where's its source code?

2021-10-17 Thread Martin Guy
Many thanks to all and for all the links - that's cleared the air a bit!

embecosm: based on GCC-4.4.7

I'll add yet another AVR32 toolchain builder for those interested:
https://gitlab.com/martinwguy/ct-ng-avr32
based on avr32-gnu-toolchain 4.3.2 (which seems to have disappeared
from their releases!)
forward-ported from
gcc-4.4.3 binutils-1.18 newlib-1.16.0
to
gcc-4.4.7 binutils.1.22 newlib-1.20.0
with some other patches to correct GCC pr's (from Debian and
elsewhere) to fix incorrect code generation and for smaller code size,
to fix dlmalloc in newlib which corrupts memory when using more than
one region of RAM, and more hacks for smaller code size when using -Os

It's based on crosstool-ng, so contains patches to mainline sources,
not a modified gcc.

Thanks for the pointer to RedHat, the only more recent version of gcc
(4.8.5 over 4.4.7).
If that will solve my company's problems I'll look at incorporating
it, but I suspect it only produces better code, not language features.

Blessings

   M


Re: github nuttx/nuttx vs apache/incubator-nuttx

2021-10-17 Thread Gregory Nutt
I will go ahead and remove github.com/nuttx content.  There is nother there
of value now and everything is available elsewhere.  So that is safe to do
in any case.


Re: github nuttx/nuttx vs apache/incubator-nuttx

2021-10-17 Thread Gregory Nutt
All of the junk repositories are gone (that is a good thing to do
regardless of what we decide to do with the directory).  The
github.com/nuttx directory still exists.  The following people have write
access:

   - Alan Carvalho de Assis, acassis
   - Anthony Merlino,antmerlino
   - David Sidrane, davids5
   - hartmannathan
   - liuguo09
   - lAbdelatif Guettouche, Ouss4
   - patacongo
   - Xiang Xiao, xiaoxiang781216

We can add more if we decide to use the directory.  Or we can remove the
directory if we decide we don't need it.

While this does not resolve the important issue at hand, it does at least
resolve newbies being confused as Tomasz was.

On Sun, Oct 17, 2021 at 12:02 PM Gregory Nutt  wrote:

> I will go ahead and remove github.com/nuttx content.  There is nother
> there of value now and everything is available elsewhere.  So that is safe
> to do in any case.
>


Re: github nuttx/nuttx vs apache/incubator-nuttx

2021-10-17 Thread Tomasz CEDRO
TANK U SIR! =)

On Sun, Oct 17, 2021 at 8:17 PM Gregory Nutt  wrote:
>
> All of the junk repositories are gone (that is a good thing to do
> regardless of what we decide to do with the directory).  The
> github.com/nuttx directory still exists.  The following people have write
> access:
>
>- Alan Carvalho de Assis, acassis
>- Anthony Merlino,antmerlino
>- David Sidrane, davids5
>- hartmannathan
>- liuguo09
>- lAbdelatif Guettouche, Ouss4
>- patacongo
>- Xiang Xiao, xiaoxiang781216
>
> We can add more if we decide to use the directory.  Or we can remove the
> directory if we decide we don't need it.
>
> While this does not resolve the important issue at hand, it does at least
> resolve newbies being confused as Tomasz was.
>
> On Sun, Oct 17, 2021 at 12:02 PM Gregory Nutt  wrote:
>
> > I will go ahead and remove github.com/nuttx content.  There is nother
> > there of value now and everything is available elsewhere.  So that is safe
> > to do in any case.
> >



-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: ESP32-C3 RISC-V

2021-10-17 Thread Tomasz CEDRO
On Sun, Oct 17, 2021 at 12:30 PM Tomasz CEDRO wrote:
> On Sun, Oct 17, 2021 at 1:06 AM Abdelatif Guettouche wrote:
> > The CROSSDEV variable will just have the name of the toolchain.  If we want
> > to add another toolchain we add another ifeq in
> > riscv/rv32im/Toolchains.defs.
>
> Thank you :-) I can see there are many variants of the RV. That would
> imply changing many files. Can we put that in some sort top level
> Toolchains.defs and then include that in machine variants
> configuration?
>
> Will try that and provide patches / pr :-)

I have found 1.5 solution :-)

One quick solution is to simply pass `CROSSDEV` to make: `make
-DCROSSDEV=riscv32-esp-elf-`.

Another half of the solution is to put autodetection mechanism like
this in `riscv/rv32im/Toolchains.defs`:

RVTOOLCHAINS := \
  riscv32-esp-elf-\
  riscv32-unknown-elf-\
  riscv64-none-elf-\
  riscv64-unknown-elf-

RVTOOLCHAINS_AVAILABLE := $(foreach rvtoolchain, $(RVTOOLCHAINS),\
  $(if $(shell which $(rvtoolchain)gcc), $(rvtoolchain) ) )

CROSSDEV ?= $(word 1,${RVTOOLCHAINS_AVAILABLE})
$(info "USING CROSSDEV: ${CROSSDEV}")

But this is not the acceptable solution as this Makefile is called
over and over during build, each time autodetecting available
toolchains slowing down the build process.

Where could we put that autodetection so its called only once?
`tools/configure.sh`?

Also it would be nice if that variable could be set / changed with
`make menuconfig`, so probably stored in `.config` ?

Work in progress :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


esp32c3-devkit:ble boot loop

2021-10-17 Thread Tomasz CEDRO
Hello world :-)

By selecting toolkit by hand (make CROSSDEV=riscv32-esp-elf-) I made
it to build the esp32c3-devkit:ble example. Both on FreeBSD and Linux.
I am using ESP-IDF toolchain.

After flashing I can see on terminal emulator that device is locked in
a boot loop :-(

Is there any additional setup required?

Can this additional setup be put into a board configuration so it
works out of the box?

The result is exactly the same both with build from FreeBSD and Linux.

Any hints welcome :-)
Tomek

ps/2: I have created and send FreeBSD Port update (2.5.1 -> 3.1) to
esptool system package that supports esp32-c3 / risc-v :-)
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259235



-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: FreeBSD / BSD

2021-10-17 Thread Tomasz CEDRO
I have managed to build and flash esp32c3-devkit:ble on FreeBSD :-)

It gets a boot loop problem but the build seem to have worked just the
same as on Linux Debian :-)

I have tried `./tools/configure.sh -B sim:nsh` but that needs porting
`genromfs` to FreeBSD.

work in progres..

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: FreeBSD / BSD

2021-10-17 Thread Tomasz CEDRO
On Mon, Oct 18, 2021 at 1:27 AM Tomasz CEDRO wrote:
>
> I have managed to build and flash esp32c3-devkit:ble on FreeBSD :-)
>
> It gets a boot loop problem but the build seem to have worked just the
> same as on Linux Debian :-)
>
> I have tried `./tools/configure.sh -B sim:nsh` but that needs porting
> `genromfs` to FreeBSD.
>
> work in progres..

genromfs was easy peasy :-)

I am using upstream version 0.5.7 from https://github.com/chexum/genromfs

0xCFMX4% ls -al nuttx
-rwxr-xr-x  1 XXX  XXX  1516992 Oct 18 01:41 nuttx

0xCFMX4% ./nuttx
login: admin
password:
User Logged-in!

NuttShell (NSH) NuttX-10.1.0
MOTD: username=admin password=Administrator
nsh> uname -a
NuttX 10.1.0 9cb35d79cc-dirty Oct 18 2021 01:40:26 sim sim
nsh> ls
/:
 bin/
 dev/
 etc/
 proc/
 tmp/
nsh>

:-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: FreeBSD / BSD

2021-10-17 Thread Tomasz CEDRO
By the way, did anyone since 1998 of genromfs existence notice this
part of Makefile that may cripple your system files ?!

install-man:
# genromfs 0.5 installed the man page in this file,
# remove it before someone notices :)
if [ -f $(PREFIX)$(bindir)/man8 ]; then \
rm -f $(PREFIX)$(bindir)/man8; \
fi
mkdir -p $(PREFIX)$(mandir)/man8
install -m 644 genromfs.8 $(PREFIX)$(mandir)/man8/


Well I noticed that. It will not replace existing file not even delete
the single file of interest it will delete whole man pages directory
as part of install !!! Very funny :-(

I had a similar situation with modern Ubuntu Linux adduser utility
that removed my whole home directory without asking just because it
existed :-(

https://www.tomek.cedro.info/why-linux-sux/

I can only confirm never run Linux or GPL outside dedicated
snapshotted virtual machine. Never attach real world data to it. Best
not to use it at all.

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: FreeBSD / BSD

2021-10-17 Thread Nathan Hartman
On Sun, Oct 17, 2021 at 9:32 PM Tomasz CEDRO  wrote:

> By the way, did anyone since 1998 of genromfs existence notice this
> part of Makefile that may cripple your system files ?!
>
> install-man:
> # genromfs 0.5 installed the man page in this file,
> # remove it before someone notices :)
> if [ -f $(PREFIX)$(bindir)/man8 ]; then \
> rm -f $(PREFIX)$(bindir)/man8; \
> fi
> mkdir -p $(PREFIX)$(mandir)/man8
> install -m 644 genromfs.8 $(PREFIX)$(mandir)/man8/
>

Haha oops! That's not good at all!! Thanks for noticing and reporting it
here.

Would you be inclined to open a pull request? I'd do it myself right away
but am away from a real computer.

Thanks,
Nathan


Re: FreeBSD / BSD

2021-10-17 Thread Tomasz CEDRO
On Mon, Oct 18, 2021 at 4:03 AM Nathan Hartman wrote:
>
> On Sun, Oct 17, 2021 at 9:32 PM Tomasz CEDRO  wrote:
>
> > By the way, did anyone since 1998 of genromfs existence notice this
> > part of Makefile that may cripple your system files ?!
> >
> > install-man:
> > # genromfs 0.5 installed the man page in this file,
> > # remove it before someone notices :)
> > if [ -f $(PREFIX)$(bindir)/man8 ]; then \
> > rm -f $(PREFIX)$(bindir)/man8; \
> > fi
> > mkdir -p $(PREFIX)$(mandir)/man8
> > install -m 644 genromfs.8 $(PREFIX)$(mandir)/man8/
> >
>
> Haha oops! That's not good at all!! Thanks for noticing and reporting it
> here.
>
> Would you be inclined to open a pull request? I'd do it myself right away
> but am away from a real computer.
>
> Thanks,
> Nathan

Already did: https://github.com/chexum/genromfs/pull/3 :-)

That showed up in 2002 with version 0.5 :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: FreeBSD / BSD

2021-10-17 Thread Gregory Nutt
By the way, did anyone since 1998 of genromfs existence notice this
> part of Makefile that may cripple your system files ?!
>
> install-man:
> # genromfs 0.5 installed the man page in this file,
> # remove it before someone notices :)
> if [ -f $(PREFIX)$(bindir)/man8 ]; then \
> rm -f $(PREFIX)$(bindir)/man8; \
> fi
> mkdir -p $(PREFIX)$(mandir)/man8
> install -m 644 genromfs.8 $(PREFIX)$(mandir)/man8/
>
> Well I noticed that. It will not replace existing file not even delete
> the single file of interest it will delete whole man pages directory
> as part of install !!! Very funny :-(
>

Are you sure?  It looks like it removes the $bindir/man8 which is probably
/usr/local/bin/man8.  Then it installs the manpages correctly at
$mandir/man8

That is probably okay.


Re: FreeBSD / BSD

2021-10-17 Thread Gregory Nutt
> Would you be inclined to open a pull request? I'd do it myself right away
> but am away from a real computer.
>

We don't have genromfs in a repository.  We do have a snapshot here:
https://bitbucket.org/nuttx/tools/src/master/genromfs-0.5.2.tar.gz

That is the version I recommend to people because that is the version of
romfs that I developed the NuttX ROMFS file system against.


Re: FreeBSD / BSD

2021-10-17 Thread Tomasz CEDRO
On Mon, Oct 18, 2021 at 4:11 AM Gregory Nutt wrote:
>
> By the way, did anyone since 1998 of genromfs existence notice this
> > part of Makefile that may cripple your system files ?!
> >
> > install-man:
> > # genromfs 0.5 installed the man page in this file,
> > # remove it before someone notices :)
> > if [ -f $(PREFIX)$(bindir)/man8 ]; then \
> > rm -f $(PREFIX)$(bindir)/man8; \
> > fi
> > mkdir -p $(PREFIX)$(mandir)/man8
> > install -m 644 genromfs.8 $(PREFIX)$(mandir)/man8/
> >
> > Well I noticed that. It will not replace existing file not even delete
> > the single file of interest it will delete whole man pages directory
> > as part of install !!! Very funny :-(
> >
>
> Are you sure?  It looks like it removes the $bindir/man8 which is probably
> /usr/local/bin/man8.  Then it installs the manpages correctly at
> $mandir/man8

Well also $(bindir) is messed with $(mandir). I just removed that part
in the patch :-)

> That is probably okay.

Far from okay to rm -rf anything as root without user knowledge
especially at /usr location. Why not rm -rf / right away? :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: FreeBSD / BSD

2021-10-17 Thread Tomasz CEDRO
genromfs 0.5.7 port has been submitted, with local patch until
upstream gets updated :-)

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259242

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: FreeBSD / BSD

2021-10-17 Thread Gregory Nutt
> > By the way, did anyone since 1998 of genromfs existence notice this
> > > part of Makefile that may cripple your system files ?!
> > >
> > > install-man:
> > > # genromfs 0.5 installed the man page in this file,
> > > # remove it before someone notices :)
> > > if [ -f $(PREFIX)$(bindir)/man8 ]; then \
> > > rm -f $(PREFIX)$(bindir)/man8; \
> > > fi
> > > mkdir -p $(PREFIX)$(mandir)/man8
> > > install -m 644 genromfs.8 $(PREFIX)$(mandir)/man8/
> > >
> > > Well I noticed that. It will not replace existing file not even delete
> > > the single file of interest it will delete whole man pages directory
> > > as part of install !!! Very funny :-(
> > >
> >
> > Are you sure?  It looks like it removes the $bindir/man8 which is
> probably
> > /usr/local/bin/man8.  Then it installs the manpages correctly at
> > $mandir/man8
>
> Well also $(bindir) is messed with $(mandir). I just removed that part
> in the patch :-)
>
> > That is probably okay.
>
> Far from okay to rm -rf anything as root without user knowledge
> especially at /usr location. Why not rm -rf / right away? :-)
>
> True, but it is not doing rm -rf, it is doing rm -f to remove a regular
> file named man8.
>


Re: FreeBSD / BSD

2021-10-17 Thread Tomasz CEDRO
On Mon, Oct 18, 2021 at 4:31 AM Gregory Nutt  wrote:
>
> > > By the way, did anyone since 1998 of genromfs existence notice this
> > > > part of Makefile that may cripple your system files ?!
> > > >
> > > > install-man:
> > > > # genromfs 0.5 installed the man page in this file,
> > > > # remove it before someone notices :)
> > > > if [ -f $(PREFIX)$(bindir)/man8 ]; then \
> > > > rm -f $(PREFIX)$(bindir)/man8; \
> > > > fi
> > > > mkdir -p $(PREFIX)$(mandir)/man8
> > > > install -m 644 genromfs.8 $(PREFIX)$(mandir)/man8/
> > > >
> > > > Well I noticed that. It will not replace existing file not even delete
> > > > the single file of interest it will delete whole man pages directory
> > > > as part of install !!! Very funny :-(
> > > >
> > >
> > > Are you sure?  It looks like it removes the $bindir/man8 which is
> > probably
> > > /usr/local/bin/man8.  Then it installs the manpages correctly at
> > > $mandir/man8
> >
> > Well also $(bindir) is messed with $(mandir). I just removed that part
> > in the patch :-)
> >
> > > That is probably okay.
> >
> > Far from okay to rm -rf anything as root without user knowledge
> > especially at /usr location. Why not rm -rf / right away? :-)
> >
> > True, but it is not doing rm -rf, it is doing rm -f to remove a regular
> > file named man8.

True, sorry, not the correct location anyway, I have trauma and will
never trust Linux again after it wanted to remove my real world home
directory full of real world work :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: FreeBSD / BSD

2021-10-17 Thread Gregory Nutt
Wow, that change has been in the Makefile for 20 years.

Here is the original bugfix:
https://github.com/chexum/genromfs/commit/6d1b1e46bb7dbc25ca521c5dfcdc37d17dca8615

The bug was:

-mkdir -p $(PREFIX)$(mandir)
+mkdir -p $(PREFIX)$(mandir)/man8
 install -m 644 genromfs.8 $(PREFIX)$(mandir)/man8/

Which installed the manpage in a regular file called man8 (the use of
bindir instead of mandir was also a bug it should have done nothing).

And this one makes the code look like it does today:
https://github.com/chexum/genromfs/commit/427b121e23cd21d9b9ddb6caee3eb1064369358d

Which looks wrong to me:  Why does the change use bindir?  Must be some
other issue that I can't see???


Re: FreeBSD / BSD

2021-10-17 Thread Tomasz CEDRO
On Mon, Oct 18, 2021 at 4:57 AM Gregory Nutt wrote:
>
> Wow, that change has been in the Makefile for 20 years.
>
> Here is the original bugfix:
> https://github.com/chexum/genromfs/commit/6d1b1e46bb7dbc25ca521c5dfcdc37d17dca8615
>
> The bug was:
>
> -mkdir -p $(PREFIX)$(mandir)
> +mkdir -p $(PREFIX)$(mandir)/man8
>  install -m 644 genromfs.8 $(PREFIX)$(mandir)/man8/
>
> Which installed the manpage in a regular file called man8 (the use of
> bindir instead of mandir was also a bug it should have done nothing).
>
> And this one makes the code look like it does today:
> https://github.com/chexum/genromfs/commit/427b121e23cd21d9b9ddb6caee3eb1064369358d
>
> Which looks wrong to me:  Why does the change use bindir?  Must be some
> other issue that I can't see???

Probably a "fix" for bad install by 0.5 :-)

https://github.com/chexum/genromfs/blob/4fdb9d00df13dfe52c28e8af058d38ce8bea89a1/Makefile

install-man:
mkdir -p $(PREFIX)/$(bindir)
install -m 644 genromfs.8 $(PREFIX)/$(bindir)/man8

I would keep that file instead removing anything from $envvar /
$clivar / usr as root, this is part of base OS, messing with /usr is
wrong, this place is sacred, /usr/local is for local packages :-)

Also prefix and PREFIX can be provided as command line and environment
parameter so its not a constant location, is user controlled, and may
differ between installations :-)

-- 
CeDeROM, SQ7MHZ, http://www.tomek.cedro.info


Re: github nuttx/nuttx vs apache/incubator-nuttx

2021-10-17 Thread Alin Jerpelea
Thanks for cleaning it out


On Sun, Oct 17, 2021, 20:17 Gregory Nutt  wrote:

> All of the junk repositories are gone (that is a good thing to do
> regardless of what we decide to do with the directory).  The
> github.com/nuttx directory still exists.  The following people have write
> access:
>
>- Alan Carvalho de Assis, acassis
>- Anthony Merlino,antmerlino
>- David Sidrane, davids5
>- hartmannathan
>- liuguo09
>- lAbdelatif Guettouche, Ouss4
>- patacongo
>- Xiang Xiao, xiaoxiang781216
>
> We can add more if we decide to use the directory.  Or we can remove the
> directory if we decide we don't need it.
>
> While this does not resolve the important issue at hand, it does at least
> resolve newbies being confused as Tomasz was.
>
> On Sun, Oct 17, 2021 at 12:02 PM Gregory Nutt  wrote:
>
> > I will go ahead and remove github.com/nuttx content.  There is nother
> > there of value now and everything is available elsewhere.  So that is
> safe
> > to do in any case.
> >
>


Re: esp32c3-devkit:ble boot loop

2021-10-17 Thread Abdelatif Guettouche
Is this loop from the 1st stage bootloader?
If that is the case, you only need to flash the 2nd stage bootloader.
You can get prebuilt binaries for that on
github.com/espressif/esp-nutt-bootloader and then from NuttX you can flash
with make download ESPTOOL_BINDIR=...
You can also build it yourself if you want.  Please check the
documentation, there should be direct links. (Using just a phone now sorry)

On Mon, Oct 18, 2021, 01:22 Tomasz CEDRO  wrote:

> Hello world :-)
>
> By selecting toolkit by hand (make CROSSDEV=riscv32-esp-elf-) I made
> it to build the esp32c3-devkit:ble example. Both on FreeBSD and Linux.
> I am using ESP-IDF toolchain.
>
> After flashing I can see on terminal emulator that device is locked in
> a boot loop :-(
>
> Is there any additional setup required?
>
> Can this additional setup be put into a board configuration so it
> works out of the box?
>
> The result is exactly the same both with build from FreeBSD and Linux.
>
> Any hints welcome :-)
> Tomek
>
> ps/2: I have created and send FreeBSD Port update (2.5.1 -> 3.1) to
> esptool system package that supports esp32-c3 / risc-v :-)
> https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=259235
>
>
>
> --
> CeDeROM, SQ7MHZ, http://www.tomek.cedro.info
>