Page 1 of 1
ATMega128 creating new board
Posted: Fri Jun 14, 2013 4:33 pm
by MacGyver
Hi All,
I developed a board which use ATMega128 microcontroller and I need to use multitasking, and my choice was using ChibiOS.
I used ChibiOS_2.6.0/demos/AVR-ATmega128-GCC as base, I removed the Serial Communication and Second Thread, so just the main() running ( it should run

), but it looks like then the uC goes to infinity loop when the halInit() executed before the main(). I modified the board.h and board.c (ChibiOS_2.6.0/boards/OLIMEX_AVR_MT_128), but I just modified the Pin configuration that which pin is input or output. I keep the TIMER0 interrupt settings and anything else. The Clock of the uC comes from a 16MHz Crystal, I set the fuses correctly.
The source compiled without any warning or error.
Have somebody any idea, why it is goes down?
If anybody need further information about the problem please let me know.
Thanks in advance.
Regards,
Gergo
Re: ATMega128 creating new board
Posted: Fri Jun 14, 2013 5:05 pm
by Giovanni
Hi,
Changing the board files should be sufficient, where exactly the code hangs? you should be able to see that using the debugger. You may also try posting the diffs with the standard demo.
Giovanni
Re: ATMega128 creating new board
Posted: Fri Jun 14, 2013 5:20 pm
by MacGyver
Hi Giovanni,
Unfortunately I don't have debugger, so I cannot check it. I Set a Pin to high inside the IRQ handler for debugging, and I saw that no interrupt occured.
Gergo
Re: ATMega128 creating new board
Posted: Fri Jun 14, 2013 7:58 pm
by Giovanni
Hi,
It is hard to give advice without info, I tested that AVR demo just before the 2.6.0 release so the problem is likely:
1) In the code changes.
2) Possible differences in toolchain.
Code: Select all
***************************************************************************
Options: -O2
Settings: F_CPU=16000000
***************************************************************************
*** ChibiOS/RT test suite
***
*** Kernel: 2.6.0
*** Compiled: May 19 2013 - 14:51:33
*** Compiler: GCC 4.3.0
*** Architecture: AVR
*** Core Variant: MegaAVR
*** Port Info: None
*** Platform: ATmega128
*** Test Board: Olimex AVR-MT-128
----------------------------------------------------------------------------
--- Test Case 1.1 (Threads, enqueuing test #1)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.2 (Threads, enqueuing test #2)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.3 (Threads, priority change)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 1.4 (Threads, delays)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.1 (Semaphores, enqueuing)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.2 (Semaphores, timeout)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.3 (Semaphores, atomic signal-wait)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 2.4 (Binary Semaphores, functionality)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.1 (Mutexes, priority enqueuing test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.2 (Mutexes, priority inheritance, simple case)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.3 (Mutexes, priority inheritance, complex case)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.4 (Mutexes, priority return)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.5 (Mutexes, status)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.6 (CondVar, signal test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.7 (CondVar, broadcast test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 3.8 (CondVar, boost test)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 4.1 (Messages, loop)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 5.1 (Mailboxes, queuing and timeouts)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.1 (Events, registration and dispatch)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.2 (Events, wait and broadcast)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 6.3 (Events, timeouts)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 10.1 (Queues, input queues)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 10.2 (Queues, output queues)
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.1 (Benchmark, messages #1)
--- Score : 32012 msgs/S, 64024 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.2 (Benchmark, messages #2)
--- Score : 25300 msgs/S, 50600 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.3 (Benchmark, messages #3)
--- Score : 25300 msgs/S, 50600 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.4 (Benchmark, context switch)
--- Score : 90704 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.5 (Benchmark, threads, full cycle)
--- Score : 19890 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.6 (Benchmark, threads, create only)
--- Score : 25343 threads/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.7 (Benchmark, mass reschedule, 5 threads)
--- Score : 7982 reschedules/S, 47892 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.8 (Benchmark, round robin context switching)
--- Score : 59840 ctxswc/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.9 (Benchmark, I/O Queues throughput)
--- Score : 91888 bytes/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.10 (Benchmark, virtual timers set/reset)
--- Score : 85722 timers/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.11 (Benchmark, semaphores wait/signal)
--- Score : 227564 wait+signal/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.12 (Benchmark, mutexes lock/unlock)
--- Score : 116724 lock+unlock/S
--- Result: SUCCESS
----------------------------------------------------------------------------
--- Test Case 11.13 (Benchmark, RAM footprint)
--- System: 235 bytes
--- Thread: 32 bytes
--- Timer : 10 bytes
--- Semaph: 5 bytes
--- EventS: 2 bytes
--- EventL: 6 bytes
--- Mutex : 8 bytes
--- CondV.: 4 bytes
--- Queue : 18 bytes
--- MailB.: 18 bytes
--- Result: SUCCESS
----------------------------------------------------------------------------
Final result: SUCCESS
Note the compiler version, is yours different?
Giovanni
Re: ATMega128 creating new board
Posted: Sat Jun 15, 2013 11:19 am
by MacGyver
Hi,
I checked the version of GCC, it is 4.6.3, so I will try it on 4.3.0, thanks for the tip. ( I am using the makfile for build )
I have found a hardware issue during the tests (but it independs of the software issues), so now I need to work on it firstly, after that I can check the software issues...
I will post if I have new results...
Thanks,
Gergo