Unable to init QSPI

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

Unable to init QSPI

Jump to solution
776 Views
salman83
Contributor II

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.

Labels (1)
Tags (2)
0 Kudos
1 Solution
483 Views
TomE
Specialist II

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


View solution in original post

0 Kudos
4 Replies
483 Views
Monica
Senior Contributor III

Hello Salman!

Was that information helpful?

Please keep us posted, we'd like to know :smileywink:

Best regards,

Monica

0 Kudos
483 Views
salman83
Contributor II

I was missing PACR4.

0 Kudos
483 Views
TomE
Specialist II

> 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


0 Kudos
484 Views
TomE
Specialist II

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


0 Kudos