Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
13 years ago

fopen("/dev/uart","w") returning NULL

Hey guys,

I'm attempting to communicate between my PC to the Nios II via RS-232.

I've built up my system in SOPC and I'm using the eclipse tool to code in c.

When I use the function fp = fopen("/dev/uart","w"), I always receive NULL.

/dev/uart is the correct path according to my system.h file.

Could you offer any advice?

Thanks,

Justin

2 Replies

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    To fix the problem I unchecked "Lightweight device driver API" in the BSP editor.

  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    --- Quote Start ---

    To fix the problem I unchecked "Lightweight device driver API" in the BSP editor.

    --- Quote End ---

    It worked for me too. Thanks!