HI Rushikesh,

It seams your board already has the userleds support:

boards/arm/stm32h7/nucleo-h743zi2/src/stm32_userleds.c

Did you disable the CONFIG_ARCH_LEDS? The status/diagnostic LEDs
compete for the use of LEDs.

So disable it:

Board Selection  --->
    [ ] Board LED Status support

BR,

Alan

On 8/16/21, rushi ghatkar <rushighatka...@gmail.com> wrote:
> Hi,
>
> I have tried the built-in LED driver in menuconfig,  Application
> Configuration -> Examples -> LED driver example.
> But when I run that driver using picocom,it shows error,
>
> Builtin Apps:
>   leds   sh     hello  nsh
> nsh> leds
> leds_main: Starting the led_daemon
> leds_main: led_daemon started
>
> led_daemon (pid# 3): Running
> led_daemon: Opening /dev/userleds
> led_daemon: ERROR: Failed to open /dev/userleds: 2
> led_daemon: Terminating
> nsh>
>
> Please find the error image attachment.
>
> In menuconfig I have selected,
> Board Configuration ->  Board LED status report.
> Device Driver -> LED support -> LED driver -> Generic Lower Half LED Driver
>
>
> For this I need to have a board userleds file that will map the LEDs and
> will create the /dev/userleds.
> But I have searched it in the list by using this command
> *./tools/configure.sh
> -L | less*
> There is no *nucleo-h743zi2:userleds* file available.
>
> Is there any way to make it *board userled file*, so we can use it?
>
>
>
> Regards,
> Rushikesh
>
> On Mon, Aug 16, 2021 at 4:19 PM Alan Carvalho de Assis <acas...@gmail.com>
> wrote:
>
>> Please ask this question in the mailing list, it could help other
>> people in the future.
>>
>> You need to have a  board userleds file that will map the LEDs and
>> will create the /dev/userleds.
>>
>> BR,
>>
>> Alan
>>
>> On 8/16/21, rushi ghatkar <rushighatka...@gmail.com> wrote:
>> > On Mon, Aug 16, 2021 at 2:42 PM rushi ghatkar
>> > <rushighatka...@gmail.com>
>> > wrote:
>> >
>> >> Hi,
>> >>
>> >> I have tried the built-in LED driver in menuconfig,  Application
>> >> Configuration -> Examples -> LED driver example.
>> >> But when I run that driver using picocom,it shows error,
>> >>
>> >> Builtin Apps:
>> >>   leds   sh     hello  nsh
>> >> nsh> leds
>> >> leds_main: Starting the led_daemon
>> >> leds_main: led_daemon started
>> >>
>> >> led_daemon (pid# 3): Running
>> >> led_daemon: Opening /dev/userleds
>> >> led_daemon: ERROR: Failed to open /dev/userleds: 2
>> >> led_daemon: Terminating
>> >> nsh>
>> >>
>> >> Please find the error image attachment.
>> >>
>> >> In menuconfig I have selected,
>> >> Board Configuration ->  Board LED status report.
>> >> Device Driver -> LED support -> LED driver -> Generic Lower Half LED
>> >> Driver
>> >>
>> >>
>> >> Why is it still showing the error?
>> >>
>> >>
>> >> Regards,
>> >> Rushikesh
>> >>
>> >> On Fri, Aug 13, 2021 at 5:57 PM rushi ghatkar
>> >> <rushighatka...@gmail.com
>> >
>> >> wrote:
>> >>
>> >>> Hi Alan sir,
>> >>>
>> >>> Thank you for the clarification.
>> >>>
>> >>>
>> >>> Regards,
>> >>> Rushikesh
>> >>>
>> >>>
>> >>>
>> >>> On Fri, Aug 13, 2021 at 5:34 PM Alan Carvalho de Assis
>> >>> <acas...@gmail.com>
>> >>> wrote:
>> >>>
>> >>>> What do you mean by "try to make driver into app" ?
>> >>>>
>> >>>> Drivers need to be created on nuttx/drivers, not at apps/. Also you
>> >>>> cannot call a driver function directly from apps/, it is a violation
>> >>>> of the OS abstraction.
>> >>>>
>> >>>> Your application needs to open the /dev/yourdriver to read/write
>> >>>> from/to your driver.
>> >>>>
>> >>>> BR,
>> >>>>
>> >>>> Alan
>> >>>>
>> >>>> On 8/13/21, rushi ghatkar <rushighatka...@gmail.com> wrote:
>> >>>> > Hi @Alan & @Frank sir,
>> >>>> >
>> >>>> > I was also thinking the same, first check for the drivers I need
>> >>>> > and
>> >>>> then
>> >>>> > copy it and the change as per my needs.
>> >>>> > Then change  Makefiles, Make.defs, and Kconfigs  files to make the
>> >>>> driver
>> >>>> > include.
>> >>>> > Then make them an app to run on picocom.
>> >>>> >
>> >>>> > Will try to change driver as per need and try to make driver into
>> app
>> >>>> to
>> >>>> > get it run on picocom.
>> >>>> >
>> >>>> > Thanks for the information.
>> >>>> >
>> >>>> >
>> >>>> > Thanks & Regards,
>> >>>> > Rushikesh Ghatkar
>> >>>> >
>> >>>> > On Fri, Aug 13, 2021 at 5:11 PM Frank-Christian Kruegel <
>> >>>> nu...@istda.com>
>> >>>> > wrote:
>> >>>> >
>> >>>> >> Am 13.08.2021 um 10:43 schrieb rushi ghatkar:
>> >>>> >> > Hi,
>> >>>> >> >
>> >>>> >> > I have configured and installed Nuttx rtos on the
>> >>>> >> > Nucleo-H743zi2
>> >>>> board.
>> >>>> >> >
>> >>>> >> > Now I want to create my own driver. How to create our own
>> >>>> >> > driver?
>> >>>> >> >
>> >>>> >> > Has anyone created their own driver using Nuttx rtos on the
>> >>>> >> > STM32
>> >>>> >> > board?
>> >>>> >> >
>> >>>> >> > Could anybody please tell me how to start?
>> >>>> >>
>> >>>> >> Been there, done that.
>> >>>> >>
>> >>>> >> The best starting point is to look for a similar driver. I needed
>> >>>> >> drivers for ADC and DAC chips with I2C interface, so I looked for
>> >>>> those
>> >>>> >> drivers, copied one and changed it according to my needs. Then I
>> >>>> looked
>> >>>> >> into Makefiles, Make.defs, and Kconfigs, how these drivers were
>> >>>> included
>> >>>> >> an included mine in the same manner.
>> >>>> >>
>> >>>> >> The build system with make menuconfig, Makefiles and Kconfigs is
>> the
>> >>>> >> same as for the Linux kernel. Since your development platform is
>> >>>> >> Linux
>> >>>> >> anyways (this is the strongly recommended default platform) you
>> >>>> >> should
>> >>>> >> already have plenty of Linux experience and know how to customize
>> an
>> >>>> >> Linux kernel, how to use Makefiles and gcc and gdb and binutils.
>> >>>> >> If
>> >>>> you
>> >>>> >> know Linux well the step to NuttX is not so big any more.
>> >>>> >>
>> >>>> >> I started a year ago, and it took me two months to get started
>> >>>> >> with
>> >>>> own
>> >>>> >> hardware and own drivers (ok, with Linux experience since 1993
>> >>>> >> and
>> >>>> UNIX
>> >>>> >> experience since 1989).
>> >>>> >>
>> >>>> >>
>> >>>> >> Frank-Christian
>> >>>> >>
>> >>>> >
>> >>>>
>> >>>
>> >
>>
>

Reply via email to