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

[NRF] Blink LED1 after boot instead of steady ON #5094

Open
wants to merge 1 commit into
base: master
from

Conversation

@rolandvs
Copy link
Contributor

commented Sep 11, 2019

As it seems to me it does not serve any further purpose I would propose to blink the LED and get everything in a non-active state after startup.

@rolandvs rolandvs changed the title Blink LED1 after boot instead of steady ON [NRF] Blink LED1 after boot instead of steady ON Sep 11, 2019

@glennrub

This comment has been minimized.

Copy link
Contributor

commented Sep 12, 2019

@rolandvs , this may make sense, however, 200ms, isn't that a bit short to even notice?

This LED toggle was put in initially to show developers where to add python code as string in main.c, as an example, and it was convenient to use the LED object to show this as most boards have it. However, i have found this LED to be very nice all the way, to indicate that micropython is running after flashing, especially if i forget to flash the SoftDevice.

Could it at least make sense to keep it high for 1 second?
What does other ports do here (for some kind of consistency) ? Keep a steady LED or none?

@rolandvs

This comment has been minimized.

Copy link
Contributor Author

commented Sep 12, 2019

True 200ms may be to short :-)

It is good to know that mpy is running so a wink seems perfect.
The STM32 port also turns on the LEDs, but they are all off when everything is fine.

@dpgeorge

This comment has been minimized.

Copy link
Member

commented Sep 13, 2019

What does other ports do here

stm32 flashes an LED very briefly, I'd say it's shorter than 50ms, but still quite noticeable. It turns it on at the start of the boot sequence and off after executing boot.py.

@dpgeorge dpgeorge added the port-nrf label Sep 13, 2019

@glennrub

This comment has been minimized.

Copy link
Contributor

commented Sep 13, 2019

It makes sense to leave the LED in an off state after boot. And i realized also that keeping the LED on for 1 second is a bad idea, as it will significantly delay the entry into REPL. So, around 50ms makes sense.

As an alternative i tried to add a second do_str() right before entering REPL to turn the LED off again, keeping the original code to turn it on. It seems to be slightly shorter than 50ms, but looks good as well. That would align a bit with stm32 port and also prevent an active busy loop in the boot sequence.

@dpgeorge

This comment has been minimized.

Copy link
Member

commented Sep 17, 2019

To make the blink longer and not hold up any code, I'd suggest to follow stm32 and turn on the LED ASAP in the start-up process (eg just after the soft_reset: label) then turn it off just before executing boot/main.py. It would then need to be done in C, using something like led_state(&board_led_obj[0], 1) (to turn it on, and led_init() called at the very start of the boot).

@glennrub

This comment has been minimized.

Copy link
Contributor

commented Sep 17, 2019

I agree with @dpgeorge's propsal here. I believe the educational line of do_str() has achived its purpose by now, and its time for it to go in favor of a neat bootup =)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.