Hi all, I' m trying to make a modified version of the Arduino bootloader but I have a problem; I need to read serial data incoming from UART1 (mega1280) and I can't find out how to include arduino serial libraries in a c program. Any answer or suggestion will be very appreciated.
Are you saying that you don't want to use serial 0 to boot, but serial 1 instead?
I think if that's the case, you need to modify the bootloader source to change the definitions of BL_DDR, BL_PORT etc.
I don't think you want the full serial library in there - there's only 2k bytes available, and most of that's already taken.
Edit: scratch that - have a look at the handling of 'bootuart'
You cannot use the serial class from Arduino in a bootloader. It requres too much memory and too much overhead. It also includes the "print" class. Just change the code to use the serial port 1 registers instead of serial port 0.
I am going to do a bootloader for someone else with the serial port 1. I can do one for you at the same time. What cpu speed and do you have an on board LED?