<?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: IMX Linux problem with SPI module.</title>
    <link>https://community.nxp.com/t5/i-MX-Processors/IMX-Linux-problem-with-SPI-module/m-p/1723993#M212664</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You module is bad, you have to write this module on your kernel and build it, then reboot and try insmod and see the dmesg to see if is there.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
    <pubDate>Fri, 15 Sep 2023 14:43:51 GMT</pubDate>
    <dc:creator>Bio_TICFSL</dc:creator>
    <dc:date>2023-09-15T14:43:51Z</dc:date>
    <item>
      <title>IMX Linux problem with SPI module.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX-Linux-problem-with-SPI-module/m-p/1723220#M212611</link>
      <description>&lt;P&gt;Hi, hope you are doing well, I'm using a custom board with imxrt1062 and Linux kernel version 4.5.0, the Linux distribution is working well, the board is very similar to the MIMXRT1060-EVK.&lt;/P&gt;&lt;P&gt;All the embedded interfaces on Linux distribution are working well, serial, i2c, Eth, USB,&amp;nbsp; all of them are embedded, except the SPI that is a external module that should be inserted after kernel boot.&lt;/P&gt;&lt;P&gt;At circuit level:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I added one SPI (LPSPI4) interface to manage a NOR SPI flash, the pins are not shared with any other thing.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;At software level:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;I added support on linux kernel for external modules.&lt;/LI&gt;&lt;LI&gt;The interface LPSPI4 and m25p80m device like is declared on "device tree".&lt;/LI&gt;&lt;LI&gt;The pinctrl is set on iomux.&amp;nbsp; &amp;nbsp;.&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;I can build the module using:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;make CFLAGS=-PIC /home/../linux (Linux kernel files)&amp;nbsp; M=(source files).&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The module structure (m25p80.ko) seems to be ok, using "file" and "modinfo" commands on Linux I can see the following:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;m25p80.ko: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), Build[]..........., not stripped.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;vermagic: 4.5.0 mod_unload ARMv7 thumb2&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;The information is ok, but when I try to insert the module using "insmod" command, I get the following error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;#insmod m25p80.ko&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;m25p80: unknown relocation: 161&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;insmod: can't insert 'm25p80.ko': invalid module format.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;I found that the 161 number is in the library "elf.h", there is a line:&lt;/P&gt;&lt;P&gt;#define R_SH_PLT32 161&lt;/P&gt;&lt;P&gt;So, seems to be that could be an error on module's format, but "file" returns that the module is of type ELF 32.&lt;/P&gt;&lt;P&gt;I don't understand what is going on, is my first time compiling and using Linux kernel modules, I'm shure that I'm missing something.&lt;/P&gt;&lt;P&gt;I've read many things about kernel modules, but I can't find the solution for this.&lt;/P&gt;&lt;P&gt;Maybe you can help me.&lt;/P&gt;&lt;P&gt;Many thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 14 Sep 2023 14:29:12 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX-Linux-problem-with-SPI-module/m-p/1723220#M212611</guid>
      <dc:creator>nicolasmuratore</dc:creator>
      <dc:date>2023-09-14T14:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: IMX Linux problem with SPI module.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX-Linux-problem-with-SPI-module/m-p/1723993#M212664</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;You module is bad, you have to write this module on your kernel and build it, then reboot and try insmod and see the dmesg to see if is there.&lt;/P&gt;
&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 15 Sep 2023 14:43:51 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX-Linux-problem-with-SPI-module/m-p/1723993#M212664</guid>
      <dc:creator>Bio_TICFSL</dc:creator>
      <dc:date>2023-09-15T14:43:51Z</dc:date>
    </item>
    <item>
      <title>Re: IMX Linux problem with SPI module.</title>
      <link>https://community.nxp.com/t5/i-MX-Processors/IMX-Linux-problem-with-SPI-module/m-p/1731581#M213368</link>
      <description>&lt;P&gt;Thanks Bio_TICFSL, I compiled the module inside the kernel, after using "insmod" I get the following message:&lt;/P&gt;&lt;P&gt;"Error: Driver "m25p80" is already registered, aborting...."&lt;/P&gt;&lt;P&gt;So, seems to be that the kernel has a driver previously loaded, I suppose that is because I set the flash-nor support on the configuration menú.&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, even when the driver seems to be registered, activating some debugger I found the following error on dmesg:&lt;/P&gt;&lt;P&gt;fsl_lpspi 403a0000.lpspi: no init pinctrl state&lt;BR /&gt;fsl_lpspi 403a0000.lpspi: no idle pinctrl state&lt;BR /&gt;Entering fsl_lpspi_probe&lt;BR /&gt;fsl_lpspi: probe of 403a0000.lpspi failed with error -2&lt;/P&gt;&lt;P&gt;So, the driver lpspi is registered, but not probed, I don't know what the "error -2" means, I can't find it.&lt;/P&gt;&lt;P&gt;Many thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 28 Sep 2023 21:22:40 GMT</pubDate>
      <guid>https://community.nxp.com/t5/i-MX-Processors/IMX-Linux-problem-with-SPI-module/m-p/1731581#M213368</guid>
      <dc:creator>nicolasmuratore</dc:creator>
      <dc:date>2023-09-28T21:22:40Z</dc:date>
    </item>
  </channel>
</rss>

