Trying to port ChibiOS to ATmega64
Posted: Tue Feb 10, 2015 11:49 pm
I would like to use ChibiOS in ATmega64. The problem is, currently ChibiOS freezes on start, I'm not sure why, so I would greatly appreciate any clues or ideas.
Only change I had to make to ChibiOS compile for ATmega64 is to add these defines at the top of board.c right after its #includes:
Then I was able to successfully compile chBlink example (it supposed to blink LED with two tasks and a semaphore, it works for me on ATmega2560). Unfortunatelly, it does not work on ATmega64 because ChibiOS halts before turning on the LED.
So far I found out that ChibiOS on ATmega64 fails to reach chSetup() function after chBegin(chSetup) call (I tried to place code to turn on the LED in the beginning of chSetup, it never lights up).
I would appreciate any ideas why ChibiOS could halt somewhere within chBegin() function or how to debug this issue...
Only change I had to make to ChibiOS compile for ATmega64 is to add these defines at the top of board.c right after its #includes:
Code: Select all
#if defined(__AVR_ATmega64__)
#define OCIE0A OCIE0
#define OCR0A OCR0
#define TIMSK0 TIMSK
#endifThen I was able to successfully compile chBlink example (it supposed to blink LED with two tasks and a semaphore, it works for me on ATmega2560). Unfortunatelly, it does not work on ATmega64 because ChibiOS halts before turning on the LED.
So far I found out that ChibiOS on ATmega64 fails to reach chSetup() function after chBegin(chSetup) call (I tried to place code to turn on the LED in the beginning of chSetup, it never lights up).
I would appreciate any ideas why ChibiOS could halt somewhere within chBegin() function or how to debug this issue...