FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits
5932 Discussions

Max1000 Remote System Upgrade via SPI

Zahkriin
Novice
25,272 Views

Hello, 

I have a Max1000 development board and would like to perform a remote system upgrade with it.
I have programmed an SPI interface to send the required data. (Here not necessarily SPI must be used, but I think another interface does not change my problem). Now I want to program the RSU without the Nios.
I have gotten to the point where I need the dual boot ip core to configure the "dual compressed image". An onchip-Ram to store the necessary data and an onchip-Flash to write to the CFM. But here my flash has only an address size of 17 bits, but to rewrite the CFM the address must be at least 18 bits.

Am I missing something here? Is it possible to rewrite the CFM with SPI like this?

on-chip flash.png

 

0 Kudos
57 Replies
jozephka99
New Contributor II
21,801 Views

I'm glad that you solved your problem. Sorry for your last question. I've busy for weeks.

0 Kudos
sadann22
Beginner
21,230 Views

I'm not sure about the order of sending the bytes.

Is it as described in .png file 0,1,2,3... or maybe 1,0,3,2...

0 Kudos
jozephka99
New Contributor II
21,216 Views

Which pngs? I don't get it.

0 Kudos
sadann22
Beginner
21,201 Views

Thank you for the revised code.

The rpd file:

sadann22_0-1706614959537.png

Should I send the byte in the displayed order?: 50,ff,47,ff,4d,ff .........

or the order of sending the bytes is different?

0 Kudos
jozephka99
New Contributor II
21,193 Views

You can choose to send either in big endian or in little endian. But you have to write it to the FPGA in big endian format. Your data that send to me is in the little endian format. I also send it in little endian an convert it in the rsu_data function in my code. You can see it i reverse the bits there. But you can send it in big endian and erase this conversion so it is nicer I think. If you want to do this in big endian you have to generate the .rpd file in big endian format from the "Convert Programming File". In here, in "Options/Boot info..." you can change the format to big endian. 

Screenshot from 2024-01-30 15-26-52.png

Screenshot from 2024-01-30 15-27-01.png

  

0 Kudos
sadann22
Beginner
21,183 Views

This was not my question.

 

I did not ask about the order of the bits in each byte.

I was asking about the order of the bytes.

first byte that I should send to you is X"50"

2nd byte X"ff"

3rd byte X"47" 

and so forth according to the rpd file as displayed in my former post.

 

I was not sure about that.

0 Kudos
jozephka99
New Contributor II
21,180 Views

I don't remember this exactly but I think yes, it is the order. I use serial console's file sending ability so may be it depends on the program but I think it is in the order 50,ff,47,...

0 Kudos
sadann22
Beginner
21,158 Views
Can you write the link to the serial console and i will try to dig into it.
Thanks.
0 Kudos
jozephka99
New Contributor II
21,142 Views
0 Kudos
sadann22
Beginner
21,076 Views

Thank you jozephka99.

I succeeded to configure the MAX 10M16 device after performing all the needed modifications of your code.

CFM1 is composed of 2 sectors (3 and 4) while CFM0 is composed of only 1 sector (5).

So, in order to erase CFM1I used the erase feature for the 2 sectors 3 and 4.

Everything now is working great.

Thank you jozephka99 for your assistance.

 

0 Kudos
jozephka99
New Contributor II
21,040 Views

You're welcome. I'm glad that you have succeed it. I think it is not so difficult to do actually but it is very challenging when there is no much info in documents.

0 Kudos
sadann22
Beginner
21,594 Views

I'm very interested to learn from your example but there is a problem during download because i received this:

Anti-virus warning 

– 1 attachment contains a virus or blocked file. Downloading this attachment is disabled.

 

Is there another way I can get your exaple.

 

0 Kudos
jozephka99
New Contributor II
21,567 Views

Which file did you try to download. I downloaded the project zip file in opera without any error. May be you can try it with different browser. 

0 Kudos
sadann22
Beginner
21,552 Views

Thank you jozephka99 for your response.

I tried to download "manual_rsu (with console and for 10m08).zip" with microsoft Edge browser, which is the only browser I'm allowed to use. After  I received  the above mentioned  message I used my iphone and succeeded to download the file. Then I tried to send the unzipped files to the my work PC and found out that the problem was the VHD files. I changed the type of files to TXT and finally succeded to send all the files to my work.

I have already opened the project in quartus and I'm ready for the next phase.

I have no idea how to communicate with the module from my PC. What should I see on the display and what commands should I enter in order to start the configuration process.

Can you, please, assist me on the process of configuration.

Thank you very much for your time. 

0 Kudos
jozephka99
New Contributor II
21,549 Views

First what fpga module do you use?

You should set your fpga's 2 pins as rx/tx pins of uart (in pin planner) which they are named in project as uart_tx/uart_rx. 

Then I don't know which OS do you use in your PC but you have to install a serial communication program like realterm. 

Then you should be connect the fpga to PC with a "USB to UART TTL Serial Converter" over these 2 uart pins at baud rate 57600 (you can change it from code). 

When fpga starts you should see the messages coming from the device. It says "UFM CONTROLLER
write(0), read(1), erase(2), burst read(3), burst write(4): ".

Then you choose your operation and push the enter key. Then it requests some information like the address you want, etc. then it does what you said to device's UFM/CFM sectors. 

But here, although it doesnt mention the operation code of 5 and 6, the operation code 6 is the RSU operation. When you select 6 it says: "enter cfm num for rsu (0-1):" and after your selection it says "send rsu data (non ASCII):" and waits for incoming .rpd file.

Here you have to send the rpd file over your serial terminal's file sending section (non ASCII of course).

After the coming of rpd file the fpga will be restarted and runs from new config.

0 Kudos
sadann22
Beginner
21,546 Views

wow, this was fast. Thanks.

We are using windows 10.

I don't understand the need for  "USB to UART TTL Serial Converter".  I understand that all I need is some console to send and receive ASCII messages over the UART lines? this for the first stage of the process.

Then, I understand that I need to send the rpd file in non ASCII mode.

How can I confirm that the file has been transferred successfully?

 

0 Kudos
jozephka99
New Contributor II
21,536 Views

How do you think you communicate PC-FPGA. FPGA has just blank pins. In this project I use some UART block on the code so it can handle the rx/tx input/output signals as UART protocol. So the FPGA can handle the UART communication over 2 pins. But how you connect these 2 pins to PC. You have to convert this signals to PC's understanding. So I used the USB to UART connector for this purpose. If I know your FPGA module, I can comment on this more reliable. Because this project created for 10M08 FPGA and if your FPGA model is different you have to change the addresses, etc.

The second question, after the transfer the FPGA should restart itself. So you can drive some leds, etc. in the new configuration and you can see it when device restarted. Or you can add console prints in the RSU related functions like rsu_data and after that rsu_reconfig. rsu_reconfig is the last function it enters before restart.

 

0 Kudos
sadann22
Beginner
21,533 Views

I'm going to use 10M16..... devices.

My concerns about the design are:

1. for your device 10M08 the "Total Logic Elements" count is 40%. So I guess it will be 20% with my device.

2. for your device 10M08 the "Total Memory Bits" count is 80%! It seems that this figure is not going to change dramatically with my device since the CFM is larger (not twice). This figure will limit the size of the Signal Tap file, which is an essential tool during debugging. Maybe it is possible to send the rpd file in fragments (I still have no idea how to make it). Nevertheless, it will be required to split the debugging work to 2 phases: with RSU, without RSU module.

 

 

 

0 Kudos
jozephka99
New Contributor II
21,528 Views

1. Yes probably the logic elements you use in 10M16 is cut down to half.

2. I additionaly use RAM for just practicing it. May be you can delete the RAM block I added and save some memory bits.

0 Kudos
sadann22
Beginner
21,527 Views

OK.

I'm going to check the RAM issue and if it is not required for the configuration activity I will delete it.

Thank you jozephka99.

0 Kudos
sadann22
Beginner
21,495 Views

Since my device is 10M16 it seems that I have to change your code in order to fit the CFM size and addresses.

Am I correct?

Can you direct me to the locations in your code where I should make these changes.

Thank you.

0 Kudos
Reply