This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

initialise periphery

Hi I'm new on zephyr

 

In my hardware the sensors around the soc are most of time not powered.

At Startup the OS initialise SPI, I2C, UART and some pins are set to 1.

This results in parasitic power of the sensor and the pin can be overloaded.

Is there a way to not initialise some periphery until it is used?

 

Thanks for any solution.

Parents
  • Hello Reto!

    Is there a way to not initialise some periphery until it is used?

    Not using the zephyr drivers. You could switch to using the nrfx ones, however that has its downsides too.

    Could you explain further what you mean by parasitic power and how you have observed this happening? And what sensor are you using?

    Best regards,

    Elfving

     

Reply
  • Hello Reto!

    Is there a way to not initialise some periphery until it is used?

    Not using the zephyr drivers. You could switch to using the nrfx ones, however that has its downsides too.

    Could you explain further what you mean by parasitic power and how you have observed this happening? And what sensor are you using?

    Best regards,

    Elfving

     

Children
  • Hello Elfving

    I've a radar sensor, a ultrasonic sensor, a time of flight sensor, a camera, a sd card.

    Most time this devices are powered of to save batteries.

    The device are connected over SPI or I2C or UART to the nRF9160.

    After powerup Zephyr initialise SPI, I2C, UART and for example TX are driven to High.

    Now the Sensor become a high over the data line and the internal ESD protection diodes forward this to VDD.

    Normally a GPIO is overloaded with the load of some sensors. 

    So I need a solution to initialise SPI, I2C, UART on demand and only after the sensor power is on.

  • Hey again Reto!

    I see. Try putting these peripherals in another power management state and see if that fixes your issue. For instance PM_STATE_SUSPEND_TO_DISK.

    There is a great new blog post about it here.

    If that doesn't help we will have to look at manually disabling the drivers.

    Best regards,

    Elfving

  • Hi

    I read the blog but I didn't see any solution for my problem.

    My problem is, that the OS initialise UART, SPI, I2C at startup. At this time the external Sensor are not powered.

    Before I go to Standby I set all periphery to PM_DEVICE_STATE_OFF. After that I switch off the power of the Sensors. 

    After Standby I switch on the power of the Sensors and then I set all periphery to PM_DEVICE_STATE_ACTIVE.

    This works fine.

    But How can I force the OS to initialise the periphery in PM_DEVICE_STATE_OFF.

    Otherwise the periphery power my sensor until the Power Pin is enabled.

  • Then you might have to disable the Zephyr drivers. 

    First disable the individual device tree nodes in order to prevent the zephyr drivers from allocating devices for them. Make sure you have the status = "disabled"; on the DT node you don't want to a device allocated for, and it will be free to use elsewhere.

    Then you are free to use nrfx directly or modify required drivers for your purpose. We have done handled similar cases before with a trick like this.

    Best regards,

    Elfving

Related