58 votes
Accepted

Why do we need a bootloader separate from our application program in microcontrollers?

A bootloader on a microcontroller is responsible for updating the main firmware over a communication channel other than the programming header. This is useful for updating firmware in the field over ...
CurtisHx's user avatar
  • 997
27 votes

Why do we need a bootloader separate from our application program in microcontrollers?

So that the loading process can recover from errors. Suppose there is a communication error or power disconnects during an upgrade. If the boot loader were part of the application you were upgrading ...
user4574's user avatar
  • 12.2k
20 votes
Accepted

How does factory reset work?

Generally speaking the factory reset function you mention will restore any saved variable data information back to default values. It is not true that all embedded devices have this capability. Some ...
Michael Karas's user avatar
17 votes

What is the purpose of a microcontroller bootloader?

The main purpose of a bootloader is to allow updating the firmware through interfaces other than the default hardware interface. For example, this allows updates via communication channels that the ...
Dave Tweed's user avatar
  • 173k
11 votes

How does factory reset work?

If you take the most common example of factory defaults, it's your PC's UEFI (BIOS). It is made with a flash chip and a volatile battery backup SRAM memory chip. The flash chip contains the program, ...
Jeroen3's user avatar
  • 23k
11 votes

Why do we need a bootloader separate from our application program in microcontrollers?

They're generally there to allow you to update your main application program. You need some code which knows how to erase and reprogram some of the internal flash, that can't be the main program as ...
Colin's user avatar
  • 4,549
10 votes

What is the purpose of a microcontroller bootloader?

There are some scenarios where a boot loader doesn't add much value. You are right if you have a couple of boards you can certainly attach the programmer and flash the code again. If you are a ...
m4l490n's user avatar
  • 345
10 votes

How does factory reset work?

Factory reset is whatever you want it to be. It depends on the application and device type. I usually do two things: Ensure that there is always a reliable way to enter the bootloader, so that even ...
filo's user avatar
  • 8,951
10 votes

What's the difference between a generated hex file and a binary file in embedded systems?

There are MANY different file formats that all accurately represent the term "binary". When you compile a printf("Hello World!\n"); program on your computer that is a binary but the binary contains ...
old_timer's user avatar
  • 8,273
10 votes
Accepted

STM32 won't enter bootloader

The MCU most likely enters bootloader just fine. It just won't show up as an USB device, as the STM32F103 built-in bootloader has no USB support. This can be verified from the AN2606 you mentioned. It ...
Justme's user avatar
  • 149k
9 votes

Why do we need a bootloader separate from our application program in microcontrollers?

The bootloader allows the MCU to communicate with something else to accept a new program, store it, and run it after a reset. If you didn't have a bootloader, then a Programmer is needed to access ...
CrossRoads's user avatar
  • 3,581
8 votes

Why do we need a bootloader separate from our application program in microcontrollers?

In addition to the other correct answers about allowing reprogramming of the main firmware from the bootloader, another benefit of having the bootloader be separate is that you can logically separate ...
Nate S.'s user avatar
  • 700
7 votes

How we can share a function between main application and bootloader?

This is happening constantly in your computer. .dll and .so files are basically code that is not compiled into your program, but contains functions that your program calls. Whichever direction you ...
old_timer's user avatar
  • 8,273
6 votes
Accepted

Is a boot-loader needed to dump the flash memory to RAM? Why?

"Boot loader" has many different meanings. In some (generally slower) microcontrollers the instruction data is stored within on-chip flash memory and executed directly from there. This obviously ...
jms's user avatar
  • 8,641
6 votes
Accepted

How to write a bootloader and drivers for ATtiny167

From reading through your question, and having looked through the micronucleus repository, your problem is down to fuses/clocks. Firstly, and while not immediately obvious (not documented anywhere ...
Tom Carpenter's user avatar
6 votes

Atmel Chip not recognized as USB device. How to troubleshoot

Leaving the Vbus pin floating seems a bit strange. The datasheet shows this configuration: None of the configurations shown in the datasheet leaves the Vbus pin floating. Just try connecting it up ...
Richard the Spacecat's user avatar
6 votes
Accepted

Is it possible to replace STM32F407 Internal Bootloader

No, it is baked into the chip at manufacture time. You can however write your own bootloader which you store in the microcontroller's flash and will be executed at power on or reset. There are a ...
Colin's user avatar
  • 4,549
6 votes
Accepted

STM32 programming and BOOT0 pin

If you're making a board, why not provide for a resistor/jumper to connect Boot0 to +V and GND? Then only populate one of them? Leave your options open. You don't need a resistor. I prefer to use a ...
DKNguyen's user avatar
  • 56.7k
6 votes

STM32 programming and BOOT0 pin

I won't be using the bootloader but can it happen that I accidentally disable the debug port from software and then can't program the MCU via SWD anymore and need to use bootloader mode by putting ...
Chris Stratton's user avatar
5 votes

ARM Cortex M3 firmware

Are you certain you can't access the SWD pins on the device? It seems unlikely that the manufacturer would have a part that they are unable to debug themselves. Its not like they have shown any ...
Sean Houlihane's user avatar
5 votes
Accepted

Which boot mode does the STM32F0 discovery kit use?

I recommend you to read the STM32F0 Discovery kit's documentation as it holds many answers for many uprising questions. More documentation can be found here. But to help you out with this one, this ...
Bence Kaulics's user avatar
5 votes
Accepted

Burn Micronucleus bootloader to use ATtiny85 via USB (AVRDUDE)

You probably found a solution by now, but for others: in order to use an ATTiny85 with micronucleus via USB, you need a micronucleus driver installed, then you can use Arduino IDE if you want - simply ...
Eisen Faust's user avatar
5 votes

Programming STM32: JTAG/SWD vs bootloader

Yes. Many STM32 devices come with built-in bootloader. See the documentation on how to trigger it. This is often done by tying a pin high during power up. You will also need to read the datasheet on ...
Vince Patron's user avatar
  • 3,606
5 votes

Upgrade user application using custom bootloader via UART (STM32)

You want to write your own bootloader but you cite the app note for the built in one. Forget this one. Write the bootloader and read only the Reference Manual. Forget the built in bootlader and its "...
0___________'s user avatar
  • 2,585
5 votes
Accepted

Application and bootloader written in different tools can not be compatible?

You're right — in principle, the bootloader shouldn't care what tools are used to create the application code. As far as it is concerned, the application is just "a bag of bits". However, the ...
Dave Tweed's user avatar
  • 173k
5 votes
Accepted

Linker script and data allocation

Ask yourself how could the system work if it isn't true? In most implementations, the .data segment is for initialized data, where ...
TimWescott's user avatar
  • 46.2k
5 votes
Accepted

How to enter bootloader on a Embedded Linux System with no keyboard?

What you have is not a "microcontroller" but rather an Embedded Linux System built around an Arm Cortex A8 "System on a Chip" (SOC) Pressing space at startup is typically the behavior of a human-...
Chris Stratton's user avatar
5 votes
Accepted

Getting started with AVR programming concepts

AVR microcontrollers (and most modern ┬ÁC) contain special hardware specifically for programming directly using a combination of the SPI port (called ISP for this special case) and the reset pin. This ...
evildemonic's user avatar
  • 9,209
5 votes
Accepted

STM32 applications hardfault after jumping from the bootloader

it does jump to address 0x8005004 This is the source of your problem - you're trying to jump to 0x08005004. That address does not contain any code - it contains the address of your reset handler (...
brhans's user avatar
  • 14.7k

Only top scored, non community-wiki answers of a minimum length are eligible