This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

About [195] SPIM: SPIM3 continues to draw current after disable

Hello there,
I am using nrf52840
The mark is: N52840 QIAAC0,
SDK: nRF5_SDK_15.0.0_a53641a,
SD: nRF5_SDK_15.0.0_a53641a,
I used the BLE ANCS routine and encountered this problem when I added the SPIM3 to driver LCD.
Problem Description: I used SPIM3's easyDMA driver LCD and turned on the hw_ss and dcx pins.

I want to turn on and initialize SPIM3 before using the screen, and turn off SPIM3 when not in use to save power.
I have implemented it, but after many tests and comparisons, SPIM3 still consumes about 900uA of current after disable.

Then, I found the ID: 198 in the official website errata "nRF52840_Rev_1_Errata_v1.0.pdf", replaced by the recently updated SDK "nRF5_SDK_15.3.0_59ac345"
nRF5_SDK_15.3.0_59ac345\modules\nrfx\drivers\src\nrfx_spim.c, after which a system reboot occurs.
As a comparison I removed *(volatile uint32_t *)0x4002F004 = 1; the system is normal.
During the experiment, it was also found that if you remove the idle_state_handle() in the main function; the system is also normal.

I guess that after the operation *(volatile uint32_t *)0x4002F004 = 1; whether it needs to wait for some event to complete, then the system can go to sleep.

I hope to provide some ideas or suggestions.
  • Hi,

    I am having a bit of problems following the last parts of your question, describing what you have done. For instance, you do something that cause a "system reboot". A reset is typically triggered by an error check, so this might be what you are seeing. You should be able to see what is happening by using a debugger. I also do not understand why you mean by system being normal when you remove the call to idle_state_handle(). It would probably be easier to understand if you show your code.

    That aside, you can try the following to make sure that the SPIM3 peripheral doe snot consume any power while not being used. Once you are don with it, uninitialize the driver and execute this snippet, which essentially resets the peripheral:

    *(volatile uint32_t *)0x4002FFFC = 0;   // Power down SPIM3
    *(volatile uint32_t *)0x4002FFFC;       //
    *(volatile uint32_t *)0x4002FFFC = 1;   // Power on SPIM3 so it is ready for next time
    

    Then you just need to initialize the driver again before using it the next time.

Related