打印
[RISC-V MCU 应用开发]

全志芯片Tina Linux 修改 UART 引脚、UART端口

[复制链接]
1383|3
手机看帖
扫描二维码
随时随地手机跟帖
跳转到指定楼层
楼主
神棍地海棠|  楼主 | 2022-11-7 10:08 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
场景一:同样使用UART0,需要从PF2、PF4改到PE2、PE4
  • 修改sys_config.fex(BOOT0与Uboot的串口)
sys_config.fex 的路径是 device/config/chips/t113/configs/evb1/sys_config.fex 中的 uart_debug_port
修改前:
[uart_para]uart_debug_port = 0uart_debug_tx   = port:PF02<font color="rgb(232, 191, 106)"><3></font><font color="rgb(232, 191, 106)"><1></font><font color="rgb(232, 191, 106)"><default></font><font color="rgb(232, 191, 106)"><default></font>uart_debug_rx   = port:PF04<font color="rgb(232, 191, 106)"><3></font><font color="rgb(232, 191, 106)"><1></font><font color="rgb(232, 191, 106)"><default></font><font color="rgb(232, 191, 106)"><default></font>

修改后
[uart_para]uart_debug_port = 0uart_debug_tx   = port:PE02<font color="rgb(232, 191, 106)"><6></font><font color="rgb(232, 191, 106)"><1></font><font color="rgb(232, 191, 106)"><default></font><font color="rgb(232, 191, 106)"><default></font>uart_debug_rx   = port:PE03<font color="rgb(232, 191, 106)"><6></font><font color="rgb(232, 191, 106)"><1></font><font color="rgb(232, 191, 106)"><default></font><font color="rgb(232, 191, 106)"><default></font>

其中<3>改为<6> 是查阅数据手册中 PE2、PE3 的UART0是 Function6 得知的
  • port:PE02    <font color="rgb(232, 191, 106)"><6></font><font color="rgb(232, 191, 106)"><1></font><font color="rgb(232, 191, 106)"><default></font><font color="rgb(232, 191, 106)"><default></font>        ^     ^       PE2脚  引脚功能6(查阅datasheet得知)

    修改设备树(Linux使用的串口输出)
路径:device/config/chips/t113/configs/evb1/board.dts
修改前
<font color="rgb(109, 156, 190)">uart0_pins_a:</font> uart0_pins<a href="home.php?mod=space&uid=2514928" target="_blank">@0</a> {  <font color="rgb(165, 194, 97)">/* For EVB1 board */</font>        pins = <font color="rgb(165, 194, 97)">"PF2"</font>, <font color="rgb(165, 194, 97)">"PF4"</font>;        function = <font color="rgb(165, 194, 97)">"uart0"</font>;        drive-strength = <<font color="rgb(165, 194, 97)">10</font>>;        allwinner,muxsel = <<font color="rgb(165, 194, 97)">3</font>>;        bias-pull-up;};<font color="rgb(109, 156, 190)">uart0_pins_b:</font> uart0_pins<a href="home.php?mod=space&uid=2514798" target="_blank">@1</a> {  <font color="rgb(165, 194, 97)">/* For EVB1 board */</font>        pins = <font color="rgb(165, 194, 97)">"PF2"</font>, <font color="rgb(165, 194, 97)">"PF4"</font>;        function = <font color="rgb(165, 194, 97)">"gpio_in"</font>;};

修改后
<font color="rgb(109, 156, 190)">uart0_pins_a:</font> uart0_pins[url=home.php?mod=space&uid=2514928]@0[/url] {  <font color="rgb(165, 194, 97)">/* For EVB1 board */</font>        pins = <font color="rgb(165, 194, 97)">"PE2"</font>, <font color="rgb(165, 194, 97)">"PE3"</font>;        function = <font color="rgb(165, 194, 97)">"uart0"</font>;        drive-strength = <<font color="rgb(165, 194, 97)">10</font>>;        allwinner,muxsel = <<font color="rgb(165, 194, 97)">6</font>>;        bias-pull-up;};<font color="rgb(109, 156, 190)">uart0_pins_b:</font> uart0_pins[url=home.php?mod=space&uid=2514798]@1[/url] {  <font color="rgb(165, 194, 97)">/* For EVB1 board */</font>        pins = <font color="rgb(165, 194, 97)">"PE2"</font>, <font color="rgb(165, 194, 97)">"PE3"</font>;        function = <font color="rgb(165, 194, 97)">"gpio_in"</font>;};

使用特权

评论回复

相关帖子

沙发
豌豆爹| | 2022-11-7 15:53 | 只看该作者
使用代码框来敲代码把

使用特权

评论回复
板凳
豌豆爹| | 2022-11-7 15:54 | 只看该作者
整个代码显得一团糟

使用特权

评论回复
地板
e_007| | 2022-11-8 17:13 | 只看该作者
本帖最后由 e_007 于 2022-11-8 18:19 编辑

....

使用特权

评论回复
发新帖 我要提问
您需要登录后才可以回帖 登录 | 注册

本版积分规则

260

主题

268

帖子

0

粉丝