Setting LPSPI4 DMR0 / DMR1 registers...?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

Setting LPSPI4 DMR0 / DMR1 registers...?

ソリューションへジャンプ
843件の閲覧回数
np
Contributor IV

Hi everyone,

I'm trying to use LPSPI4's DMR0 / DMR1 data match registers as transient storage, but it seems as though I'm missing something really obvious. Here's my startup test code (note that this deliberately doesn't trigger software reset (CR bit 1), because I want to see if DMR0 persists over reboot):

#define MYSPI LPSPI4

MYSPI->CR = 0x1 + 0x8; // enable module (but don't reset it!)
printf("DMR0 Persistence test: 0x%08x\r\n", (unsigned int)(MYSPI->DMR0));
MYSPI->DMR0 = 0x12345678;
printf("DMR0 Readback test: 0x%08x\r\n", (unsigned int)(MYSPI->DMR0));

This is outputting:

DMR0 Persistence test: 0x00000000
DMR0 Readback test: 0x00000000

What have I got wrong here?

Thanks, Nick

cc: @jeremyzhou

0 件の賞賛
返信
1 解決策
828件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi @np ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
It should configure the LPSPI clock and enable the lpspi4 clock prior to setting the LPSPI's registers.

jeremyzhou_0-1668146919778.pngjeremyzhou_1-1668146928621.png

TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

元の投稿で解決策を見る

0 件の賞賛
返信
2 返答(返信)
817件の閲覧回数
np
Contributor IV

Worked perfectly, thanks Jeremy!

0 件の賞賛
返信
829件の閲覧回数
jeremyzhou
NXP Employee
NXP Employee

Hi @np ,
Thank you for your interest in NXP Semiconductor products and for the opportunity to serve you.
It should configure the LPSPI clock and enable the lpspi4 clock prior to setting the LPSPI's registers.

jeremyzhou_0-1668146919778.pngjeremyzhou_1-1668146928621.png

TIC

-------------------------------------------------------------------------------
Note:
- If this post answers your question, please click the "Mark Correct" button. Thank you!

 

- We are following threads for 7 weeks after the last post, later replies are ignored
Please open a new thread and refer to the closed one, if you have a related question at a later point in time.
-------------------------------------------------------------------------------

 

0 件の賞賛
返信