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 Denebola kit, I'm trying to write data to SPI flash, I  don't get any error while writing data, but when trying to read back I get a value as 0, one more thing to notice is, at some locations values is same as what I have I written.

Let me explain the whole thing clearly, present I'm using a failsafe firmware update, this is the source:https://community.infineon.com/t5/Resource-Library/FX3-Fail-Safe-Firmware-Update/ta-p/246074

but as explained there I'm not using I2C, instead, I'm using SPI,  and I'm using the merger provided in the source to combine Images, so my partition is the same as explained in the source.

i.e,    bootLoader Partition starts at 0x0000

          Primary Firmware   starts at   0x6000

         Secondary Firmware starts at 0x23000

I'm able to boot to primary Firmware and Secondary Firmware,

I'm using the USBBulkSrcSink example provided in the source, in there I tried to write data to the 0x6000 location and read the data,

the values  which are written is stored perfectly, but using the same process I tried to access 0x3FFFF values are not reflecting while reading, even I don't get any error while writing.

screen shot is shared :

Red bix shows code and green box shows output

Screenshot (18).png

 

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

Hi,

Unlike I2C EEPROMs, SPI flash contain sectors. The complete respective SPI sector has to be erased before writing to any byteAddress of the respective SPI Flash. 

It is advised to store the bootloader firmware, Application Software 1, Application Software 2, ByteAddress for firmware identification to be present at different sectors, so that one can be erased without affecting the other.

Always erase a sector of an SPI flash before writing.

Best Regards,
AliAsgar

View solution in original post

2 Replies
AliAsgar
Moderator
Moderator
Moderator
1000 replies posted 250 solutions authored 750 replies posted

Hi,

Unlike I2C EEPROMs, SPI flash contain sectors. The complete respective SPI sector has to be erased before writing to any byteAddress of the respective SPI Flash. 

It is advised to store the bootloader firmware, Application Software 1, Application Software 2, ByteAddress for firmware identification to be present at different sectors, so that one can be erased without affecting the other.

Always erase a sector of an SPI flash before writing.

Best Regards,
AliAsgar

Thanks AliAsgar

 

0 Likes