<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>i.MX ProcessorsのトピックRe: i.MX8M Mini: Using UART in U-Boot causes CPU reset</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2001434#M231179</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I checked the&amp;nbsp;repository,&amp;nbsp;drivers/serial/serial_mxc.c doesn't set up the clocks and there is no uart node in&amp;nbsp;&lt;A href="https://github.com/u-boot/u-boot/blob/v2024.01/drivers/clk/imx/clk-imx8mm.c" target="_blank"&gt;https://github.com/u-boot/u-boot/blob/v2024.01/drivers/clk/imx/clk-imx8mm.c&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We don't recommend you use mainline uboot, please use uboot-imx.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/nxp-imx/uboot-imx" target="_blank"&gt;https://github.com/nxp-imx/uboot-imx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/nxp-imx/uboot-imx/blob/lf_v2022.04/board/freescale/imx8mm_evk/imx8mm_evk.c" target="_blank"&gt;https://github.com/nxp-imx/uboot-imx/blob/lf_v2022.04/board/freescale/imx8mm_evk/imx8mm_evk.c&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2024 00:19:27 GMT</pubDate>
    <dc:creator>Zhiming_Liu</dc:creator>
    <dc:date>2024-11-26T00:19:27Z</dc:date>
    <item>
      <title>i.MX8M Mini: Using UART in U-Boot causes CPU reset</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2000118#M231116</link>
      <description>&lt;P&gt;I need to read from (and write to) a device connected to &lt;STRONG&gt;uart1&lt;/STRONG&gt; in U-Boot to complete board initialization.&lt;/P&gt;&lt;P&gt;For this purpose I'm using the following code (simplified form given):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;struct udevice *dev = uclass_get_device_by_name(UCLASS_SERIAL, "serial at 30860000", &amp;amp;dev);
struct dm_serial_ops *ops = serial_get_ops(dev);
ops-&amp;gt;setbrg(dev, 115200);
ops-&amp;gt;putc(dev, 'f');&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Unfortunately this causes a CPU reset in &lt;FONT face="courier new,courier"&gt;putc()&lt;/FONT&gt; (serial_mxc.c) when performing &lt;FONT face="courier new,courier"&gt;writel()&lt;/FONT&gt; on the UART TX register (0x30860040):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="c"&gt;    "Error" handler, esr 0xbf000002
    elr: 00000000402605f0 lr : 00000000402610f8 (reloc)
    elr: 00000000bff865f0 lr : 00000000bff870f8
    x0 : 000000000000006d x1 : 000000000000081a
    x2 : 00000000bffabf00 x3 : 00000000bdf1c630
    x4 : 00000000bdf1cf20 x5 : 00000000bdf21804
    x6 : 000000000000000f x7 : 00000000bdf1cf50
    x8 : 00000000bdf1ce80 x9 : 00000000ffffffd0
    x10: 0000000000000002 x11: 00000000ffffffff
    x12: 00000000bdf1d080 x13: 0000000000004884
    x14: 0000000000000000 x15: 00000000bdf1c6a8
    x16: 0000000040234dc4 x17: 000000000000aa80
    x18: 00000000bdf25d80 x19: 00000000bdf1cf20
    x20: 00000000bdf1c670 x21: 00000000ffffffc8
    x22: 00000000bdf1ce8a x23: 00000000bdf1cf20
    x24: 00000000bdf1c670 x25: 000000000000081a
    x26: 00000000bff9c000 x27: 00000000bffabf00
    x28: 0000000000000000 x29: 00000000bdf1c560
    
    Code: d00000ba 91263340 f90037e0 39400360 (350001a0)
    Resetting CPU ...&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Via trial-and-error I have found out that the problem occurs with &lt;STRONG&gt;uart1&lt;/STRONG&gt;, &lt;STRONG&gt;uart3&lt;/STRONG&gt; and &lt;STRONG&gt;uart4&lt;/STRONG&gt; but not with &lt;STRONG&gt;uart2&lt;/STRONG&gt;. In case of the latter there is at least no CPU reset, but given that uart2 is the U-Boot console device I cannot do anything else with it.&lt;/P&gt;&lt;P&gt;It also seems that it's only writing to the TX register causes the issue. Reading from the UART seems to work fine as well as setting the baud rate or reading the TXFULL register.&lt;/P&gt;&lt;P&gt;Any suggestions what I might be doing wrong here? Is UART2 special in any way compared to the others?&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;</description>
      <pubDate>Fri, 22 Nov 2024 13:08:35 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2000118#M231116</guid>
      <dc:creator>akoch</dc:creator>
      <dc:date>2024-11-22T13:08:35Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8M Mini: Using UART in U-Boot causes CPU reset</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2000860#M231151</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;The clock and pad property of uart2 will be set in&amp;nbsp;board/freescale/imx8mm_evk/imx8mm_evk.c, you need check your board file.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Then try to add pads config and init_uart_clk(0) for UART1.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 08:30:50 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2000860#M231151</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2024-11-25T08:30:50Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8M Mini: Using UART in U-Boot causes CPU reset</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2000880#M231152</link>
      <description>&lt;P&gt;Hi Zhiming,&lt;/P&gt;&lt;P&gt;thank you for your response!&lt;/P&gt;&lt;P&gt;For my platform, which is indeed very close to the i.MX8MM EVK, I am using &lt;FONT face="courier new,courier"&gt;CONFIG_DM_SERIAL&lt;/FONT&gt; so I don't need to set up the pads or clocks manually.&lt;/P&gt;&lt;P&gt;This is all done via device tree (.dts) and automatically picked up by &lt;FONT face="courier new,courier"&gt;drivers/serial/serial_mxc.c&lt;/FONT&gt;.&lt;/P&gt;&lt;P&gt;For reference, here is how the i.MX8MM EVK is set up in my U-Boot version:&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/u-boot/u-boot/blob/v2024.01/board/freescale/imx8mm_evk/imx8mm_evk.c" target="_blank"&gt;https://github.com/u-boot/u-boot/blob/v2024.01/board/freescale/imx8mm_evk/imx8mm_evk.c&lt;/A&gt;&lt;/P&gt;&lt;P&gt;This is working fine for UART2 but not for UART1, UART3 and UART4.&lt;/P&gt;&lt;P&gt;Can you tell me if there's a difference between those UARTs? I've noticed that some of them have SDMA definitions and some don't. Could this be the issue?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Best regards&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Nov 2024 08:44:25 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2000880#M231152</guid>
      <dc:creator>akoch</dc:creator>
      <dc:date>2024-11-25T08:44:25Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8M Mini: Using UART in U-Boot causes CPU reset</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2001434#M231179</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I checked the&amp;nbsp;repository,&amp;nbsp;drivers/serial/serial_mxc.c doesn't set up the clocks and there is no uart node in&amp;nbsp;&lt;A href="https://github.com/u-boot/u-boot/blob/v2024.01/drivers/clk/imx/clk-imx8mm.c" target="_blank"&gt;https://github.com/u-boot/u-boot/blob/v2024.01/drivers/clk/imx/clk-imx8mm.c&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;We don't recommend you use mainline uboot, please use uboot-imx.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/nxp-imx/uboot-imx" target="_blank"&gt;https://github.com/nxp-imx/uboot-imx&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://github.com/nxp-imx/uboot-imx/blob/lf_v2022.04/board/freescale/imx8mm_evk/imx8mm_evk.c" target="_blank"&gt;https://github.com/nxp-imx/uboot-imx/blob/lf_v2022.04/board/freescale/imx8mm_evk/imx8mm_evk.c&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;Best Regards,&lt;BR /&gt;Zhiming&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 00:19:27 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2001434#M231179</guid>
      <dc:creator>Zhiming_Liu</dc:creator>
      <dc:date>2024-11-26T00:19:27Z</dc:date>
    </item>
    <item>
      <title>Re: i.MX8M Mini: Using UART in U-Boot causes CPU reset</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2001866#M231212</link>
      <description>&lt;P&gt;Hi Zhiming,&lt;/P&gt;&lt;P&gt;thank you very much for taking the time to look at the code base.&lt;/P&gt;&lt;P&gt;You were right, there was indeed a missing clock initialization. All I needed to add was a simple call during board init:&lt;/P&gt;&lt;LI-CODE lang="c"&gt;init_uart_clk(0);&lt;/LI-CODE&gt;&lt;P&gt;It is now working fine &lt;LI-EMOJI id="lia_slightly-smiling-face" title=":slightly_smiling_face:"&gt;&lt;/LI-EMOJI&gt;&lt;/P&gt;&lt;P&gt;I understand your recommendation towards u-boot-imx but we prefer to stay as close to upstream as possible as we have some additional modules that rely on DM which u-boot-imx seems to be missing.&lt;/P&gt;&lt;P&gt;Thanks again and best regards,&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 09:46:04 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/i-MX8M-Mini-Using-UART-in-U-Boot-causes-CPU-reset/m-p/2001866#M231212</guid>
      <dc:creator>akoch</dc:creator>
      <dc:date>2024-11-26T09:46:04Z</dc:date>
    </item>
  </channel>
</rss>

