Error when initializing NOR flash

Hello,

using NOR flash (MX25LM51245G Datasheet) initalized on a STM32L4 as QSPIF, I’ve got the following error during initialization:

[DBG ][QSPIF]: Setting QE Bit, Bit 6 of Status Reg 1
[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1
[DBG ][STQS]: qspi_command_transfer tx 0 rx 1 command 0x05
[DBG ][QSPIF]: Reading Status Register 1 Success: value = 0x2
[DBG ][QSPIF]: Inst: 0x15h, addr: 18446744073709551615, tx length: 0, rx length: 2
[DBG ][STQS]: qspi_command_transfer tx 0 rx 2 command 0x15
[DBG ][QSPIF]: Reading Status Register 2 Success: value = 0x7
[DBG ][QSPIF]: Reading Register 3 Success: value = 0x7
[DBG ][QSPIF]: Inst: 0x6h, addr: 18446744073709551615, tx length: 0, rx length: 0
[DBG ][STQS]: qspi_command_transfer tx 0 rx 0 command 0x06
[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1
[DBG ][STQS]: qspi_command_transfer tx 0 rx 1 command 0x05
[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1
[DBG ][STQS]: qspi_command_transfer tx 0 rx 1 command 0x05
[DBG ][QSPIF]: Inst: 0x1h, addr: 18446744073709551615, tx length: 3, rx length: 0
[DBG ][STQS]: qspi_command_transfer tx 3 rx 0 command 0x01
[DBG ][QSPIF]: Writing Status Registers Success: reg 1 value = 0x42, reg 2 value = 0x7
[DBG ][QSPIF]: Writing Register 3 Success: value = 0x7
[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1
[DBG ][STQS]: qspi_command_transfer tx 0 rx 1 command 0x05
[DBG ][QSPIF]: Inst: 0x5h, addr: 18446744073709551615, tx length: 0, rx length: 1
[DBG ][STQS]: qspi_command_transfer tx 0 rx 1 command 0x05
[DBG ][QSPIF]: Reading Status Register 1 Success: value = 0x2
[DBG ][QSPIF]: Inst: 0x15h, addr: 18446744073709551615, tx length: 0, rx length: 2
[DBG ][STQS]: qspi_command_transfer tx 0 rx 2 command 0x15
[DBG ][QSPIF]: Reading Status Register 2 Success: value = 0x7
[DBG ][QSPIF]: Reading Register 3 Success: value = 0x7
**[ERR ][QSPIF]: Status register not set correctly**
**[ERR ][QSPIF]: Device supports Quad bus, but Quad Enable Failed**
**[ERR ][QSPIF]: Init - Parse Basic Param Table Failed**

Does anyone have an idea how I can properly initialize the flash?

Thanks,
Andy

Edit: Checked the data sheet more closely and new macronix devices changed their status register size and entries. Will give a follow up as soon as I’ve finished fixing the QSPIF lib