You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@nuttx.apache.org by 经天纬地 <wg...@163.com> on 2022/02/26 14:54:15 UTC

nuttx sx127x use for help

The driver of Lora sx127x, the SPI peripheral we used was used in STM32, and it was successfully registered as a character device, but it kept reporting an error when it was opened.
1、The following is my configuration information:




2、The registered device name is /dev/sx127x


3、The error message is as follows

Is there something wrong with my menuconfig configuration?






Re: nuttx sx127x use for help

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
You need to define which SPI you are using and configure its pins correctly.

Verify if you are asserting/deasserting the chip select correctly. Look at
some board how it is done (stm32_spi.c).

BR,

Alan

On Saturday, February 26, 2022, 经天纬地 <wg...@163.com> wrote:

> The driver of Lora sx127x, the SPI peripheral we used was used in STM32,
> and it was successfully registered as a character device, but it kept
> reporting an error when it was opened.
> 1、The following is my configuration information:
>
>
>
>
> 2、The registered device name is /dev/sx127x
>
>
> 3、The error message is as follows
>
> Is there something wrong with my menuconfig configuration?
>
>
>
>
>
>

Re: Can musl libc replace the libc of nuttx system?

Posted by Tomek CEDRO <to...@cedro.info>.
On Tue, Jul 12, 2022 at 4:38 AM Xiang Xiao  wrote:
> musl is designed to work exclusively with Linux and then there is no OS
> abstraction layer. So it's hard to adapt musl to other OS.
> Alan asks a good question: what benefit do you want to get from replacing
> NuttX' libc with musl?

Just my 2 cents as BSD user (FreeBSD to be exact) so please stay cool :-)

Yes there are lots of "Open-Source" solutions that works only on Linux
by design. Some people do this because of ignorance, some people do it
on purpose. Life would be simpler when it has "Linux-Only" sticker on
top just to know what to avoid :-)

Linux was always known to be "most-self-incomatible-system-ever" but
gets more and more away from Unix world nowadays into "constant
change" "temporary solution" world. I don't know musl but it seems to
be yet another example of Linux-Only solution (to add Docker, SystemD
and all dependent programs). I am porting lots of Open-Source
applications and libraries to BSD and I know the problem pretty well.
It goes wrong direction with applause of the masses. Kind of
Closed-Open-Source.

People think that Open-Source is Linux, but Linux is only small part
of the Open-Source world. Because Linux starts to live in its own
world, there will be more and more problems of this kind. I was using
Linux since 2.0.36 and I stopped using around 2.4.11 when kernel API
started changing with every minor release. This is clearly "enforced
changes ideology" in practice. You cannot build anything solid on non
solid fundaments.

BSD is a good proving grounds for well designed portable Open-Source.
If you make something here it will still work in two years ;-) Give it
a try :-)

https://www.freebsd.org/ - versatile OS for Embedded, Desktop, Server
(supports ZFS, RISC-V, etc).
https://nomadbsd.org/ - USB drive portable version of FreeBSD.
https://www.openbsd.org/ - most secure OS ever.

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

Re: Can musl libc replace the libc of nuttx system?

Posted by Nathan Hartman <ha...@gmail.com>.
On Thu, Jul 14, 2022 at 5:30 PM Alan Carvalho de Assis
<ac...@gmail.com> wrote:
>
> You are right, currently Apex RTOS and RT-Thread (only their "Smart
> brand" that only works on CPU with MMU) are using musl lib.
>
> So it could be useful to have musl support for NuttX.


Why not make NuttX libc as good as possible instead of introducing
different choices that will make maintenance more complicated?

Cheers,
Nathan

Re: Can musl libc replace the libc of nuttx system?

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
On 7/14/22, Ismael Luceno <is...@iodev.co.uk> wrote:
> On 12/Jul/2022 10:38, Xiang Xiao wrote:
>> musl is designed to work exclusively with Linux and then there is no OS
>> abstraction layer. So it's hard to adapt musl to other OS.
>
> Not really, adapting to another kernel is as simple as either providing
> the missing syscalls, adding stubs, or emulating them.
>

You are right, currently Apex RTOS and RT-Thread (only their "Smart
brand" that only works on CPU with MMU) are using musl lib.

So it could be useful to have musl support for NuttX.

BR,

Alan

Re: Can musl libc replace the libc of nuttx system?

Posted by Ismael Luceno <is...@iodev.co.uk>.
On 12/Jul/2022 10:38, Xiang Xiao wrote:
> musl is designed to work exclusively with Linux and then there is no OS
> abstraction layer. So it's hard to adapt musl to other OS.

Not really, adapting to another kernel is as simple as either providing
the missing syscalls, adding stubs, or emulating them.

Re: Can musl libc replace the libc of nuttx system?

Posted by Xiang Xiao <xi...@gmail.com>.
musl is designed to work exclusively with Linux and then there is no OS
abstraction layer. So it's hard to adapt musl to other OS.
Alan asks a good question: what benefit do you want to get from replacing
NuttX' libc with musl?

On Tue, Jul 12, 2022 at 9:50 AM Alan Carvalho de Assis <ac...@gmail.com>
wrote:

> Hi Prelude,
>
> I don't think someone already tried it before.
>
> BTW, why do you want to do it?
>
> BR,
>
> Alan
>
> On Monday, July 11, 2022, prelude <wg...@163.com> wrote:
>
> >
> >
> > I am currently working on a project that I want to transplant musl LIC to
> > nuttx to replace the built-in libc, have any friends done similar work? I
> > want to ask how to start.Thank you.
>

Re: Can musl libc replace the libc of nuttx system?

Posted by Gregory Nutt <sp...@gmail.com>.
> > But there would be many, many smaller issues of compatibility with
> > header files, data structures, etc.  This effort would be complex,
> > invasive, and probably more work than anyone really would want to
> > commit to doing.
> > He said it would be like “a death from a thousand cuts.”
>
> It depends if such incompatibilities are regarded as bugs in NuttX;
> when it comes to musl, it tries to be standards-compliant, it won't
> accomodate for non-standard expectations in NuttX.
>
> There is no standard governing the interface between the C library and the
OS.  Standards like POSIX rather specify the interface between an
application and the C library.  The C library then interfaces to the OS via
non-standard system calls like
https://elixir.bootlin.com/linux/latest/source/include/linux/syscalls.h for
the case of Linux.

It is the lack of any standard at this level that Tomas Cedro was lamenting.

There is little compatibility between Linux and NuttX system calls.
Compare to
https://github.com/apache/incubator-nuttx/blob/master/syscall/syscall.csv.
The NuttX system calls are closer to the application interface standard but
not very close to Linux.

So when I mentioned compatibility between header files and data structures,
I was referring to the header files and data structures that define the
non-standard, OS system call interface used by the C library and not the
standard application interface provided by the C library.

Another complexity is that there are two C libraries, both in Linux and
NuttX:  One built into the kernel logic and one made available for use by
the applications.  So there are, for example, two strcpy()
implementations:  One for use within the kernel and one for use by
applications).  In Linux these are separate files within the OS; for NuttX,
the C library may be built twice (with different configuration options),
depending upon  the build mode.

Re: Can musl libc replace the libc of nuttx system?

Posted by Ismael Luceno <is...@iodev.co.uk>.
On 11/Jul/2022 21:10, Gregory Nutt wrote:
<...>
> MUSL supports only Linux.  Hopefully, the MUSL OS interface is
> well modularized to support use of a different OS.

Musl is well-structured, ports aren't difficult.

<...>
> But there would be many, many smaller issues of compatibility with
> header files, data structures, etc.  This effort would be complex,
> invasive, and probably more work than anyone really would want to
> commit to doing.
> He said it would be like “a death from a thousand cuts.”

It depends if such incompatibilities are regarded as bugs in NuttX;
when it comes to musl, it tries to be standards-compliant, it won't
accomodate for non-standard expectations in NuttX.

> If there is missing functionality in the NuttX LibC, most people
> would opt to extend the NuttX LibC, not port a different Libc.

OTOH, sharing code with other projects is generally a good thing,
specially with quality-conscious projects.

A libc is far more taxing than a kernel to develop and test in that it
must be compliant with a large body of standards to aid portability.

Re: Can musl libc replace the libc of nuttx system?

Posted by Gregory Nutt <sp...@gmail.com>.
People have talked about using other C libraries in the past, but no one
has been successful.



C libraries support an operating specific interface.  For example, a Linux
LibC will need to use Linux system calls and Linux data structures to
interface with the kernel.  A similar interface would be needed to work
with NuttX.  MUSL supports only Linux.  Hopefully, the MUSL OS interface is
well modularized to support use of a different OS.



Some things have very intense interactions such as C standard I/O and
buffered I/O.



A good contributor who is no longer associated with the NuttX project
looked into using newlib with NuttX 10 or 12 years ago and said that the
effort would be quite large.  It is technically feasible and there is no
known single show-stopping issue.  But there would be many, many smaller
issues of compatibility with header files, data structures, etc.  This
effort would be complex, invasive, and probably more work than anyone
really would want to commit to doing.  He said it would be like “a death
from a thousand cuts.”



If there is missing functionality in the NuttX LibC, most people would opt
to extend the NuttX LibC, not port a different Libc.



But if you are willing to put in a significant effort, then perhaps you
could be successful.  Since this would require the development of the OS
interface as part of MUSL,  it would not be a part of NuttX; it would be a
part of MUSL.  If you are serious about pursuing this, you really should be
discussing the effort with Rich Felker and the MUSL team.

On Mon, Jul 11, 2022 at 7:50 PM Alan Carvalho de Assis <ac...@gmail.com>
wrote:

> Hi Prelude,
>
> I don't think someone already tried it before.
>
> BTW, why do you want to do it?
>
> BR,
>
> Alan
>
> On Monday, July 11, 2022, prelude <wg...@163.com> wrote:
>
> >
> >
> > I am currently working on a project that I want to transplant musl LIC to
> > nuttx to replace the built-in libc, have any friends done similar work? I
> > want to ask how to start.Thank you.
>

Re: Can musl libc replace the libc of nuttx system?

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Hi Prelude,

I don't think someone already tried it before.

BTW, why do you want to do it?

BR,

Alan

On Monday, July 11, 2022, prelude <wg...@163.com> wrote:

>
>
> I am currently working on a project that I want to transplant musl LIC to
> nuttx to replace the built-in libc, have any friends done similar work? I
> want to ask how to start.Thank you.

Can musl libc replace the libc of nuttx system?

Posted by prelude <wg...@163.com>.

I am currently working on a project that I want to transplant musl LIC to nuttx to replace the built-in libc, have any friends done similar work? I want to ask how to start.Thank you.

Re: How to use the UART1-UART3 on k210

Posted by Masayuki Ishikawa <ma...@gmail.com>.
Hi,

According to the following document, it looks like K210 has 16550
compatible UART for UART1/2/3.
https://github.com/laanwj/k210-sdk-stuff/blob/master/doc/memory_map.md

This means that you can use nuttx/drivers/serial/uart_16550.c


On Tue, Sep 20, 2022 at 10:26 PM prelude <wg...@163.com> wrote:

> K210 can only use UART0 at present. I would like to ask my friends, who
> has the driver code for UART1-UART3? The current project needs to use it.
> It is too difficult to transplant from the official code of K210.
>
>
>
>
>

Re: [EXT] Re: imxrt1176 on Nuttx

Posted by Jari van Ewijk <ja...@nxp.com>.
Hi,

We (Peter van der Perk and I) recently started to port NuttX to the NXP i.MX RT1170 family and the EVK board. Our RT1170 port already supports most of the peripherals that are also available in the RT1060 port, though it has some stability issues and still needs thorough testing and code cleanup. That still requires some more time and effort. I hope we will be able to upstream our work within a few months, though that may be somewhat optimistic.

Key point is that we are already working on an i.MX RT117X port and it will hopefully be available in upstream NuttX before the end of the year.

Best regards,
Jari

________________________________
Van: Alan C. Assis <ac...@gmail.com>
Verstuurd: woensdag 21 september 2022 12:19
Aan: dev@nuttx.apache.org <de...@nuttx.apache.org>
Onderwerp: [EXT] Re: imxrt1176 on Nuttx

Caution: EXT Email

Hi Prelude,

I think imxrt1176 is not available yet, did you get it?

Probably the peripherals will be the same.

BTW: did you test the W5500?

BR,

Alan

On Wednesday, September 21, 2022, prelude <wg...@163.com> wrote:

> I want to ask my friends, is there anyone who supports imxrt1176 on
> Nuttx?At present, there are only imxrt1020, imxrt1050, imxrt1060 and
> imxrt1064 in the Nuttx code.
>
>
>


Re: imxrt1176 on Nuttx

Posted by "Alan C. Assis" <ac...@gmail.com>.
Hi Prelude,

I think imxrt1176 is not available yet, did you get it?

Probably the peripherals will be the same.

BTW: did you test the W5500?

BR,

Alan

On Wednesday, September 21, 2022, prelude <wg...@163.com> wrote:

> I want to ask my friends, is there anyone who supports imxrt1176 on
> Nuttx?At present, there are only imxrt1020, imxrt1050, imxrt1060 and
> imxrt1064 in the Nuttx code.
>
>
>

imxrt1176 on Nuttx

Posted by prelude <wg...@163.com>.
I want to ask my friends, is there anyone who supports imxrt1176 on Nuttx?At present, there are only imxrt1020, imxrt1050, imxrt1060 and imxrt1064 in the Nuttx code.



How to use the UART1-UART3 on k210

Posted by prelude <wg...@163.com>.
K210 can only use UART0 at present. I would like to ask my friends, who has the driver code for UART1-UART3? The current project needs to use it. It is too difficult to transplant from the official code of K210.





Re: simulation spi driver

Posted by "Alan C. Assis" <ac...@gmail.com>.
Hi Prelude,

It is using on boards/arm/sam34/arduino-due

What issue are you facing?

On 10/13/22, Prelude <wg...@163.com> wrote:
> Have any friends done gpio simulation spi on Nuttx?
>
>
>
>
>

simulation spi driver

Posted by Prelude <wg...@163.com>.
Have any friends done gpio simulation spi on Nuttx?





Re: How to use spi_bitbang to drive SD card

Posted by "Alan C. Assis" <ac...@gmail.com>.
Hi prelude,

Please enable the debug (ERR, WARN e INFO) for MMC/SDCard:

[*]   Memory Card Driver Debug Features
[*]     Memory Card Driver Error Output
[*]     Memory Card Driver Warnings Output
[*]     Memory Card Driver Informational Output

It could give us more details about the issue.

BR,

Alan

On 1/10/23, prelude <wg...@163.com> wrote:
> I use spi_bitbang to drive the SD card on the k210 chip development board,
> referring to the content in the sam_mmcsd.c file,
> The following two configuration items are opened: CONFIG_SPI_BITBANG and
> CONFIG_MMCSD_SPI,After compiling, programming and starting,
> you can see /dev/mmcsd0, but when you insert the sd card and execute "mount
> -t vfat /dev/mmcsd0 /mnt" to mount the sd card,
> the following error is reported "nsh : mount: mount failed: Function not
> implemented".I want to ask my friends, is there a solution to this problem?
>
>

How to use spi_bitbang to drive SD card

Posted by prelude <wg...@163.com>.
I use spi_bitbang to drive the SD card on the k210 chip development board, referring to the content in the sam_mmcsd.c file,
The following two configuration items are opened: CONFIG_SPI_BITBANG and CONFIG_MMCSD_SPI,After compiling, programming and starting, 
you can see /dev/mmcsd0, but when you insert the sd card and execute "mount -t vfat /dev/mmcsd0 /mnt" to mount the sd card, 
the following error is reported "nsh : mount: mount failed: Function not implemented".I want to ask my friends, is there a solution to this problem?


Re: How to use the esp8266 network module?

Posted by "Alan C. Assis" <ac...@gmail.com>.
Hi Prelude,

There is not documentation to it yet, it was contributed many years ago.

Please helps to improve NuttX, if you get it working, submit a
documentation over github PR.

Important note, that esp8266 integration is not using USRSOCK, so it
is not the right way to do it.

BR,

Alan

On 9/29/22, Prelude <wg...@163.com> wrote:
> I saw the code of esp8266 in the directory apps/netutils/esp8266, but there
> is no test case. How can I test esp8266 using the UART?
>
>

How to use the esp8266 network module?

Posted by Prelude <wg...@163.com>.
I saw the code of esp8266 in the directory apps/netutils/esp8266, but there is no test case. How can I test esp8266 using the UART?


Re: How to use the w5500 network module?

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Hi Prelude,

The W5500 initialization code is already merged into mainline:

https://github.com/apache/incubator-nuttx/blob/master/boards/arm/stm32/stm32f4discovery/src/stm32_w5500.c

Did you have the chance to test it?

BR,

Alan

On 9/14/22, Alan Carvalho de Assis <ac...@gmail.com> wrote:
> Hi Prelude and Michael,
>
> Yes, I'm adding W5500 to ESP32-S2 to test the SPI driver that I implemented
> and because I was facing some issues on it I decided to test on
> STM32F4Discovery board. I'll submit the PR to mainline.
>
> I got it working, but for some reason it is stopping after 5 pings:
> https://pastebin.com/raw/8VqpxfMw
>
> This behavior is consistent, everytime I reset the board it stops after 5th
> ping.
>
> Which board are you planning to use?
>
> BR,
>
> Alan
>
> On Wednesday, September 14, 2022, Michael Jung <mi...@secore.ly>
> wrote:
>
>> Hello,
>>
>> I did implement the w5500 device driver, but I am only using it on a
>> proprietary custom board at the moment.  Alan is currently working on
>> using
>> the w5500 with the STM32F4Discovery board.  Apparently there are still
>> some
>> issues, but I guess once those are resolved Alan will upstream the
>> respective code.
>>
>> Bye,
>> Michael
>>
>> On Wed, Sep 14, 2022 at 11:51 AM prelude <wg...@163.com> wrote:
>>
>> > I saw the driver code of the w5500 on Nuttx, but I did not find any
>> > routine using these driver codes. The w5500_initialize interface has
>> > not
>> > been called by any code. Have any friends used the w5500 on nuttx?
>> >
>> >
>> > int w5500_initialize(FAR struct spi_dev_s *spi_dev,
>> >                     FAR const struct w5500_lower_s *lower,
>> >                     unsigned int devno)
>> > {
>> >  FAR struct w5500_driver_s *self;
>> >
>> >
>> >
>> >
>> >
>>
>

Re: How to use the w5500 network module?

Posted by Alan Carvalho de Assis <ac...@gmail.com>.
Hi Prelude and Michael,

Yes, I'm adding W5500 to ESP32-S2 to test the SPI driver that I implemented
and because I was facing some issues on it I decided to test on
STM32F4Discovery board. I'll submit the PR to mainline.

I got it working, but for some reason it is stopping after 5 pings:
https://pastebin.com/raw/8VqpxfMw

This behavior is consistent, everytime I reset the board it stops after 5th
ping.

Which board are you planning to use?

BR,

Alan

On Wednesday, September 14, 2022, Michael Jung <mi...@secore.ly>
wrote:

> Hello,
>
> I did implement the w5500 device driver, but I am only using it on a
> proprietary custom board at the moment.  Alan is currently working on using
> the w5500 with the STM32F4Discovery board.  Apparently there are still some
> issues, but I guess once those are resolved Alan will upstream the
> respective code.
>
> Bye,
> Michael
>
> On Wed, Sep 14, 2022 at 11:51 AM prelude <wg...@163.com> wrote:
>
> > I saw the driver code of the w5500 on Nuttx, but I did not find any
> > routine using these driver codes. The w5500_initialize interface has not
> > been called by any code. Have any friends used the w5500 on nuttx?
> >
> >
> > int w5500_initialize(FAR struct spi_dev_s *spi_dev,
> >                     FAR const struct w5500_lower_s *lower,
> >                     unsigned int devno)
> > {
> >  FAR struct w5500_driver_s *self;
> >
> >
> >
> >
> >
>

Re: How to use the w5500 network module?

Posted by Michael Jung <mi...@secore.ly>.
Hello,

I did implement the w5500 device driver, but I am only using it on a
proprietary custom board at the moment.  Alan is currently working on using
the w5500 with the STM32F4Discovery board.  Apparently there are still some
issues, but I guess once those are resolved Alan will upstream the
respective code.

Bye,
Michael

On Wed, Sep 14, 2022 at 11:51 AM prelude <wg...@163.com> wrote:

> I saw the driver code of the w5500 on Nuttx, but I did not find any
> routine using these driver codes. The w5500_initialize interface has not
> been called by any code. Have any friends used the w5500 on nuttx?
>
>
> int w5500_initialize(FAR struct spi_dev_s *spi_dev,
>                     FAR const struct w5500_lower_s *lower,
>                     unsigned int devno)
> {
>  FAR struct w5500_driver_s *self;
>
>
>
>
>

How to use the w5500 network module?

Posted by prelude <wg...@163.com>.
I saw the driver code of the w5500 on Nuttx, but I did not find any routine using these driver codes. The w5500_initialize interface has not been called by any code. Have any friends used the w5500 on nuttx?


int w5500_initialize(FAR struct spi_dev_s *spi_dev,
                    FAR const struct w5500_lower_s *lower,
                    unsigned int devno)
{
 FAR struct w5500_driver_s *self;