S25FL512S write protection does not clear the problem

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

cross mob
Translation_Bot
Community Manager
Community Manager
Community Manager

Hello, the Flash model I am using is S25fl512SAGMFMR10. Now the flash is write-protected, I wanted to remove the write protection in uboot, but it hasn't worked; the value of the CR register read in Uboot is CR=0x2; sr=0x1C; then I call write_sr_cr (struct spi_nor, u8 *sr_cr) in uboot's initialization to clear the SR register to 0 and remove write protection; but it hasn't worked; The spi flash driver uses uboot2022's own driver, please provide a solution.

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/AURIX/S25FL512S-%E5%86%99%E4%BF%9D%E6%8A%A4%E6%97%A0%E6%B3%95%E6%B8%85%E9%99%A4%E9%97%AE%E9%A2%98/td-p/659094

0 Likes
1 Solution
Translation_Bot
Community Manager
Community Manager
Community Manager

Hi Libin,

On this side, after modifying SR1 and CR1 , the SR1 value is 0x1E . This SR1 [1] (WEL) =1 only indicates that it has been written enabled, and there is no specific execution of the WRR (01h) command because WRR (01h) is executed After the command, the WEL bit is automatically set to 0 to turn off Write Enable to prevent accidental rewriting.

So I'd like to ask if you added the printing position before WRR was executed? Is the command currently used in nor- > write_reg WRR (01h)? If not, the operation of writing a register might not have been performed at all.

Janine_Y_0-1702965986477.png

 

You can also add a print to line 1864 to see if the execution was successful.

BR,

Janine

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/Nor-Flash/S25FL512S-%E5%86%99%E4%BF%9D%E6%8A%A4%E6%97%A0%E6%B3%95%E6%B8%85%E9%99%A4%E9%97%AE%E9%A2%98/m-p/662650

View solution in original post

0 Likes
5 Replies
Translation_Bot
Community Manager
Community Manager
Community Manager

Hi Libin,

I want to ask what kind of failure is the unsuccessful operation of writing 0 to the SR register. Does it return an error, and what are the values of the status register and configuration register after the operation?

If I try to call write_enable directly and then call write_sr, can I succeed?

Best Housekeeping,

Janine

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/Nor-Flash/S25FL512S-%E5%86%99%E4%BF%9D%E6%8A%A4%E6%97%A0%E6%B3%95%E6%B8%85%E9%99%A4%E9%97%AE%E9%A2%98/m-p/659394

0 Likes
Translation_Bot
Community Manager
Community Manager
Community Manager

Hi Janine_Y, if not successful, the SR value has not changed, and there are no errors reported. After the write_sr_cr (struct spi_nor, u8 *sr_cr) operation is completed, the SR value read is 0x1E and the CR value is 0x2; I tried calling write_sr after write_enable and then calling write_sr, but there was no effect. The value of SR after the operation was completed is 0x1E, and there is still no bp level set to 0, can you help me.

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/Nor-Flash/S25FL512S-%E5%86%99%E4%BF%9D%E6%8A%A4%E6%97%A0%E6%B3%95%E6%B8%85%E9%99%A4%E9%97%AE%E9%A2%98/m-p/661143

0 Likes
Translation_Bot
Community Manager
Community Manager
Community Manager

Hi Libin,

Can you try replacing the chip to determine if it's a software or hardware issue,

Before operation, please refer to AN200381. Keep the power supply stable during WRR to prevent damage to CR and SR.

BR,

Janine

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/Nor-Flash/S25FL512S-%E5%86%99%E4%BF%9D%E6%8A%A4%E6%97%A0%E6%B3%95%E6%B8%85%E9%99%A4%E9%97%AE%E9%A2%98/m-p/661255

0 Likes
Translation_Bot
Community Manager
Community Manager
Community Manager

Hi Janine_Y, I think it should be a software issue, and the SR register cannot be modified in the new chip, so I think it's a general issue with the SPI Flash driver in the 2020 version of Uboot, but I haven't located a specific software problem, so I'd like to ask for your help.

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/Nor-Flash/S25FL512S-%E5%86%99%E4%BF%9D%E6%8A%A4%E6%97%A0%E6%B3%95%E6%B8%85%E9%99%A4%E9%97%AE%E9%A2%98/m-p/661294

0 Likes
Translation_Bot
Community Manager
Community Manager
Community Manager

Hi Libin,

On this side, after modifying SR1 and CR1 , the SR1 value is 0x1E . This SR1 [1] (WEL) =1 only indicates that it has been written enabled, and there is no specific execution of the WRR (01h) command because WRR (01h) is executed After the command, the WEL bit is automatically set to 0 to turn off Write Enable to prevent accidental rewriting.

So I'd like to ask if you added the printing position before WRR was executed? Is the command currently used in nor- > write_reg WRR (01h)? If not, the operation of writing a register might not have been performed at all.

Janine_Y_0-1702965986477.png

 

You can also add a print to line 1864 to see if the execution was successful.

BR,

Janine

smartconx_target@Q!w2e3r4t5y6u7i8o9p0||/t5/Nor-Flash/S25FL512S-%E5%86%99%E4%BF%9D%E6%8A%A4%E6%97%A0%E6%B3%95%E6%B8%85%E9%99%A4%E9%97%AE%E9%A2%98/m-p/662650

0 Likes