2024-08-21 02:39 PM
Hi All!
Following are the proper codes for read and write the password in Micron MT25QL256ABA
READ PASSWORD 27h
WRITE PASSWORD 28h
Write Enable is executed before to write password using 28H, I wait for the flash to be ready by reading the FLAG STATUS register, then I read the password to verify it was written properly.
The problem is that I am reading zeros only, and I do not understand why.
Perhaps, a step is missing, or a step sequence is required. Datasheet is not explaining or giving information about this topic.
As a note, all the operations work as expected. I am able to erase, read/write data, read/write registers, etc, except by the password.
Here is the log:
=============================================================
========== test_write_read_password ==========
=============================================================
========== Read Device ID
Device Id: 0x1019ba20
READ_SECTOR_PROTECTION_REG: 0x0000ffff
READ_GLOBAL_FREEZE_BIT_REG: 0x00000001
READ_VOLATILE_LOCK_BITS_REG: 0x00000000
READ_NONVOLATILE_LOCK_BITS_REG: 0x000000ff
========== Read Password
Password -> DATA 0: 0x00000000, DATA 1: 0x00000000
pwd0 = 0x00000000 pwd1 = 0x00000000
========== Read All Flash Registers
Control Register : 0x00000001
SPI Clock Baud Rate Register : 0x00000010
CS Delay Setting : 0x00000000
Read Capturing Register : 0x00000000
Operating Protocols Setting Register : 0x00000000
Read Instruction Register : 0x00000003
Write Instruction Register : 0x00007002
Flash Command Setting Register : 0x00008827
Flash Command Control Register : 0x00000000
Flash Command Address Register : 0x00000000
Flash Command Write 0 Register : 0x00000000
Flash Command Write 1 Register : 0x00000000
Flash Command Read 0 Register : 0x00000000
Flash Command Read 1 Register : 0x00000000
========== Write Enable
========== Write Password
Password -> DATA 0: 0xC0FFEE11, DATA1: 0xBABECAFF
========== Read All Flash Registers
Control Register : 0x00000001
SPI Clock Baud Rate Register : 0x00000010
CS Delay Setting : 0x00000000
Read Capturing Register : 0x00000000
Operating Protocols Setting Register : 0x00000000
Read Instruction Register : 0x00000003
Write Instruction Register : 0x00007002
Flash Command Setting Register : 0x00008028
Flash Command Control Register : 0x00000000
Flash Command Address Register : 0x00000000
Flash Command Write 0 Register : 0xc0ffee11
Flash Command Write 1 Register : 0xbabecaff
Flash Command Read 0 Register : 0x00000000
Flash Command Read 1 Register : 0x00000000
Flag Status 0x00000081
========== Read All Flash Registers
Control Register : 0x00000001
SPI Clock Baud Rate Register : 0x00000010
CS Delay Setting : 0x00000000
Read Capturing Register : 0x00000000
Operating Protocols Setting Register : 0x00000000
Read Instruction Register : 0x00000003
Write Instruction Register : 0x00007002
Flash Command Setting Register : 0x00001870
Flash Command Control Register : 0x00000000
Flash Command Address Register : 0x00000000
Flash Command Write 0 Register : 0xc0ffee11
Flash Command Write 1 Register : 0xbabecaff
Flash Command Read 0 Register : 0x00000081
Flash Command Read 1 Register : 0x00000000
========== Read Password
Password -> DATA 0: 0x00000000, DATA 1: 0x00000000
========== Read All Flash Registers
Control Register : 0x00000001
SPI Clock Baud Rate Register : 0x00000010
CS Delay Setting : 0x00000000
Read Capturing Register : 0x00000000
Operating Protocols Setting Register : 0x00000000
Read Instruction Register : 0x00000003
Write Instruction Register : 0x00007002
Flash Command Setting Register : 0x00008827
Flash Command Control Register : 0x00000000
Flash Command Address Register : 0x00000000
Flash Command Write 0 Register : 0xc0ffee11
Flash Command Write 1 Register : 0xbabecaff
Flash Command Read 0 Register : 0x00000000
Flash Command Read 1 Register : 0x00000000
========== Write Enable
========== Write Password
Password -> DATA 0: 0xC000FFEE, DATA1: 0xBABEBABE
========== Read All Flash Registers
Control Register : 0x00000001
SPI Clock Baud Rate Register : 0x00000010
CS Delay Setting : 0x00000000
Read Capturing Register : 0x00000000
Operating Protocols Setting Register : 0x00000000
Read Instruction Register : 0x00000003
Write Instruction Register : 0x00007002
Flash Command Setting Register : 0x00008028
Flash Command Control Register : 0x00000000
Flash Command Address Register : 0x00000000
Flash Command Write 0 Register : 0xc000ffee
Flash Command Write 1 Register : 0xbabebabe
Flash Command Read 0 Register : 0x00000000
Flash Command Read 1 Register : 0x00000000
Flag Status 0x00000081
========== Read All Flash Registers
Control Register : 0x00000001
SPI Clock Baud Rate Register : 0x00000010
CS Delay Setting : 0x00000000
Read Capturing Register : 0x00000000
Operating Protocols Setting Register : 0x00000000
Read Instruction Register : 0x00000003
Write Instruction Register : 0x00007002
Flash Command Setting Register : 0x00001870
Flash Command Control Register : 0x00000000
Flash Command Address Register : 0x00000000
Flash Command Write 0 Register : 0xc000ffee
Flash Command Write 1 Register : 0xbabebabe
Flash Command Read 0 Register : 0x00000081
Flash Command Read 1 Register : 0x00000000
========== Read Password
Password -> DATA 0: 0x00000000, DATA 1: 0x00000000
========== Read All Flash Registers
Control Register : 0x00000001
SPI Clock Baud Rate Register : 0x00000010
CS Delay Setting : 0x00000000
Read Capturing Register : 0x00000000
Operating Protocols Setting Register : 0x00000000
Read Instruction Register : 0x00000003
Write Instruction Register : 0x00007002
Flash Command Setting Register : 0x00008827
Flash Command Control Register : 0x00000000
Flash Command Address Register : 0x00000000
Flash Command Write 0 Register : 0xc000ffee
Flash Command Write 1 Register : 0xbabebabe
Flash Command Read 0 Register : 0x00000000
Flash Command Read 1 Register : 0x00000000
2024-11-21 08:04 AM - edited 2024-11-21 08:05 AM
Hello @asuperman15 and welcome to the Community ,
Firstly, I apologize for my late reply.
Which STM32H7 are you using? Are you used a ST board?
Could you please give more details about your configuration?
Thanks and best regards,
Kaouthar
To give better visibility on the answered topics, please click on Accept as Solution on the reply which solved your issue or answered your question.