system_init_fn.txt 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. # This file documents the expected order of execution of ESP_SYSTEM_INIT_FN functions.
  2. #
  3. # When adding new ESP_SYSTEM_INIT_FN functions or changing init priorities of existing functions,
  4. # keep this file up to date. This is checked in CI.
  5. # When adding new functions or changing the priorities, please read the comments and see if
  6. # they need to be updated to be consistent with the changes you are making.
  7. #
  8. # Entries are ordered by the order of execution (i.e. from low priority values to high ones).
  9. # Each line has the following format:
  10. # prio: function_name in path/to/source_file on affinity_expression
  11. # Where:
  12. # prio: priority value (higher value means function is executed later)
  13. # affinity_expression: bit map of cores the function is executed on
  14. # esp_timer has to be initialized early, since it is used by several other components
  15. 100: esp_timer_startup_init in components/esp_timer/src/esp_timer.c on CONFIG_ESP_TIMER_ISR_AFFINITY
  16. # HW stack guard via assist-debug module.
  17. 101: esp_hw_stack_guard_init in components/esp_system/hw_stack_guard.c on ESP_SYSTEM_INIT_ALL_CORES
  18. # esp_sleep doesn't have init dependencies
  19. 105: esp_sleep_startup_init in components/esp_hw_support/sleep_gpio.c on BIT(0)
  20. 106: sleep_clock_startup_init in components/esp_hw_support/sleep_clock.c on BIT(0)
  21. 107: sleep_sys_periph_startup_init in components/esp_hw_support/sleep_system_peripheral.c on BIT(0)
  22. # app_trace has to be initialized before systemview
  23. 115: esp_apptrace_init in components/app_trace/app_trace.c on ESP_SYSTEM_INIT_ALL_CORES
  24. 120: sysview_init in components/app_trace/sys_view/esp/SEGGER_RTT_esp.c on BIT(0)
  25. # the rest of the components which are initialized from startup.c
  26. # [refactor-todo]: move init calls into respective components
  27. 200: init_components0 in components/esp_system/startup.c on BIT(0)
  28. # usb_console needs to create an esp_timer at startup.
  29. # This can be done only after esp_timer initialization, which is now in init_components0.
  30. 220: esp_usb_console_init_restart_timer in components/esp_system/port/usb_console.c on BIT(0)
  31. # usb_serial_jtag needs to create and acquire a PM clock at startup.
  32. # This makes more sense to be done after esp_pm_impl_init, which is initialized in init_components0.
  33. 230: usb_serial_jtag_conn_status_init in components/driver/usb_serial_jtag/usb_serial_jtag_connection_monitor.c on BIT(0)