Replies: 13 comments 26 replies
-
@novalisek I think you just need in the board port that builds MCUBOOT to call |
Beta Was this translation helpful? Give feedback.
-
@galak what do you mean by "board port"? I am just using my own dts overlay. thanks |
Beta Was this translation helpful? Give feedback.
-
You are building for some board correct? How are you getting dcdc set right now? |
Beta Was this translation helpful? Give feedback.
-
I am using nrf52dk_nrf52832 as base with my overlay. In my firmware I normaly use |
Beta Was this translation helpful? Give feedback.
-
I'm not an expert w/regards to mcuboot, but its my understanding that the mcuboot build would pull in part of zephyr and I assume that includes some board code. So in theory you should be able to add something in boards/arm/nrf52dk_nrf52832 that would call gpio_pin_set() and that should than happen in both mcuboot and zephyr. |
Beta Was this translation helpful? Give feedback.
-
@de-nordic, @d3zd3z I'm guessing you might be able to answer @novalisek question better than I can. |
Beta Was this translation helpful? Give feedback.
-
@novalisek Can you share the DTS error log? |
Beta Was this translation helpful? Give feedback.
-
@novalisek The Update: I do not think that Zephyr has basic device for on/off switch, so the "gpio-leds" device is the closest think you may get. |
Beta Was this translation helpful? Give feedback.
-
We are doing something similar in downstream projects. Basically, we have added a |
Beta Was this translation helpful? Give feedback.
-
I use a regulator in the device tree to do this for a zephyr application (on nrf91, zephyr 2.6):
This works fine for my use-case. The specified gpio is pulled low when the application starts. No need to modify any source code for this. Only |
Beta Was this translation helpful? Give feedback.
-
Hi, has it been decided which way to choose? |
Beta Was this translation helpful? Give feedback.
-
I've noticed the mentioning of board specific code to tackle this problem. An example can be found at I'm looking for a solution where a GPIO, connected to a load switch, controls the power to a sensor and I want to enable the GPIO before fetching a sample. The reason is that my device is low power, but the sensor isn't. This is a common problem when dealing with low power battery powered devices that have not-so-low-power sensors on board. I also want the driver init to be called when the GPIO gets enabled. I probably should be using the regulator driver here (although I have no clue how the driver re-init is called) but in my case it is not a regulator. It's more like a gpio-switch (as mentioned before). Although I need something different than what @novalisek needs I felt the need to post it here as when you look at the broader issue I have to disagree with having to use board code as the means to solve these user specific cases. And in my opinion a generic gpio driver does absolutely make sense. |
Beta Was this translation helpful? Give feedback.
-
I have a similar need and came across this - have there been any developments in code or thinking in the mean time for what the cleanest method would be? I'm using nRF Connect SDK v1.7.1 / Zephyr 2.6.99 with whatever specific commits Nordic bundles Zephyr as. I am using it for a GPIO which holds an external power circuit (for the whole board) on, so I need it to be held high during MCUBoot to work with remote firmware updates, but also able to be changed by the main image application code to initiate a shutdown. Something in DTS only would be neat, as long as a user application could then override it. But if I need to add a board.c for the board file for MCUboot to do it in code that seems a decent enough compromise, as long as the MCUBoot code itself doesn't need tinkering with. |
Beta Was this translation helpful? Give feedback.
-
Is your enhancement proposal related to a problem? Please describe.
Hi, I would like to turn on GPIO from DTS, I need to turn/hold ON "enable" pin of DC/DC converter as soon as firmware starts
Describe the solution you'd like
To be able to use something like
When I try to add GPIO_OUTPUT_HIGH, I get DTS errors.
Additional context
I need this for MCUBOOT - I can turn on GPIO manualy by gpio_pin_set() in my firmware, but I also need to do it in MCUBOOT, so that DC/DC stays ON when user releases power-on button, because it takes few seconds if you swap firmware and I don't want DC/DC to be turned OFF while swapping, if user releases the button earlier :)
Describe alternatives you've considered
I could modify MCUBOOT source to use gpio_pin_set(), but I would better not to touch MCUBOOT source code and use DTS for this.
May be this feature is already possible and I am just doing something wrong ...
Thanks
Beta Was this translation helpful? Give feedback.
All reactions