How to write 256KB data to SPI flash all at once in Denebolakit?

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Subhash24
Level 4
Level 4
25 replies posted 10 likes given 50 sign-ins

Hello,

        I'm using the UsbSpiDmaMode example to test on SPI flash, I have gone through the code, and for writing and reading the limit for the length I found is, the length should be multiple of 256 and less than 4096, but what I'm trying to do is, I'm trying to write/read 250KB at once, but while doing this I got this  error:

CONTROL IN transfer
CONTROL IN transfer failed with Error Code:997

how can I write 250KB data at once to SPI flash in the Denebola kit?

Thanks.

 

0 Likes
1 Solution
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

In a single SPI read/write operation, 27136 bytes (0x6A00) can be read/written.

This is a limitation from the Flash side.

Could you let us know why such high amounts of data are to be written to the Flash?

Best Regards,
AliAsgar

View solution in original post

0 Likes
9 Replies
Rashi_Vatsa
Moderator
Moderator
Moderator
5 likes given 500 solutions authored 1000 replies posted

Hello Subhash,

Please confirm if you are aware of "Program > FX3 > SPI FLASH" in the control center to program the completer firmware to SPI Flash.

If yes, kindly  refer to the source of the Control Center application and USBFlashProg  (path : C:\Program Files (x86)\Cypress\EZ-USB FX3 SDK\1.3\firmware\basic_examples\) example from SDK which is used by control center to read/write to SPI FLASH

 

Regards,
Rashi

I used example what you have referred, but even by reading 40KB I'm getting error.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Subash,

Is the below error seen, when writing to flash or reading from flash?

"CONTROL IN transfer
CONTROL IN transfer failed with Error Code:997"

Please send the screenshot of the control center when the error is seen.

Are you able to read/write 256 bytes of data from/to the flash?

Best Regards,
AliAsgar

 

0 Likes

@AliAsgar  Thanks for the response I'm able to read till 4096. no problem now

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Subhash,

Is your problem solved?

Best Regards,
AliAsgar

Solved means I'm just able to write 256 bytes to 4096 bytes smoothly but unable to read 40K bytes at once.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi Subhash,

Could you share with us your firmware project?

Best Regards,
AliAsgar

0 Likes

@AliAsgar  I did not modified anything, I just imported the code from firmware examples, spidmamode example.

0 Likes
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

In a single SPI read/write operation, 27136 bytes (0x6A00) can be read/written.

This is a limitation from the Flash side.

Could you let us know why such high amounts of data are to be written to the Flash?

Best Regards,
AliAsgar

0 Likes