-
-
Notifications
You must be signed in to change notification settings - Fork 846
06_drivers_gpio_uart: Why is PanicUart initialized after map_pl011_uart() in panic_console_out()? #85
-
I am new to Raspberry Pi and operating system, so I don’t know much about circuits and software.
In main.rs
file, as the comment says, the fn post_device_driver_init
is executed after device_drivers init
.but method panic_console_out
in bsp\raspberrypi\console
, it's reverse. Hope to get your answer
Beta Was this translation helpful? Give feedback.
All reactions
Got it!
Yes, in this case, the order is not important from the software point-of-view.
map_pl011_uart(_)
ensures that the UART TX and RX signals are mapped to the respective pins on your Pi.
The init()
if the UART ensures it will be functional.
You'll need both in the end, but there is no requirement that the pins are mapped first and then the UART is set up, or vice versa.
Replies: 4 comments
-
Hi,
I am not sure I understand. In panic_console_out
in tutorial 6, we don't call post_device_driver_init
?
Beta Was this translation helpful? Give feedback.
All reactions
-
In main.rs\kernel_init()
, post_device_driver_init
called after all_device_drivers
is init()
, and the method post_device_driver_init
just called super::GPIO.map_pl011_uart();
, finally it is bcm2xxx_gpio.rs\map_pl011_uart(_)
.
And in bsp\raspberrypi\console\panic_console_out()
, the bcm2xxx_gpio.rs\map_pl011_uart(_)
called before panic_uart.init();
.
Is it because their order is not important ?
Beta Was this translation helpful? Give feedback.
All reactions
-
Got it!
Yes, in this case, the order is not important from the software point-of-view.
map_pl011_uart(_)
ensures that the UART TX and RX signals are mapped to the respective pins on your Pi.
The init()
if the UART ensures it will be functional.
You'll need both in the end, but there is no requirement that the pins are mapped first and then the UART is set up, or vice versa.
Beta Was this translation helpful? Give feedback.
All reactions
-
thanks, i got it
Beta Was this translation helpful? Give feedback.