I am having problems reading from the SPI1_MCR. I can write to it, but when I attempt to read from the register, I get a data abort exception.

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

I am having problems reading from the SPI1_MCR. I can write to it, but when I attempt to read from the register, I get a data abort exception.

Jump to solution
1,524 Views
degle
Contributor II

I am working with the VF65GS10 Tower kit until our custom hardware is ready. While I wait, I was hoping to develop software that is intended to run on our custom board with a VF5 processor.

The custom board will use the SPI to communicate with a peripheral chip, so I am writing SPI based communications using the VF65GS10 Tower. I acquired some Freescale code online that works with the SPI bus, but when running the code, I get an data abort exception when the SPI1_MCR is read.

I am not sure why the write happens but not the read. And it is not just the SPI1_MCR that has that issue. When I attempt to read from the SPI1_SR, the same data abort exception happens.

I have used the U-Boot that comes with the Freescale MfgTool to access the registers as well (running on the A5 core). Using the U-Boot "md.l 0x4002D000" to read from the SPI1_MCR, I get the data abort exception, But when I write to the register using "mw.l 0x4002D000 0x00004001 1", there is no exception.

The code I have written is added as a command of U-Boot, so U-Boot is running at the time but I wouldn't think that would affect the SPI1_MCR read from happening.

Labels (2)
Tags (4)
0 Kudos
Reply
1 Solution
1,037 Views
timesyssupport
Senior Contributor II

Hello DuVall,

If you wish to read just the SPI1_MCR or SPI1_SR register, can you use "md.l 0x4002D000 1" or "md.l 0x4002D02C 1", respectively?

Also, Timesys has released a new version of U-Boot based on the mfgtool release, with additional fixes for the Vybrid Tower. This is the version of U-Boot that I used to test the above commands. The git tree is available here:

https://linuxlink.timesys.com/git?repo=u-boot.git&view=log&h=2013.07-mvf

Let me know if this works for you.

Thanks,

Timesys Support

View solution in original post

0 Kudos
Reply
4 Replies
1,038 Views
timesyssupport
Senior Contributor II

Hello DuVall,

If you wish to read just the SPI1_MCR or SPI1_SR register, can you use "md.l 0x4002D000 1" or "md.l 0x4002D02C 1", respectively?

Also, Timesys has released a new version of U-Boot based on the mfgtool release, with additional fixes for the Vybrid Tower. This is the version of U-Boot that I used to test the above commands. The git tree is available here:

https://linuxlink.timesys.com/git?repo=u-boot.git&view=log&h=2013.07-mvf

Let me know if this works for you.

Thanks,

Timesys Support

0 Kudos
Reply
1,037 Views
degle
Contributor II

When I use either of the commands, "md.l 0x4002D000 1" or "md.l 0x4002D02C 1", a data abort exception happens and the a reset.

Here is what I see on the console:

=> md.l 0x4002D000 1

4002d000:data abort

    MAYBE you should read doc/README.arm-unaligned-accesses

pc : [<3f01de74>]          lr : [<3f01de4c>]

sp : 3f469d98  ip : 4002d000     fp : 00000008

r10: 4002d000  r9 : 4002d000     r8 : 3f469f40

r7 : 00000001  r6 : 00000001     r5 : 00000004  r4 : 00000004

r3 : 00000000  r2 : 00000090     r1 : 3f469dac  r0 : 00000009

Flags: nZCv  IRQs off  FIQs off  Mode SVC_32

Resetting CPU ...

resetting ...

*******

I have not updated the u-boot with the latest changes you indicated in your response yet. I will try that next.

0 Kudos
Reply
1,037 Views
degle
Contributor II

The issue has been corrected. Before I had a chance to update to the latest u-boot version and try that, it was realized that the configuration for SPI1 was not correct. After setting up SPI1 correctly, the reads to SPI1_MCR and SPI1_SR worked.

I am still wondering why I was able to write to those two registers but not read from those registers when the SPI1 was not set up correctly. You would think if the read failed, so would the write. Oh well.

0 Kudos
Reply
1,037 Views
karina_valencia
NXP Apps Support
NXP Apps Support

timesyssupport can you help to attend this case?

0 Kudos
Reply