Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

06_drivers_gpio_uart: Why is PanicUart initialized after map_pl011_uart() in panic_console_out()? #85

Discussion options

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

You must be logged in to vote

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

Comment options

Hi,

I am not sure I understand. In panic_console_out in tutorial 6, we don't call post_device_driver_init ?

You must be logged in to vote
0 replies
Comment options

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 ?

You must be logged in to vote
0 replies
Comment options

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.

You must be logged in to vote
0 replies
Answer selected by andre-richter
Comment options

thanks, i got it

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Converted from issue

This discussion was converted from issue #85 on December 09, 2020 07:33.

AltStyle によって変換されたページ (->オリジナル) /