Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++

Code download over LVDS

Altera_Forum
Honored Contributor II
1,253 Views

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.

0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
338 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
338 Views

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.
0 Kudos
Altera_Forum
Honored Contributor II
338 Views

Thanks, this is exactly what I&#39;m looking for.

0 Kudos
Reply