On 2024-07-09 09:49:16, Alan C. Assis wrote:
> I think many people outside our community have a misconception about NuttX:
> They think it is a Linux/Unix RTOS that needs to have a shell integrated
> into it.
>
> Note that all boards are required to have a "nsh" board profile, it was a
> suggestion/requirement to confirm that the system works correctly. There is
> not wrong with it, but it sends a message that NuttX needs it to exist.
>
> How to fix it?
I think I would be good if nuttx had something like /sbin/init that would
do some very simple service management. Then you could just tick
"Start NSH after boot up". Programs would probably be had to added via
some compile-time header file that would look like that:


| struct program
| {
|     const char *name;
|     int         priority;
|     int         stack_size;
|     main_t      entry_point;
|     int         pid;
| };
|
| struct program programs[] =
| {
| #ifdef CONFIG_EXAMPLES_NSH
|     { "console", 50, 2048, nsh_consolemain },
| #endif

| #ifdef CONFIG_SOME_DAEMON
|     { "some-custom-daemon", 50, 2048, daemon_function },
| #endif

|     { NULL, 0, 0, NULL }
| };

And program in its simplest form would do:

| #include <rc/rc.h>
| int main(int argc, char *argv[]) {
|     for (int i = 0; programs[i].name != NULL; ++i) {
|         struct program *p = &programs[i];
|         printf("starting: %s\n", p->name);
|         p->pid = task_create(p->name, p->priority, p->stack_size,
|                 p->entry_point, NULL);
|     }
|     for (;;) sleep(UINT_MAX);
| }

I think such init could also handle all initialization code (so not only
starting up daemons). It could be more clear than current board initialization
routines which are a little bit confusing (for me at least).

That would solve 2 problems. It would be very clear that NSH is not needed, and
user would have an easy way to start it's own daemons/applications.

> Suggestions about how to proceed to archive it are welcome.
> Probably we will need collective help to archive it for all boards.

Other problem I've seen is bad (or rather lack thereof) press. Each time
I propose nuttx for some project it's a lot of hesitance and ultimately
decision to go with zephyr becuase it "supports more things". Which is
a lie, because with my experience zephyr has a lot of demos just to show
off "how many things they support". But it's all demo and nor production
quality. Nevertheless - this sells. And later when it's clear that zephyr
was lying - it's too late to go with anything else because months of work
was already put into zephyr, so noone will start over.

So nuttx definiately lacks press and exposure. Basically noone I worked with
heard about nuttx until I mentioned that. A lot of programmers are hyped
when I explain what and how it does things - but it all ends up with zephyr
because of "all the supported hardware it has".

For ppl to consider nuttx, they first need to hear about it. People (especially
useless managers) will need benchmarks - like how much flash/ram it uses.
How it performs. Will their hardware be supported.

It would not hurt for things to be more user friendly. I admit, initializing
zephyr is easy. Unpack SDK, west init, compile, flash and you are done.
And nuttx? Download and put compiler in path. Clone nuttx AND apps in same
directory. Configure. Compile. Learn your debugger to flash. On zephyr you
do 'west flash' and it knowns which discovery board is used and it uses
apropriate tool and arguments. This is good, I will admit it.

So nuttx would need some SDK in my opinion. Package with binary compilers and
flash utilities. "make flash" should just perform flash on specific board
without user knowing what tools is needed. "make debug" should start GDB
session.

A lot of beginners will be put off becuase of things like that. If they could
just do "./install-sdk.sh && ./init-nuttx && cd nuttx &&
./tools/configure.sh nucleo-whatever && make && make flash" and start playing
around - this would definiately help getting beginners.

Anegdotal (but still) proof. 10 years ago I was researching RTOSes. I really
wanted to use nuttx on stm32 back then. But I had a lot of problems just
compiling and running anything on discovery board. I was kinda put off, team
leader decided to screw it and go with another solution. I finally learnt it
at home and love it ever since, but damage was already done and nuttx in that
project was forgotten.

Sorry for long post, here's a potato: 🥔

-- 
.-----------------.-------------------.----------------------.-----------------.
| Michal Lyszczek | Embedded C, Linux |   Company Address    |  .-. opensource |
| +48 727 564 419 | Software Engineer | Akacjowa 10a; 55-330 |  oo|  supporter |
| https://bofc.pl `----.--------------: Brzezinka Sredzka PL | /`'\      &     |
| GPG FF1EBFE7E3A974B1 | Bits of Code | NIP:   813 349 58 78 |(\_;/) programer |
`----------------------^--------------^----------------------^-----------------'

Attachment: signature.asc
Description: PGP signature

Reply via email to