Embedded Freaks..

February 19, 2009

Programming Timeout under FreeRTOS

Filed under: programming-tips — Tags: — kunilkuda @ 11:23 am

It seems like the FreeRTOS has some support to program a timeout, but unpublished anywhere. I’ve checked the FreeRTOS source code, regarding the usage, and it seems like it’s quite safe to use it under user’s application.

Here’s what I’ve found:

(more…)

February 10, 2009

FreeRTOS for ATMega128

Filed under: avr — Tags: — kunilkuda @ 12:01 pm

FreeRTOS is free open source RTOS that supports several architectures. You can get its source code here. This post is my port for my ATMega128 board. It may run on your board (or may not). (more…)

Removing Unused Functions/Dead Codes with GCC/GNU-ld

Filed under: embedded-tips — Tags: — kunilkuda @ 10:25 am

I was suprised to know that GCC failed to remove the dead codes from my program. Here’s an example:

kunil@cerpelai:~/Temp$ vi test.c
#include

void unusedFunction(void) {
  printf(“This is a dead code\n”);
}

int main(void) {
  printf(“Hello world\n”);
  return 0;
}

kunil@cerpelai:~/Temp$ gcc -Os test.c -o test.elf

If you take a look carefully on the ELF binary, you can see that GCC still includes the “unusedFunction()”, although nothing refers to it.

kunil@cerpelai:~/Temp$ objdump -d test.elf

test.elf:     file format elf32-i386
….
080483c4

:
….
080483e9 :
….

So I was wondering if there’s something wrong with GCC (or GNU-ld), or should I add something to remove it.
(more…)

Older Posts »

Blog at WordPress.com.