Forum Discussion

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

Code download over LVDS

I have been considering using Redboot as my bootloader. But, our custom board has to download it's code over an LVDS link. How hard is it to add new comms options to Redboot? This is the only connection to the host so I have no option except the LVDS. I could try to make it look like a serial port without the handshaking, but I would really like to just create a new comms option. Thanks.

3 Replies

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

    If you want to run all the console I/O over this channel, then you will need to provide a comms driver.

    The functions required by Redboot for a comms driver aren't particularly complicated. If you take a look at:

    altera_avalon_jtag_uart_diag.c

    that should serve as a reasonable example.

    These can (and should) be polled functions, i.e. you shouldn't be using interrupts to drive the device.

    Initialising the channel is achieved by calling the macros CYGACC_COMM_IF_WRITE_SET etc. as done for the JTAG UART.
  • Altera_Forum's avatar
    Altera_Forum
    Icon for Honored Contributor rankHonored Contributor

    If you don't want to use this channel for console I/O, but just want to add an extra download command to redboot that you can add to the boot script, then you can do that using something like:

    # include "redboot.h"

    RedBoot_cmd("lvds_load",

    "load over LVDS",

    "[-w <timeout>]",

    do_lvds_load

    );

    void

    do_lvds_load(int argc, char *argv[])

    {

    // load the code

    }

    This will cause the function do_lvds_load() to run whenever the command lvds_load is issued.

    If you look in packages\redboot\v2_0\src (in particular at main.c), you&#39;ll see examples of this.