µTasker Forum
µTasker Forum => NXPTM M522XX, KINETIS and i.MX RT => Topic started by: akorud on December 17, 2008, 06:18:20 PM
-
Hi,
I've just noticed that my MCF52223 hangs on any (read or write) access to QSPI registers (i.e. QMR, QAR). Compiled with CW7.1. Even tried access via *(IPSBAR + 0x340) - the same effect - immediate hang.
Any ideas anybody?
regards,
Andriy
P.S. I've even checked part type via CIR register - it's actually 52223, so SPI should be there. (Some times ago Freescale send us chips with wrong silicon inside).
P.P.S. But I can access (and read correct default values) that register with BDM ("Hardware diagnostics") in CW.
For example: Read 0x0104 at address: 0x40000340
Read 0x0404 at address: 0x40000344And compiler-generated instruction also look ok:
movew 40000340 <___IPSBAR+0x340>,%d0
-
Hi Andrij
Have you verified that the QSPI module is powered up?
See the following in M5223x.c:
#if !defined SPI_INTERFACE && (defined SPI_FILE_SYSTEM || defined SPI_SW_UPLOAD)
PPMRL = (CDUART0 | CDUART1 | CDUART2 | CDI2C | CDFEC0 | CDTMR0 | CDTMR1 | CDTMR2 | CDTMR3);
#else
PPMRL = (CDUART0 | CDUART1 | CDUART2 | CDI2C | CDFEC0 | CDTMR0 | CDTMR1 | CDTMR2 | CDTMR3 | CDQSPI);
#endif
If SPI FLASH is not defined the default is powered down by default.
To power it up (before using) use POWER_UP(POWER_QSPI);
I am not absolutely sure, but accessing a powered down module may cause an exception.
Regards
Mark
-
Thanks Mark,
as usual you are right - that helped. I've not defined SPI_FILE_SYSTEM as I have my own device and need to find how to make your SPI code (I'm going to use SPI flash) with my own.
Thanks,
Andriy