Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to use LED example on STM32 Nucleo-F446RE board #15693

Closed
1 task done
maitiSoutrik opened this issue Jan 25, 2025 · 14 comments
Closed
1 task done

Unable to use LED example on STM32 Nucleo-F446RE board #15693

maitiSoutrik opened this issue Jan 25, 2025 · 14 comments
Labels
Community: Question Further information is requested

Comments

@maitiSoutrik
Copy link

maitiSoutrik commented Jan 25, 2025

Description

I have the following led configuration :

# CONFIG_ARCH_LEDS is not set
# LED Support
CONFIG_USERLED=y
CONFIG_USERLED_LOWER=y
# CONFIG_USERLED_LOWER_READSTATE is not set
# CONFIG_USERLED_EFFECTS is not set
# CONFIG_LEDS_APA102 is not set
# CONFIG_LEDS_MAX7219 is not set
# CONFIG_RGBLED is not set
# CONFIG_DRIVERS_POWERLED is not set
# CONFIG_ARCH_PHY_POLLED is not set
CONFIG_EXAMPLES_LEDS=y
CONFIG_EXAMPLES_LEDS_PROGNAME="leds"
CONFIG_EXAMPLES_LEDS_PRIORITY=100
CONFIG_EXAMPLES_LEDS_STACKSIZE=2048
CONFIG_EXAMPLES_LEDS_DEVPATH="/dev/userleds"
CONFIG_EXAMPLES_LEDS_LEDSET=0x01
# CONFIG_EXAMPLES_LEDS_RUST is not set
# CONFIG_EXAMPLES_LEDS_ZIG is not set
# CONFIG_EXAMPLES_RGBLED is not set

When I build and flash the firmware on the board and access the nsh shell, I don't see the /dev/userleds
furthermore the leds example doesn't work.

NuttShell (NSH) NuttX-12.8.0
nsh> ?
help usage:  help [-v] [<cmd>]

    .           cd          exit        mkrd        sleep       unset       
    [           cp          expr        mount       source      uptime      
    ?           cmp         false       mv          test        usleep      
    alias       dirname     help        printf      time        watch       
    unalias     dd          hexdump     pwd         true        xd          
    basename    dmesg       kill        rm          truncate    
    break       echo        ls          rmdir       uname       
    cat         exec        mkdir       set         umount      

Builtin Apps:
    leds      nsh       ostest    sh        
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

I tried looking through some PRs for other controllers
11169
15422

But this is also not helping.
Any leads on using LED on Nucleo-F446RE board

Verification

  • I have verified before submitting the report.
@maitiSoutrik maitiSoutrik added the Community: Question Further information is requested label Jan 25, 2025
@acassis
Copy link
Contributor

acassis commented Jan 26, 2025

@yashvi-05 I think you faced similar issue recently with this board, could you please help here?

@acassis
Copy link
Contributor

acassis commented Jan 26, 2025

@maitiSoutrik you need to do: ls /dev to confirm that /dev/userleds was created.

Probably it is not created during the board initialization

@maitiSoutrik
Copy link
Author

Hi @acassis , you are right. It's not being created.

@ldube
Copy link
Contributor

ldube commented Jan 27, 2025

Does it get to this line in your stm32_bringup?
ret = userled_lower_initialize("/dev/userleds");

@yashvi-05
Copy link

yashvi-05 commented Jan 27, 2025 via email

@yashvi-05
Copy link

Also, type 'ls /dev' in Minicom and tell me the options that are visible.

@maitiSoutrik
Copy link
Author

Hi @yashvi-05 ,

I followed the steps :

  1. make distclean

  2. ./tools/configure.sh nucleo-f446re:nsh

  3. make menuconfig

I selected the following from menuconfig :

  • Device Drivers -> LED Support
    [ * ] LED Driver
    [ * ] Generic Lower Half LED Driver

  • Application Config -> Examples
    [ * ] LED driver example

  1. make -j8 && st-flash --connect-under-reset write nuttx.bin 0x08000000

I am using picocom to view the terminal

nsh>
nsh> ls /dev
/dev:
 console
 null
 ttyS0
 zero
nsh>

As you can see the /dev/userleds is not there.

@raiden00pl
Copy link
Member

most likely you are missing board initialization. Try with CONFIG_NSH_ARCHINIT=y.
This is probably the most common issue with NuttX and new users: #11321

@maitiSoutrik
Copy link
Author

most likely you are missing board initialization. Try with CONFIG_NSH_ARCHINIT=y. This is probably the most common issue with NuttX and new users: #11321

Hey thanks a lot @raiden00pl ! Worked like a charm 👍🏾

@acassis
Copy link
Contributor

acassis commented Jan 27, 2025

@raiden00pl I think after the board initialization "simplification" we could keep the board bring-up initialization called by default to avoid issues like this

@ldube
Copy link
Contributor

ldube commented Jan 27, 2025

@raiden00pl I think after the board initialization "simplification" we could keep the board bring-up initialization called by default to avoid issues like this

Who is working on this "simplification"? Can you provide a link?

@maitiSoutrik
Copy link
Author

@raiden00pl I think after the board initialization "simplification" we could keep the board bring-up initialization called by default to avoid issues like this

Who is working on this "simplification"? Can you provide a link?

Can I also contribute?

@raiden00pl
Copy link
Member

@ldube Probably no one is working on it yet. We are still in the discussion stage: #11321

This is a big change and it would be nice to have more pros and cons from the community, but it seems like there aren't many people interested in this issue.

@acassis
Copy link
Contributor

acassis commented Jan 27, 2025

@raiden00pl I think after the board initialization "simplification" we could keep the board bring-up initialization called by default to avoid issues like this

Who is working on this "simplification"? Can you provide a link?

Can I also contribute?

Sure, all ideas, suggestions and, of course, code is welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Community: Question Further information is requested
Projects
None yet
Development

No branches or pull requests

5 participants