Hi,
I am trying to initialize QSPI module on MCF52259. But reading and writing MCF_QSPI_QMR register causes an access error.
MCF_QSPI_QMR = (vuint16)(MCF_QSPI_QMR_MSTR | MCF_QSPI_QMR_BITS(12) | MCF_QSPI_QMR_BAUD(2))
I looked into the exception frame. It gives me "Error on operand read" when reading the register and "Error on operand write" while writing the register.
I do not know what causes the problem.
I even initialized the Port QS but still no luck.
Here is exception stack frame for both read and write
Read: - 0x4C082704
Write: - 0x48082708
Also, the error is not just related to one register. It causes problem with all QSPI registers.
Any help will be highly appreciated.
Regards.
解決済! 解決策の投稿を見る。
14.7.3.2 Peripheral Access Control Registers (PACR0–PACR10)
What's PACR4 set to?
Is your code executing in User Mode or Supervisor Mode?
> Read: - 0x4C082704 Format 4, FS 1100 (0xC), Vector 8, SR=2704
> Write: - 0x48082708 Format 4, FS 1000 (0x8), Vector 8, SR=2708
"Privilege violation" on Read and Write, just as you say.
The Status Register has the "Supervisor" bit set (0x2000), so you're not in User Mode.
IPSBAR has to be correct or you couldn't get to any peripherals.
Check that that "MCF_QSPI_QMR" definition is correct for your CPU. You may have the wrong header file in there somehow. Especially check the assembly code that is being generated.
Tom
Hello Salman!
Was that information helpful?
Please keep us posted, we'd like to know :smileywink:
Best regards,
Monica
I was missing PACR4.
> I was missing PACR4.
According to the manual, that register defaults out of reset to zero, which should allow Supervisor read-write. To block access, the bottom nybble must have been set to 0x07.
What software were you running that did that before your QSPI initialisation code?
Tom
14.7.3.2 Peripheral Access Control Registers (PACR0–PACR10)
What's PACR4 set to?
Is your code executing in User Mode or Supervisor Mode?
> Read: - 0x4C082704 Format 4, FS 1100 (0xC), Vector 8, SR=2704
> Write: - 0x48082708 Format 4, FS 1000 (0x8), Vector 8, SR=2708
"Privilege violation" on Read and Write, just as you say.
The Status Register has the "Supervisor" bit set (0x2000), so you're not in User Mode.
IPSBAR has to be correct or you couldn't get to any peripherals.
Check that that "MCF_QSPI_QMR" definition is correct for your CPU. You may have the wrong header file in there somehow. Especially check the assembly code that is being generated.
Tom