Forum Discussion
Altera_Forum
Honored Contributor
19 years agoHi.
I had sucess in downloading program by x/y modem of redboot. Also, runing RAM Applicaiton program by redboot.. I have changed UART1 baudrate to 57600 by SOPC builder, and modified altera_avalon_uart_comm.c's altera_avalon_uart_diag_getc_timeout () functions in eCos driver. ~~~ typedef struct { cyg_uint8* port; cyg_uint32 irq; //Add by JYKoh cyg_int32 msec_timeout; //End } altera_avalon_uart_chan; ~~~ cyg_bool altera_avalon_uart_diag_getc_timeout(void* __ch_data, cyg_uint8* ch) { int delay_count; //Add By JYKoh altera_avalon_uart_chan* chan = (altera_avalon_uart_chan*)__ch_data; //End cyg_bool res; CYGARC_HAL_SAVE_GP(); //Chg by JYKoh // delay_count = 10; // delay in .1 ms steps delay_count = chan->msec_timeout * 10; // delay in .1 ms steps //End for(;;) { res = altera_avalon_uart_diag_getc_nonblock(__ch_data, ch); if (res || 0 == delay_count--) break; //Chg by JYKoh // HAL_DELAY_US(10); HAL_DELAY_US(100); //End } CYGARC_HAL_RESTORE_GP(); return res; } ~~ int altera_avalon_uart_diag_control(void *__ch_data, __comm_control_cmd_t __func, ...) { static int irq_state = 0; altera_avalon_uart_chan* chan; int ret = 0; cyg_uint32 ctrl; ~~~ //Add by JYKoh case __COMMCTL_SET_TIMEOUT: { va_list ap; va_start(ap, __func); ret = chan->msec_timeout; chan->msec_timeout = va_arg(ap, cyg_uint32); va_end(ap); } //End default: break; } CYGARC_HAL_RESTORE_GP(); return ret; } ~~~