Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Editing Boot Loader Arduino 328P 16Mhz 5V

Status
Not open for further replies.

Kalari

New Member
My project contains a module which reads memory (SRAM) values of a device during start up (When Power is ON or reset button is pressed). So what I did was , I tried to edit the boot-loader of Arduino Atmega 328P 16 Mhz 5v.

The boot-loader called Optiboot downloaded from https://code.google.com/p/optiboot/ . What I did was, I edited the Optiboot.c file available in the downloaded files with necessary header files, compile it using AVR studio4 and get the hex code. This hex code is burned into arduino device.

My problem is, when I burn the edited boot-loader file into device it is not working. My Boot-Loader size i s 778 bytes.

Another problem is the BAUD_ERROR is always showing greater than 5% error . Also could you please give me what is my fuse settings for the given device. Is I am going in the right direction.

Hope you will definitely help me to sort out this issues.
 
You didn't explain anything but "I edited this bootloader and now it is not working".

Could you explain in more detail what you want the bootloader to do. And post the code that does not work. What are your fuse settings now?
 
My project contains a module which reads memory (SRAM) values of a device during start up (When Power is ON or reset button is pressed). So what I did was , I tried to edit the boot-loader of Arduino Atmega 328P 16 Mhz 5v.

Does it have to be that quick.... Are you using the arduino platform for programming or are you using AVR studio?

I'm sure you could still read the locations after the bootloader has timed out!!
 
What I did was, I edited the Optiboot.c file available in the downloaded files with necessary header files, compile it using AVR studio4 and get the hex code.

That might be a problem. You should use the latest toolchain. AVR Studio 4 is very old. The latest version is Atmel Studio 6.2.

And I still do not understand why you need to read SRAM using bootloader. SRAM is initialized after you leave the bootloader and execute the actual application (.init4 section of the code). All you can read using bootloader is 0xFF or variables that are initialized for your bootloader code (after Power-on reset.. after External reset the situation might be different).

If you need to do something with the SRAM, put your code in one of the .initN sections.
Here is documentation and example how: https://www.nongnu.org/avr-libc/user-manual/mem_sections.html
 
Last edited:
The optiboot is optimized for 512 bytes of memory and adding even a bit more will seriously impact the chip. So you have to be double sure of the code size. FYI there is a make.bat file in the optiboot you can invoke that from the command prompt.
 
The optiboot is optimized for 512 bytes of memory and adding even a bit more will seriously impact the chip.

I understand that larger bootloader needs a larger bootloader memory section, but how else does larger program size affect the performance or quality of the bootloader? Never heard that program does not work because it is too large (assuming it still fits the memory it can address).
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top