Using the simple GPIO example as application entry point

249 views
Skip to first unread message

Daniel Mesham

unread,
Jul 1, 2020, 1:16:46 PM7/1/20
to NuttX
I have adjusted the basic GPIO example such that the normal command-line arguments are hard-coded, with the devpath set to "/dev/gpout1". When I set nsh as the application entrypoint, and run my new app, it executes correctly and the GPIO pin is toggled as expected.

However, I want this app to run as soon as my device starts, so I set it as the application entry point. When I do this, it fails to open the devpath and gives an error code 2, which is "No such file or directory" according to errno.h.

It seems that I'm not able to interact with the file system unless I am using nsh. Is there a way to correct this so that I can use GPIO pins from the entrypoint app?

Alternatively, is there a better way to have my app run on startup, which still runs/loads nsh?

---

Additional details
Board: stm32l4/nucleo-l432kc

Alan Carvalho de Assis

unread,
Jul 1, 2020, 1:47:13 PM7/1/20
to nu...@googlegroups.com
Hi Daniel,

When the NSH starts it initializes some drivers through the NSH ARCHINIT.

Try to enable the Board Late Init, it should fix the issue. In the menuconfig:

RTOS Features ---> RTOS hooks ---> [*] Custom board late initialization

BR,

Alan

On 7/1/20, Daniel Mesham <daniel...@gmail.com> wrote:
> I have adjusted the basic GPIO example such that the normal command-line
> arguments are hard-coded, with the devpath set to "/dev/gpout1". When I set
>
> nsh as the application entrypoint, and run my new app, it executes
> correctly and the GPIO pin is toggled as expected.
>
> However, I want this app to run as soon as my device starts, so I set it as
>
> the application entry point. When I do this, it fails to open the devpath
> and gives an error code 2, which is "No such file or directory" according
> to errno.h.
>
> It seems that I'm not able to interact with the file system unless I am
> using nsh. Is there a way to correct this so that I can use GPIO pins from
> the entrypoint app?
>
> Alternatively, is there a better way to have my app run on startup, which
> still runs/loads nsh?
>
> ---
>
> *Additional details*
> Board: stm32l4/nucleo-l432kc
> Configuration based on: https://www.youtube.com/watch?v=VXsTLzI6idA&t=438s
>
> --
> You received this message because you are subscribed to the Google Groups
> "NuttX" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to nuttx+un...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/nuttx/d0be9e31-8b77-42c7-bffb-96456aec18bdo%40googlegroups.com.
>
Reply all
Reply to author
Forward
0 new messages