UART4 interfaces

Dear Support,

The ls command does not show the Verdin pin-compatible UARTs for UART4 when I am trying to run RTOS tests on it.


and the ststus on the DT is okay in the imx8mm-verdin-dahlia.dtsi file
image

image

Image
Should I change or add some lines in order to use debugging for the real-time OS (Cortex-M) or general-purpose.
Thanks in advance.
Best regards,
Mehrdad

Hello @Mehrdad,
What are you trying to achieve? Do you want to use the UART4 as a standard UART in order to talk to external peripherals?
If you are trying to use the linux running on the module to connect to the Cortex M debug serial, that won’t work. The serial port pins are connected to the FTDI chip on the dahlia, and only one of the processors (either Cortex-M or Cortex-A) can drive the pins at any given time.
If you have the serial mapped to the Cortex-M it won’t be accessible on linux. If you have the serial mapped on the Cortex-A the serial won’t be accessible on the RTOS.

To connect to the Cortex-M debug uart you should use your PC connected with an USB cable to the Dahlia board. You can find more information about this here:

Regards,
Rafael

Hello @rafael.tx ,

Thanks for your reply.

I have a Verdin development board. We created a custom PCB and want to use the iMX8 Mini for it. At the moment, I have two issues.

Firstly, I changed the status for UART2 and UART4, but both of them are not showing in the /dev/ directory. I need UART2 to connect GNSS, as you can see on the image, but it is not there.

Secondly, I want to run a “Hello World” on the Cortex-M using UART4.

Best regards,
Mehrdad

Dear Support,

Any update?

image

Best regards,
Mehrdad

Hi @Mehrdad ,

Sorry for the delay. The support team was in preparation and is now attending the Embedded World in Nuremberg.

I pinged my colleague who’s more familiar with the Cortex-M and its usage. He will come back to you as soon as possible.

Best Regards
Kevin

Hi @Mehrdad,

Can you please share your hardware version and software versions? Are you using TorizonCore?
With this information, I can reproduce the issue on my side to give you a proper answer.

Best Regards,
Hiago.

Hi @hfranco.tx ,
Thanks for your help. I am using TorizonCore 5

I have a Verdin iMX8 Mini. I have modified the DT a few times, such as changing the UART status and adding it to the /dev directory. Today, I attempted to reinstall TorizonCore 5 and added SPI1 through modification of UART2 in the DT. However, that modification did not work for me. Could you please take a look at the DT file related to my modification?

I did not change anything in these files.
imx8mm-pinfunc.h (63.8 KB)
imx8mm.dtsi (43.3 KB)
imx8mm-verdin-dev.dtsi (1.4 KB)
imx8mm-verdin-nonwifi.dtsi (1.3 KB)
imx8mm-verdin-nonwifi-dev.dts (414 Bytes)
I changed these:
yaml file
tcbuild.yaml (4.6 KB)
imx8mm-verdin-dahlia.dtsi (2.5 KB)
imx8mm-verdin.dtsi (34.6 KB)

I used the same for previews tests, that time I had both SPI’s

but now I have 3 UART and nothing added foe second SPI :frowning: just after reinstalling the TorizonCore

Best regards,
Mehrdad

Hi @Mehrdad,

Just to make things a bit clearer, do you want to add an extra SPI and also use the Hello world from the cortex M4? Is that what you want to achieve?

Check the device tree that is being loaded. In my case, I’m using the development board, so my device tree is:

torizon@verdin-imx8mm-06827728:~$ sudo fw_printenv fdtfile 
Password: 
fdtfile=imx8mm-verdin-wifi-dev.dtb

Checking my UART and SPI, I have these enabled by default:

torizon@verdin-imx8mm-06827728:~$ ls -lh /dev/ | grep uart
lrwxrwxrwx 1 root    root           7 Mar 14 16:48 verdin-uart1 -> ttymxc1
lrwxrwxrwx 1 root    root           7 Mar 14 16:48 verdin-uart2 -> ttymxc2
lrwxrwxrwx 1 root    root           7 Mar 14 16:48 verdin-uart3 -> ttymxc0
torizon@verdin-imx8mm-06827728:~$ ls -lh /dev/ | grep spi 
crw-rw-r-- 1 root    spidev  153,   0 Mar 14 16:48 spidev1.0
lrwxrwxrwx 1 root    root           9 Mar 14 16:48 verdin-spi-cs0 -> spidev1.0

Which makes sense according to the development board device tree. Are you using Dahlia?

Best Regards,
Hiago.

Thank you so much for your time
the same result is here!
image
Verdin is the development board I use.

I modified the SPI on the DT and tested it with my component, and it worked for me before, and I reinstalled TorizonCore 5 again and made the same changes for SPI on the DT, but now I can not see it in the /dev directory.

I had an issue with the lack of a driver for LAN78XX. I needed to install TorizonCore 6, but I encountered some challenges and stopped working on it.

As a result, I decided to install TorizonCore 5, but I faced some issues after the installation process, I mean the SPIdev0.0.

really appreciate your help.
Best regards,
Mehrdad

Hi @Mehrdad,

For the Cortex M4 using Dahlia and Verdin iMX8M Mini, the hello world will work by default. When you connect a USB cable to the debug port, you should see 4 USB ports in your host machine:

>> ls /dev/ | grep ttyUSB
ttyUSB0
ttyUSB1
ttyUSB2
ttyUSB3

USB3 is the linux terminal that you will use to interface with TorizonCore. USB2 is the debug port from the Cortex M4. So you can simply connect to this port (for example, by using minicom) and then run the hello world binary as described in the article.

For the SPI part, you can remove the SPIDEV by changing the imx8mm-verdin-dahlia.dtsi file or by creating an overlay that disables this node:

 /* Verdin SPI_1 */
&ecspi2 {
	status = "okay";

	spidev20: spidev@0 {
		compatible = "toradex,evalspi";
		reg = <0>;
		spi-max-frequency = <10000000>;
		status = "okay";
	};
};

Then you will disable the spidev in your device. Can you please check that?

Best Regards,
Hiago.

Hi @hfranco.tx

Thanks for the information about USB, but I would like to use UART for the terminal interface. Using USB to Serial Cable, I can see the Linux terminal on UART3, and I am sure UART 4 is for debugging the Cortex M4 and RTOS, and since we have a custom board, I want to test with UART 4 instead of USB2.

In regards to the SPI_1, I disabled it, and in the output_directory I can see the changes after checking out the DT, and after deploying it to the SOM, I still I have it in / dev/ directory.

Best regards,
Mehrdad

Hi @Mehrdad,

The UART connects to the FTDI chip and then it’s converted to USB. So in this case you are already using the UART for the terminal interface. You can check the Verdin Development Board Schematics for more information:

If you need to access them directly, without the FTDI chip, you will need a UART to USB converter and you can access the following pins:

They will be available in your Development board breakout connector.

SPI interface, do you want to completely disable that? Do you want to use it as a different function?

Best Regards,
Hiago.

Hi @hfranco.tx ,
Thank you so much for your time, That’s correct, I used jumpers for accessing the UARTs and I did enable the UART4 and UART2 on the DT files, but on the /dev/ I can not see the UART4 and SPI0.0.
I do not want to disable it, I need them :slight_smile: I enable ecspi1 on the imx8mm-verdin-dahlia.dtsi and add pinctrol fo it


and created like SPI_1
image

But I don’t have the second SPI.

Also I did a test and disable SPI_1 and after depolying still I can see that in the /dev directory

Best regards,
Mehrdad

Hi Support,

Could you please check the attached file to see if there is any issue with deploying images in Ubuntu? I disabled the SPI to see if it would be removed but it is still there and probably my possess has issue
ubuntoutput.txt (7.0 KB)
s. If you could take a look at the text file, I would really appreciate it.

and on the Linux side I have pending for ostree status, I download the TorizonCore Long Term Supported (LTS) Releases.[ Verdin iMX8M Mini (2022-07-28 | 5.7.0+build.17.container | 202.12 MB)]

Best regards,
Mehrdad

Hello @Mehrdad ,

Looking at your device tree I see that &ecspi2 status is "disabled",

most probably that is the cause why you don’t see it.

Best regards,
Josep

Hello @Mehrdad ,
Do you have any updates on this issue?

Best regards,
Josep

1 Like

HI @josep.tx ,

After downloading the latest release, I reinstalled it, and now I’m able to modify the DT. Everything seems to be working fine, and I wanted to express my gratitude for your support and time.

Best regards,
Mehrdad