Replies: 2 comments
-
You should likely be using regulators, power domains or runtime PM in your case. You will find some examples in-tree. |
Beta Was this translation helpful? Give feedback.
0 replies
-
I didn't found out how to delay driver initialization using "regulators, power domains or runtime PM" but for me worked sth like this: extern void __start(void);
void main(void) {
...
/// Reboot when SE_EN is low
if ((NRF_P1_S->IN & (1<<2)) == 0) {
if (gpio_pin_configure_dt(&sd_en, GPIO_INPUT | GPIO_OUTPUT_ACTIVE) < 0) {
LOG_ERR("GPIO sd_en: Device is not ready.");
return;
}
PIN_HIGH(sd_en);
LOG_WRN("Rebooting with SD_EN high in 100ms...");
log_panic(); /// Flush console buffers
k_msleep(100);
__start();
} On first power up boot I check SD_EN pin state. When it's LOW I set it HIGH, wait 100ms and do system soft reboot with jumping to reset vector destination using |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Is your feature request related to a problem? Please describe.
Is it possible to initialize device driver from main thread ?
I have a problem that device driver's HW voltages are enabled at late phase and
driver init from kernel will fail.
I did notice this:
#19448
and it says:
"Applications that are power-sensitive are likely to have devices that are to be left off at startup, but become enabled at certain points based on application logic."
But I did not find any information how to do this...
Describe the solution you'd like
Possible to initialize (and use) device driver from user space threads like main thread.
Describe alternatives you've considered
Additional context
Example: STM kit b_u585i_iot02a
west build -p auto -b b_u585i_iot02a_ns samples\drivers\spi_flash
main.c:
Beta Was this translation helpful? Give feedback.
All reactions