Цитата(doom13 @ Jun 15 2016, 09:30)

Ядро Remote Update должно присутствовать в обоих проектах (и в Factory и в Application). Factory при переходе в Application должен стартануть WDT, а Application его сбрасывает (периодически).
Тут я с вами пожалуй не соглашусь. Зачем мне в рабочей прошивке Remote_Update, если я не планирую переконфигурироваться из нее ?
Еще в загрузчике я отключаю WDT чтоб не мешал, а после переконфигурации так и вовсе режим Remote не представлен.
Есть рабочий проект, с которого я черпаю вдохновение, правда он под циклон 3, а у меня 4. Так там рабочие прошивки самые обычные, Active serial - Standart.
Вот код инициализации в загрузчике
CODE
// Remote Update State Machine
always @ (posedge clock)
begin
if (reset) ConfigState <= 0;
case (ConfigState)
// Reset State
0: begin
ResetRU <= 'b1;
if (Busy)
ConfigState <= 0;
else
ConfigState <= ConfigState + 1'b1;
end
//Setup Defaults
1: begin
ResetRU <= 'b0;
CRC_error <= 1'b0;
done <= 1'b0;
ReconfigLine <= 1'b0;
WriteParam <= 1'b0;
ReadSource <= 2'b0;
Reason <= 5'b01011;
loop <= 0;
ConfigState <= ConfigState + 1'b1;
end
//Turn on CONFG_DONE early
2: begin
DataIn <= 1'b1;
Param <= 3'b001;
ConfigState <= ConfigState + 1'b1;
end
3: begin
WriteParam <= 1'b1;
ConfigState <= ConfigState + 1'b1;
end
4: begin
WriteParam <= 1'b0;
ConfigState <= ConfigState + 1'b1;
end
5: begin
if (Busy)
ConfigState <= 5;
else
ConfigState <= ConfigState + 1'b1;
end
//Turn on OSC_INT
6: begin
DataIn <= 1'd1;
Param <= 3'b110;
ConfigState <= ConfigState + 1'b1;
end
7: begin
WriteParam <= 1'b1;
ConfigState <= ConfigState + 1'b1;
end
8: begin
WriteParam <= 1'b0;
ConfigState <= ConfigState + 1'b1;
end
9: begin
if (Busy)
ConfigState <= 9;
else
ConfigState <= ConfigState + 1'b1;
end
//Set Application Boot_Address
10: begin
DataIn <= (BootAddress >> 2); // Set the Boot Address of the Application Image, Only the 22 MSB bits are written
Param <= 3'b100;
ConfigState <= ConfigState + 1'b1;
end
11: begin
WriteParam <= 1'b1;
ConfigState <= ConfigState + 1'b1;
end
12: begin
WriteParam <= 1'b0;
ConfigState <= ConfigState + 1'b1;
end
13: begin
if (Busy)
ConfigState <= 13;
else
ConfigState <= ConfigState + 1'b1;
end
//Disable the WATCHDOG_EN
14: begin
DataIn <= 1'd0; // set DataIn to 0 to disable
Param <= 3'b011;
ConfigState <= ConfigState + 1'b1;
end
15: begin
WriteParam <= 1'b1;
ConfigState <= ConfigState + 1'b1;
end
16: begin
WriteParam <= 1'b0;
ConfigState <= ConfigState + 1'b1;
end
17: begin
if (Busy)
ConfigState <= 17;
else
ConfigState <= ConfigState + 1'b1;
end
// READ REASON for last Config
18: begin
Param <= 3'b111;
ConfigState <= ConfigState + 1'b1;
end
19: begin
ReadParam <= 1'b1;
ConfigState <= ConfigState + 1'b1;
end
20: begin
ReadParam <= 1'b0;
ConfigState <= ConfigState + 1'b1;
end
21: begin
if (Busy) begin
ConfigState <= 21;
end else
ConfigState <= ConfigState + 1'b1;
end
22: begin
Reason <= DataOut[4:0]; // Read the Reason for Last ReConfig
ConfigState <= ConfigState + 1'b1;
end
23: begin
ConfigState <= ConfigState + 1'b1;
end
// Check if we need to Reconfig
24: begin
if (Reason[3]) begin // If we are here due to CRC Error, skip reconfig &
CRC_error <= 1'b1; // set CRC error flag
ConfigState <= 24;
end
else
ConfigState <= ConfigState + 1'b1;
end
25: begin
if (control == 1) begin ReconfigLine <= 1'b1;
ConfigState <= ConfigState + 1'b1; end
end
26: begin // Hold ReconfigLine high for > 250nS as per handbook
if (loop == delay)
ConfigState <= ConfigState + 1'b1;
else loop <= loop + 1'b1;
end
// End State
27: begin
done <= 1'b1; // Indicate the State Machine is Finished
ConfigState <= 27; // Loop here
end
default: ConfigState <= 0;
endcase
end
remote Remoteinst(
.clock(clock),
.data_in(DataIn),
.param(Param),
.read_param(ReadParam),
.read_source(ReadSource),
.reconfig(ReconfigLine),
.reset(ResetRU),
.busy(Busy),
.data_out(DataOut),
.write_param(WriteParam)
);