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

Function "ReadToEditor" not correct #95

Open
LiHangBing opened this issue Jul 20, 2023 · 1 comment
Open

Function "ReadToEditor" not correct #95

LiHangBing opened this issue Jul 20, 2023 · 1 comment

Comments

@LiHangBing
Copy link

Hi Sir,
I use this software with an arduino to program SPI flash W25q128
now I have test it's SPI functions and it can erase all chip , but when I try to read data fron SPI flash, the software has a problem
here i's my script "just for test"

{$read2}
begin
  SectorSize := 4096;
  addr := 0;			//起始地址
  size := SectorSize;			//读出的字节数

  //初始化SPI引脚的状态并设置SPI频率
  if not SPIEnterProgMode(_SPI_SPEED_MAX) then LogPrint('Error setting SPI speed');

  SPIWrite(0, 5, $0B, (addr shr 16) and $FF, (addr shr 8) and $FF, addr and $FF, 0); //快速读数据指令
  buff := CreateByteArray(SectorSize);	//缓冲区
  SPIRead(0, SectorSize, buff);
  ReadToEditor(SectorSize, 0, buff);
  ReadToEditor(SectorSize, SectorSize, buff);
  ReadToEditor(SectorSize, 2*SectorSize, buff);
  
  SPIExitProgMode();
  LogPrint('Read finished!');
end

look at the function "ReadToEditor", here I use it 3 times
the function it says “ReadToEditor(size, position, buffer, ...); ”
it's easy to know that the software "AsProgrammer.exe" show a window where the data size is 4096 * 3 = 0x3000
but the software shows the picture below
image
oh it shows that it read 4000h data

furthermore, if i run script again , the data size will increase
image
so i think maybe the script function "ReadToEditor(size, position, buffer, ...);" has some wrong

hope you check it or point out the problem
emmm, I can't read Pascal code........

@nofeletru
Copy link
Owner

#88
I think it is same problem.

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