CAN Bootloader for ATMega16m1
This repository holds the code for the CAN bootloader for the ATMega16m1 microcontroller.
The code lives in /src/
. main.c
contains a "dummy" image for the
microcontroller: a simple blinky program. btldr.c
is the bootloader image.
config.h
should be used for any configuration variables.
/old/
contains the bootloader we are basing ours off of, which comes from
Atmel.
/lib/
contains the libraries that we are writing. These are the libraries:
- CAN_drv: CAN driver (interfaces with the registers and such) CAN_lib:
- Provides higher-level interface for CAN, like
send
andget_message
- CAN_isp: Defines CAN messages that are used to program the target board
- ISP: In-system-programming library for programming Flash_drv: Drivers
- for interfacing with flash memory Flash_lib: Library (higher level) for
- doing flashing
Please help us! Below you'll see the ToDo section. To make a
contribution, make your changes locally and submit a PR. As a part of your PR,
change the [ ]
in your todo item to a [x]
to indicate that it has been
done. Please do one [x]
per PR.
- Update
can_isp_commands
to useboot_page_fill
instead oftemp_buffer
- Update to use builtin crc16
- Client
- Reset handling (how to have ECUs reset themselves--just jump to boot start?)
- How to handle a common CAN command handling for all ECUs (to listen for reset)
Page 80:
Note: If Interrupt Vectors are placed in the Boot Loader section and Boot Lock bit BLB02 is programmed, interrupts are disabled while executing from the Application section. If Interrupt Vectors are placed in the Application section and Boot Lock bit BLB12 is programmed, interrupts are disabled while executing from the Boot Loader section.
Do we need to disable interrupts? Where should the interrupts be located?
Would be nice to have a #define LED1 PB0
pattern so that we can always refer
to LED1
and use #ifdefs
to do things like blink an LED if there is an
error, or set one as the error LED.
- Compile-time
- Image size
- CRC
- Flash-time
- Timestamp
- Both
- Verify image magic