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
解決済! 解決策の投稿を見る。
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.
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.
-------------------------------------------------------------------------------
Worked perfectly, thanks Jeremy!
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.
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.
-------------------------------------------------------------------------------