2009-12-23 17:39:23     Why I cannot run my application under uclinux?

Document created by Aaronwu Employee on Aug 20, 2013
Version 1Show Document
  • View in full screen mode

2009-12-23 17:39:23     Why I cannot run my application under uclinux?

Jianxi Fu (UNITED STATES)

Message: 83898   

 

Hi,

 

In the last two weeks, I learnt about toolchain, u-boot, uclinux-dist.

 

There are a lot of interesting things.

 

And I also use the hello.c go through the application test, everything goes well.

 

But today, when I try to use some code to control the LED on the board, some problems occur.

 

I just use the code following to turn off LED

 

 

 

########################################################

 

#define PORTFIO_DIR    0xFFC00730 /* Port F I/O Direction Register      */

#define PORTFIO_CLEAR   0xFFC00704 /* Port F I/O Peripheral Interrupt Clear Register  */

#define PORTFIO_SET    0xFFC00708 /* Port F I/O Peripheral Interrupt Set Register   */

#define pPORTFIO_DIR   ((volatile unsigned short *)PORTFIO_DIR)

#define pPORTFIO_CLEAR   ((volatile unsigned short *)PORTFIO_CLEAR)

#define pPORTFIO_SET   ((volatile unsigned short *)PORTFIO_SET)

 

int main() {

*pPORTFIO_DIR = 0x0FC0;

*pPORTFIO_SET = 0x0800;

return 0;

}

 

 

########################################################

 

It goes well when I use Visual DSP++

 

But after I compile the C code using toolchain, then download the executable file to my board, it does not work!

 

Why this happen?

 

 

 

Sincerely

 

Jianxi

QuoteReplyEditDelete

 

 

2009-12-23 20:07:12     Re: Why I cannot run my application under uclinux?

Mike Frysinger (UNITED STATES)

Message: 83899   

 

that is not how Linux works.  userspace does not have access to hardware resources.  write a driver or use existing ones to do whatever it is you want to do.

QuoteReplyEditDelete

 

 

2009-12-28 16:05:33     Re: Why I cannot run my application under uclinux?

Jianxi Fu (UNITED STATES)

Message: 84010   

 

Dear Mike,

 

Did you mean that the memory address that used to control the LED is still the same with Visual DSP++. However, what I need to do is to write a driver file to access them??

 

Jianxi

QuoteReplyEditDelete

 

 

2009-12-28 16:10:18     Re: Why I cannot run my application under uclinux?

Mike Frysinger (UNITED STATES)

Message: 84012   

 

what VDSP does doesnt matter.  the Blackfin MMRs dont care what software you're running.

 

if you want to access supervisor-only resources, you need to write a kernel mode driver.  if want to access GPIOs, then use the gpio subsystem.

 

the wiki has plenty of articles you can find by searching.

Attachments

    Outcomes