Forum Discussion

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

UART Help

Was doing well in evaluating the IDE/HAL until now. Hit a brick wall going 100mph. I need some pointers on how to read characters from the UART. I tried the example in the Processor Ref handbook, but it won't link. Cant find fopen, fclose, fgetc even though stdio.h is included. Also tried the altera_alt_avalon_uart_read function, but don't understand how to init the alt_fd pointer. I am not a UNIX programmer and this layer of abstraction is confusing to me. Couldn't find any examples. Any help would be great!

Rick

15 Replies

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

    I also thought that the scanf would work because the printf did. The error was the standard unresolved external type of error. In another words, it couldn't find code for the scanf. It was the same error generated when I tried the fopen/fclose/getc.

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

    Sorry, I'm out of ideas

    Are you trying to use scanf for debug or will there be input in the final design? Also what core and debug module (if any) has been added to the system? (drawing at straws, just like you are probably).

    Good-luck and hopefully someone else can be of more help.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    In fact can you post the linker error you get with the small C Library selected, and then the error when you don't have the small library selected.