Firmware
In simple language firmware is a program/software which run in hardware , every hardware has a frimware which perform operation, It is a type of software which run in electronic devices that tells how to operate. It’s like a set of rules that control your hardware functionaly, such as your smartphone, TV.
The purpose of firmware is to make sure your device works correctly.
Design Firmware
To design firmware, in this case we take an example of ESP32:
Write Code: First Write the code for your ESP32 in a programming language called C/C++/micropython.
Compile: Check your code for errors and turn it into a file the ESP32 can understand.
Upload: Send the firmware file to your ESP32 using a computer and a USB cable, burn it or boot in hardware.
Test: Make sure your ESP32 does what you want it to do.
If you need to update, go back to step 1, then re-upload the new firmware.
After completing the above process you can test your hardware and it will work as per the functionality of your code