michallenc commented on issue #4188:
URL: 
https://github.com/apache/incubator-nuttx/issues/4188#issuecomment-883605655


   Hello,
   
   I think the problem is that you do not register the device /dev/userleds/ in 
board level code. If you take a look into this part of code for Teensy 4.1 
board 
https://github.com/apache/incubator-nuttx/blob/master/boards/arm/imxrt/teensy-4.x/src/imxrt_appinit.c#L72,
 you can see that I call function userled_lower_initialize(LED_DRIVER_PATH) 
where LED_DRIVER_PATH is "/dev/userleds". That part of the code registers the 
device. 
   
   If you write something like that into 
boards/arm/stm32h7/nucleo-h743zi/src/stm32_appinitialize.c, then it should do 
the trick. If you then run NuttX and execute command "ls dev/", you should see 
"userleds" there and the application should also be working. You also have to 
turn off CONFIG_ARCH_LEDS (this options use the led to show the status of NuttX 
- if it is turn on, NuttX is running, if the led is blinking then there was 
some problem with booting) in order to use user led.
   
   I actually had the exactly same issue when I was beginning with NuttX. :)
   
   Most of the NuttX peripherals have to be registered in board level section. 
It is usually done by calling function in architecture level and/or registering 
the device. If you take a look at this file 
https://github.com/apache/incubator-nuttx/blob/master/boards/arm/stm32h7/nucleo-h743zi/src/stm32_pwm.c,
 the pwm is initialized by calling stm32_pwminitialize() which is defined in 
arch/arm/src/stm32h7/stm32_pwm.c and then the device is register by 
pwm_register("/dev/pwm0", pwm) which is defined in drivers/timers/pwm.c. The 
same process is usually done with other peripherals (CAN, encoder, I2C and so 
on).
   
   I hope this helps.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to