I have a custom board with a nRF5340 and need to configure VREGH in DC-DC mode and set 3.0V output on it.
I see the documentation on REGULATORS — Regulator control where it says:
The VDD output voltage is programmed in the register UICR.VREGHVOUT
but am not really sure how to do that. I would think this is a dts/overlay setting, correct? I did follow the Migration guide to Zephyr v4.0.0 as recommended to me on DevZone (though I'm not sure I'm using Zephyr 4.0 but it did not error out when building) which said to use this for setting HV and DC-DC:/* configure VREGMAIN in DC/DC mode */
&vregmain {
regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
};
/* configure VREGRADIO in DC/DC mode */
&vregradio {
regulator-initial-mode = <NRF5X_REG_MODE_DCDC>;
};
/* enable VREGH (HV mode) */
&vregh {
status = "okay";
};
from that I got a zephry.dts which looked like hv and dc-dc might be configured:
regulators: regulator@4000 {
compatible = "nordic,nrf53x-regulators";
reg = < 0x4000 0x1000 >;
status = "okay";
#address-cells = < 0x1 >;
#size-cells = < 0x1 >;
vregmain: regulator@4704 {
compatible = "nordic,nrf5x-regulator";
reg = < 0x4704 0x1 >;
status = "okay";
regulator-name = "VREGMAIN";
regulator-initial-mode = < 0x1 >;
};
vregradio: regulator@4904 {
compatible = "nordic,nrf5x-regulator";
reg = < 0x4904 0x1 >;
status = "okay";
regulator-name = "VREGRADIO";
regulator-initial-mode = < 0x1 >;
};
vregh: regulator@4b00 {
compatible = "nordic,nrf53x-regulator-hv";
reg = < 0x4b00 0x44 >;
status = "okay";
regulator-name = "VREGH";
};
};
and have read DevZone posts like nRF5340 - How to enable High Voltage mode where the solution was to use nrfjprog: $ nrfjprog -f nrf53 –memwr 0x00FF8010 –val 5
but I'm not even sure what the values mean and think it they should be set in the devicetree somewhere as I am using nRF Connect in VS Code and I press the build/flash buttons vs using the command line.
I see the VREGHVOUT documentation but am not sure what to do with it:
I also saw this post [nrf5340] Is there a way to set VREGHVOUT to 3.3V before mcuboot runs? but am just running tests and am not using MCU Boot yet, but is this the right/best way to do it?