Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Programming speed #4

Closed
igor-m opened this issue Mar 10, 2018 · 7 comments
Closed

Programming speed #4

igor-m opened this issue Mar 10, 2018 · 7 comments

Comments

@igor-m
Copy link

igor-m commented Mar 10, 2018

I do program a 104kB bitstream into a 4MB SPI flash via the modded usbasp. Works fine :)
The bitstream is located first 104kB. It shows 4MB in the "IC Size" and the 104kB in the "Size".

It takes 30secs to erase and 30secs to program the flash. In total 1minute.

Is that because it re-flashes the entire 4MB chip, or, because there is a delay inserted somewhere, or, because the usbasp's communication is slow?

@nofeletru
Copy link
Owner

usbasp speed in spi mode is about 7kB/s to 15kB/s (you may check it in benchmark menu)
Result speed is lower because need of transfer not only data but some instructions for memory communication. (and verify if checked)
So yeah - usbasp is slow =)

If file contain only data to write(with no trailing FF) - erase whole chip - write only what in file.
Erasing 8Mbit flash is taking about 5 seconds(we just send 1 command and wait).

@igor-m
Copy link
Author

igor-m commented Mar 10, 2018

The erasing my 4MBytes (32Mbits) large flash takes 30secs here.
The binary is only 104kBytes large, so I need to erase 2 blocks (64kBytes is the block size with the 0xD8 Sector Erase command) and program it. That may take (7.8kBytes/sec here) 1sec for erase and 20secs for write. That would be a great speed up :)
How to do it?

@nofeletru
Copy link
Owner

Look at blockerase.pas script.

@igor-m
Copy link
Author

igor-m commented Mar 11, 2018

But how to tell ASprogrammer "do use my Erase script" when I press the erase icon in the main window?
I've modified the erase script such it erases only 3 Blocks and it takes 2 seconds. I have to press the Execute button in the Script editor window (Script = ERASE) however.

@nofeletru
Copy link
Owner

nofeletru commented Mar 11, 2018

In chiplist.xml you need to set script file
<M45PE16 id="204015" page="256" size="2097152" script="blockerase.pas"/>
And now program will override action with specified section in script file

{$read} read button
{$write} write button...
{$erase}
{$verify}
{$unlock}

@igor-m
Copy link
Author

igor-m commented Mar 11, 2018

Ok, it works!
So for example in a "my_commands.pas" I can have all the read, write, erase ... actions together?

@nofeletru
Copy link
Owner

Yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants