This article is in continuation of ARM Bare-metal Programming . This explains what is the significance of blinking LED in Embedded System.
Hello Hardware
If someone starts any programming language , The first program usually printing of “Hello World” . This is very simple but it is basically sanity check of your build tools and running environment. Similarly LED blinking example is not only a sanity check of basic program execution in hardware but sanity check of hardware itself at the time of board bring-up.
LED blinking during board bring-up ?
I have used while(1) as a breakpoint in many debugging cases where JTAG based debugging was not possible. One can use blinking of different LEDs if there is no other option like printf or other debugging tool options.
I also came across use cases where system was working under JTAG control but not independently. There also some time I tried blinking LED option and later the issue was found in Power-ON RESET circuit and system was working due to JTAG based RESET signal.
Based on this, I can conclude that Blinking LED program can be used later also for hardware debugging. That makes it more important than “Hello World” used to learn programming language.
Using Board Use LED for testing purpose
If your LED blinking program fails in first attempt , You will have opportunity to learn more around hardware. In Embedded, sometime it is good to fail -) . You may realize this after watching following video .
Lets see what it takes to blink LED in ARM based STM32 Nucleo board.
The code in the above video provides following outcome :
You may find interesting topics at HowTo
Thanks for reading till end. Please provide your feedback regarding this article. Also subscribe Embedkari for other interesting topics. .
Embedkari has introduced its first low cost technical training .