The /dev/userleds is created this way: ret = userled_lower_initialize("/dev/userleds");
Open your System.map and search for userled_lower_initialize, if you find it, this mean your firmware has it and the issue is probably some error during the initialization. *Please* enable the DEBUG LEDS: Build Setup ---> Debug Options ---> [*] Enable Debug Features [*] Enable Error Output [*] Enable Warnings Output [*] Low-level LED Debug Features [*] LED Driver Error Output [*] LED Driver Warnings Output [*] LED Driver Informational Output BR, Alan On 8/17/21, rushi ghatkar <rushighatka...@gmail.com> wrote: > Hi, > > How to create * /dev/userleds* ? > > I have searched for it but can't find it. > Need Help. > > > Regards, > Rushikesh Ghatkar > > On Mon, Aug 16, 2021 at 6:32 PM Alan Carvalho de Assis <acas...@gmail.com> > wrote: > >> Did you look at /dev? I think the /dev/userleds is not created. >> >> Try to enable the DEBUG LED to see that is going on. >> >> BR, >> >> Alan >> >> On 8/16/21, rushi ghatkar <rushighatka...@gmail.com> wrote: >> > Hi, >> > >> > I have changed the declaration but it still gives some warning. Please >> find >> > the attached image. >> > >> > and when I flash code and use picocom it still gives an error. Please >> find >> > the attachment. >> > >> > >> > Regards, >> > Rushikesh Ghatkar >> > >> > On Mon, Aug 16, 2021 at 5:25 PM Alan Carvalho de Assis < >> acas...@gmail.com> >> > wrote: >> > >> >> You need to declare all LEDs, including GPIO_LED_BLUE >> >> >> >> This is the pin on your board used for each LED. >> >> >> >> Please look at stm32h747i-disco/src/stm32h747i-disco.h for reference. >> >> >> >> BR, >> >> >> >> Alan >> >> >> >> On 8/16/21, rushi ghatkar <rushighatka...@gmail.com> wrote: >> >> > Hi Alan sir, >> >> > >> >> > I have disabled the status/diagnostic LEDs compete for the use of >> LEDs. >> >> > So disabled it: >> >> > Board Selection ---> >> >> > [ ] Board LED Status support >> >> > >> >> > >> >> > Yes my board does support * userleds support*: >> >> > boards/arm/stm32h7/nucleo-h743zi2/src/stm32_userleds.c >> >> > >> >> > But still it gives error, please see the error image attached. >> >> > >> >> > AR (create): libbinfmt.a binfmt_globals.o binfmt_initialize.o >> >> > binfmt_register.o binfmt_unregister.o binfmt_loadmodule.o >> >> > binfmt_unloadmodule.o binfmt_execmodule.o binfmt_exec.o >> >> > binfmt_copyargv.o >> >> > binfmt_dumpmodule.o builtin.o >> >> > make[1]: Leaving directory '/home/rushikesh/nuttxspace/nuttx/binfmt' >> >> > IN: binfmt/libbinfmt.a -> staging/libbinfmt.a >> >> > make[1]: Entering directory >> >> '/home/rushikesh/nuttxspace/nuttx/arch/arm/src' >> >> > make[2]: Entering directory >> >> > >> '/home/rushikesh/nuttxspace/nuttx/boards/arm/stm32h7/nucleo-h743zi2/src' >> >> > CC: stm32_boot.c >> >> > CC: stm32_bringup.c >> >> > stm32_bringup.c: In function 'stm32_bringup': >> >> > stm32_bringup.c:88:9: warning: implicit declaration of function >> >> > 'userled_lower_initialize' [-Wimplicit-function-declaration] >> >> > 88 | ret = userled_lower_initialize("/dev/userleds"); >> >> > | ^~~~~~~~~~~~~~~~~~~~~~~~ >> >> > CC: stm32_userleds.c >> >> > stm32_userleds.c:55:3: error: 'GPIO_LED_BLUE' undeclared here (not >> >> > in >> a >> >> > function); did you mean 'GPIO_LED_RED'? >> >> > 55 | GPIO_LED_BLUE, >> >> > | ^~~~~~~~~~~~~ >> >> > | GPIO_LED_RED >> >> > make[2]: *** [/home/rushikesh/nuttxspace/nuttx/boards/Board.mk:103: >> >> > stm32_userleds.o] Error 1 >> >> > make[2]: Leaving directory >> >> > >> '/home/rushikesh/nuttxspace/nuttx/boards/arm/stm32h7/nucleo-h743zi2/src' >> >> > make[1]: *** [Makefile:152: board/libboard.a] Error 2 >> >> > make[1]: Leaving directory >> >> '/home/rushikesh/nuttxspace/nuttx/arch/arm/src' >> >> > make: *** [tools/Makefile.unix:422: nuttx] Error 2 >> >> > >> >> > >> >> > >> >> > >> >> > Regards, >> >> > Rushikesh Ghatkar >> >> > >> >> > On Mon, Aug 16, 2021 at 4:41 PM Alan Carvalho de Assis < >> >> acas...@gmail.com> >> >> > wrote: >> >> > >> >> >> 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 >> >> >> >> >>>> >> >> >> >> >> >>>> > >> >> >> >> >>>> >> >> >> >> >>> >> >> >> >> > >> >> >> >> >> >> >> > >> >> >> >> >> > >> >> >> > >> >