Hello all,

I'm trying to run a small application that should active a Led on
M5235EVB (Coldfire), this is my code:

 

#include <stdio.h>

 

#define MCF_IPSBAR   0x40000000

 

#define MCF_GPIO_PODR_TIMER                  0x0000000B

#define MCF_GPIO_PDDR_TIMER                  0x0000001B

#define MCF_GPIO_PPDSDR_TIMER              0x0000002B

#define MCF_GPIO_PCLRR_TIMER                 0x0000003B

#define MCF_GPIO_ASS_TIMER                     0x0000004C

 

 

unsigned char *PT_Direction;

unsigned char *PT_Assign; 

unsigned char *PT_Set; 

 

int main(void)

{

  printf("Go to registers!!!\n");

  PT_Direction               = (unsigned char *)(MCF_IPSBAR +
MCF_GPIO_PODR_TIMER);

  PT_Assign                 = (unsigned char *)(MCF_IPSBAR +
MCF_GPIO_ASS_TIMER);

  PT_Set                       = (unsigned char *)(MCF_IPSBAR +
MCF_GPIO_PPDSDR_TIMER);

  printf("Write in the registers!!!\n");

  *PT_Direction             = 0xff;

  *PT_Assign    = 0;

  *PT_Set = 0xff;

  printf("Dome Test!!!\n");

  return 0;

}

 

The output on console is:

 

Go to registers

Write in the registers

 

but the application is finished before to reach the end, I don't see the
output "Dome Test" and the leds is not actived, seem that  when I try to
write in the GPIO registers the program is aborted, the strange is that
no error is showed by kernel.

What do I do wrong??? 

Regards,

 

Domenico Ferrari

 

 

 

_______________________________________________
uClinux-dev mailing list
[email protected]
http://mailman.uclinux.org/mailman/listinfo/uclinux-dev
This message was resent by [email protected]
To unsubscribe see:
http://mailman.uclinux.org/mailman/options/uclinux-dev

Reply via email to