[QNX 7.0_x86_generic] Serial Port Data Receive Issue

Hi ,

Regarding Serial Port testing in QNX 7.0, we are able to send data to the receiver using the “echo” command in RS232/
RS422/RS485 modes. But when we try to receive the data in QNX using “cat”, it doesn’t receive any data.

We have followed the same procedure with same setup (boards and cables are the same) in Ubuntu OS and confirmed that its
working fine.

Please advise the procedure for testing serial port data reception in QNX.

In QNX ,

Transmitter command : “echo Hello > /dev/ser1” - Its working.

Receiver command: " cat /dev/ser1" - Not working

In Ubuntu,

Transmitter command : “echo Hello > /dev/ttyS0” - Its working.

Receiver command : " cat /dev/ttyS0" -Its working

We have created Serial port write and read application using write () and read () and observed the same behavior. We are able to send using write application. Using read , we are not able to receive. The application waits in read call for the data.

We have confirmed the serial port settings (baud rate,parity,stop bit) using stty utility. It looks weird when write is works but read doesn’t work.

FYI, both applications works in Ubuntu if i changed the serial device name (/dev/ser1 to /dev/ttyS0)

DO you have any idea for receiving data via serial port?

Hi John,

You mention RS232 and RS485 modes. These are quite different (2 wire vs 4 wire).

Which mode do you need to get working and which type of serial cable do you actually have (232 or 485). If you have a 485 cable it would explain why things are only working in 1 direction.

Can you post what stty says about the serial port you are trying to use.

Tim

Hi Tim,

We have used separate cables for RS232, RS422, and RS485 modes. These cables are working fine in Ubuntu OS for serial port communication in both directions.

We want to work in all the 3 modes (RS232/RS422/RS485) in both directions. Currently, we are able to send data in all the 3 modes but not able to receive in 3 modes using cat and separate serial read application.

Please find the attached image for stty settings .

Our read application code

#include <stdio.h>
#include <stdlib.h>

#include <sys/types.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>

#define BUFFER_SIZE 100

int main(int argc, char *argv[])
{
	int writefd,readfd;
	unsigned char recv_buf[BUFFER_SIZE];
	char *data="hai";

	size_t recv_length, send_length;

	printf("************************\n");
	printf("* Serial interface app *\n");

	printf("************************\n\n");

	memset(recv_buf, 0x00, BUFFER_SIZE);

	printf("\nSend back data to serial port: \n");
	
	// Open serial port
	readfd = open("/dev/ser1", O_RDWR);
	
	if (readfd < 0)
	{
		printf("Unable to open serial port. \n");
	
		return EXIT_FAILURE;
	}

	// Read data from serial port
	recv_length = read(readfd, recv_buf, BUFFER_SIZE);

	recv_buf[99]='\0';

	if (recv_length > 0)
		printf("\nReceived data: %s \n", recv_buf);
		
	else
	{
		printf("read from serial port FAILED ! \n");
		return EXIT_FAILURE;
	}
	
	return EXIT_SUCCESS;
}

Hi John,

I’ve only got experience with 232 mode in QNX but I’ve never had any problems sending/receiving in 232 mode. That’s why I asked whether you had tried a 232 cable. I’d also suggest getting 232 mode working first since that’s the easier one to work with.

Your stty looks quite similar to mine other than some minor differences like the imaxbel and onlcr options which should not be a problem. The cat command normally works just fine to show incoming data for me when I’m testing and your sample program looks fine too.

Is there a chance the actual physical serial port on your machine is bad (or the UART on the machine isn’t an 8250)? In other words do you have another serial port on that machine to try or another machine you can install QNX7 on to test or can you swap out the harddrive/CF card containing QNX for a Linux one.

Tim

Hi Tim,

Thanks for your reply.

In order to confirm the hardware, we have checked the same setup (hardware/cables) with Ubuntu OS and confirmed that we are able to receive and transmit properly in all 3 modes (RS232/RS422/RS485).

I have found another guy faced the same issue. Cat also not works for them. Please refer the below link,

openqnx.com/phpbbforum/viewtopi … 10&t=12915

Apart from serial port, we have below issues

  1. Not able to record audio using “waverec” command and using “wave” command able to play audio file.

But in 8 -bit mode, High noise is recording. - The same setup works fine in Ubuntu

  1. Password changing - Not able to change the user account password using “passwd” utiltiy. Getting error as "Sorry authentication token busy " . In VM ware, we are able to change the password.

Does the issue related to any read file system issue?

It would be helpful if you provide ideas about audio recording and password changing and serial port data receive.

Thanks,
John

Hi John,

  1. With regards to not being able to change the password:
    This sounds like your QNX filesystem is mounted as ‘read only’.
  • Are you able to write/delete/edit anything on your QNX filesystem?
  • If you are able to do so, what do the file permissions in /etc and /etc/pam.d look like
  • Can you post your QNX build file (the one you used to build the QNX .boot image). I just want to make sure you didn’t put the password stuff in the boot image itself (which is read only).
  1. With regards to waverec:
    I’ve never used waverec or wave so I’m probably not going to be much help here.
  • However, where did you get your QNX waverec binary from. Did you compile it yourself from the QNX source code (which I found by googling) or did you get the binary image from QNX.
  • Are you running the QNX O/S in 32 or 64 bit mode? I ask this and the prior question because maybe waverec is compiled for the wrong mode or you grabbed the 32 bit exe instead of the 64 bit exe and that is why it only partially is working (8 bit mode).
  1. With regards to serial receiving:
    I saw that other link. It’s from 2012 and from a prior version of QNX (6.X). You can try turning off the OHFLOW and IHFLOW from stty or your sample code but it seems very unlikely you have the kind of cable that would require that. All the off the shelf RS 232 cables I’ve ever used just ‘worked’.

Of course once again if you are running the wrong version of devc-ser8250 (32 bit vs 64 bit) it might be the issue. You mentioned running QNX in a VMWare image. Does your serial program/cat command work in the VMWare image (assuming the host machine has a serial port)

Tim

P.S. If you’ve started the QNX system logger (slogger or slogger2) you might use sloginfo or slog2info to check the contents of the logger. Perhaps waverec or passwd or devc-ser8250 logged something. Or you can stop and restart them with higher logging on and see if anything useful shows up.

Regarding the serial port receiving of character issue…

Maybe try starting up qtalk (the QNX terminal program) with a loopback plug connected to the serial port. With the terminal simply press keys and they should be turned around by the loopback plug and be received, and then displayed, on the terminal screen. You can start qtalk as follows:

qtalk -m /dev/ser1

Note that qtalk started with no arguments will default to /dev/ser1 anyway.

The use of echo and cat would not be my initial approach to resolving serial port issues.

The “mode” (RS232/422/485) has relevance only in the wiring configuration. RS232 is more commonly used and is generally the default for the native 8250 or 68x50 UART types fitted to Intel x86 systems. It is the easiest to work with but not always suitable. But for serial port problem diagnosis it is the simplest.

As has been stated before, start devc-ser8250 with a -F to disable hardware flow control. Alternatively, once the driver has been started, disable hardware flow control (stty -ihflow -ohflow < /dev/ser1). If qtalk still doesn’t show a character echo I would then suspect either a wiring issue or hardware problem. Given your wiring harness appears to work with Linux I would be starting to look at the QNX driver and serial port configuration. I am not aware of any problems with the QNX7 devc-ser8250 driver itself. It works for me!

The beauty of the loopback test is that you know that the transmit clock is the same as the receive clock. Furthermore, you know that the transmit and receive parameters (baudrate, data/start/stop bits, and parity) are identical. If that works, then the next step is to connect to a different machine. I have seen receive failures resulting from one machine being set to 1.5 stop bits and the other set to 1 or 2 stop bits. That sort of thing.

I can think of a couple of other reasons why a serial port won’t work but this is simply for starters.

I have been dealing with these sorts of things with QNX for 30+ years and been writing QNX serial port drivers (NOT devc-ser8250!) for 24 years - including one for QNX7. The QNX7 driver is basically identical to the QNX6 driver in terms of functionality. I have both 32-bit and 64-bit QNX7 boxes and devc-ser8250 and qtalk work fine with both. (Just don’t try transferring files between 32 and 64 bit systems using qcp)! :slight_smile:

Dealing with serial ports these days can in some ways be considered to be something of a “black art”. After a while it becomes second nature…

Geoff.

Hi Tim,

Please find our inline comments as below,

1. Serial Port :

With regards to not being able to change the password:
This sounds like your QNX filesystem is mounted as ‘read only’.

  • Are you able to write/delete/edit anything on your QNX filesystem?

[John] We have created two partitions based on filesystem type 178 and 179 and mounted 179 partitions under the home directory.

We are not able to edit/write anything in any folders or files (etc, dev, bin,) except the home directory. Since we have mounted home directory as read /write, we are able to create directories, files under the home folder.

Please advise your inputs to mount qnx filesystem as read/writable.

If you are able to do so, what do the file permissions in /etc and /etc/pam.d look like

[John] We gave full permission for /etc folder and pam.d files and tried to change the password. But still we have observed the same issue.

Can you post your QNX build file (the one you used to build the QNX .boot image). I just want to make sure you didn’t put the password stuff in the boot image itself (which is read only).

[John] We have attached our build file for reference. Kindly take a look into build file.

2. Audio :

However, where did you get your QNX waverec binary from. Did you compile it yourself from the QNX source code (which I found by googling) or did you get the binary image from QNX.

[John] waverec and wave commands are inbuilt qnx binaries. In our build file, we just added both commands .

Are you running the QNX O/S in 32 or 64 bit mode? I ask this and the prior question because maybe waverec is compiled for the wrong mode or you grabbed the 32 bit exe instead of the 64 bit exe and that is why it only partially is working (8 bit mode).

[John] We are using 32-bit BSP and we are able to execute command successfully. But the issue is it doesn’t record.

Wave works fine.

3. Serial Port :

Our Vmware setup doesn’t have serial ports. We will check the same image in another board and provide our observations.

Thanks,
John.

Hi John,

I didn’t see your build file???

It’s definitely a good idea to try on a second board just to eliminate the potential problem of the physical hardware being bad.

As far as mounting goes, I’d need to see the mount commands (presumably in your build file). Normally unless you specify the -r option (read only) everything should be read/write (assuming you are logging in as a root user).

Tim

P.S. Another user replied but I am having trouble approving his post. So I’m cutting and pasting his response below:

Regarding the serial port receiving of character issue…

Maybe try starting up qtalk (the QNX terminal program) with a loopback plug connected to the serial port. With the terminal simply press keys and they should be turned around by the loopback plug and be received, and then displayed, on the terminal screen. You can start qtalk as follows:

qtalk -m /dev/ser1

Note that qtalk started with no arguments will default to /dev/ser1 anyway.

The use of echo and cat would not be my initial approach to resolving serial port issues.

The “mode” (RS232/422/485) has relevance only in the wiring configuration. RS232 is more commonly used and is generally the default for the native 8250 or 68x50 UART types fitted to Intel x86 systems. It is the easiest to work with but not always suitable. But for serial port problem diagnosis it is the simplest.

As has been stated before, start devc-ser8250 with a -F to disable hardware flow control. Alternatively, once the driver has been started, disable hardware flow control (stty -ihflow -ohflow < /dev/ser1). If qtalk still doesn’t show a character echo I would then suspect either a wiring issue or hardware problem. Given your wiring harness appears to work with Linux I would be starting to look at the QNX driver and serial port configuration. I am not aware of any problems with the QNX7 devc-ser8250 driver itself. It works for me!

The beauty of the loopback test is that you know that the transmit clock is the same as the receive clock. Furthermore, you know that the transmit and receive parameters (baudrate, data/start/stop bits, and parity) are identical. If that works, then the next step is to connect to a different machine. I have seen receive failures resulting from one machine being set to 1.5 stop bits and the other set to 1 or 2 stop bits. That sort of thing.

I can think of a couple of other reasons why a serial port won’t work but this is simply for starters.

I have been dealing with these sorts of things with QNX for 30+ years and been writing QNX serial port drivers (NOT devc-ser8250!) for 24 years - including one for QNX7. The QNX7 driver is basically identical to the QNX6 driver in terms of functionality. I have both 32-bit and 64-bit QNX7 boxes and devc-ser8250 and qtalk work fine with both. (Just don’t try transferring files between 32 and 64 bit systems using qcp)! :slight_smile:

Dealing with serial ports these days can in some ways be considered to be something of a “black art”. After a while it becomes second nature…

Geoff.

Hi Tim,

We have added below commands build file mounting file systems, (Partition 1: 178 and partition 2: 179)

mount -t qnx6 -o sync=none /dev/hd0t178 /fs/qnx6 - Boot partition

mount -t qnx6 -o sync=none /dev/hd0t179 /home

Please find attached image of the file system details (“df -hP”)

I didn’t see your build file???

[code][image=0x1400000]
#---------------------------------------------------------------------------------------------------

x86 32bits build for generic x86 platform

#---------------------------------------------------------------------------------------------------
[virtual=x86,multiboot +compress] boot = {
startup-x86 -v
PATH=/sbin:/usr/sbin:/bin:/usr/bin:/proc/boot:/x86/sbin:/x86/usr/sbin:/x86/bin:/x86/usr/bin LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/lib/dll/pci:/x86/lib:/x86/usr/lib:/x86/lib/dll procnto-smp-instr -v
}

[+script] startup-script = {
procmgr_symlink …/…/proc/boot/libc.so /usr/lib/ldqnx.so.2

display_msg Welcome to Aries x86 system

#-------------------------------------------------------------------------------------------

Starting slogger2 server

#---------------------------------------------------------------------------------------------------
display_msg “Starting slogger2 server …”
slogger2 -s2048k &
waitfor /dev/slog2

#---------------------------------------------------------------------------------------------------

Settings env for PCI server and starting PCI server

#---------------------------------------------------------------------------------------------------
PCI_HW_MODULE=/lib/dll/pci/pci_hw-Intel_x86.so ## uncomment this line for Intel platform, comment out for other platform

PCI_HW_MODULE=/lib/dll/pci/pci_hw-AMD_x86.so ## uncomment this line for AMD platform, comment out for other platform

PCI_SLOG_MODULE=/lib/dll/pci/pci_slog2.so
PCI_DEBUG_MODULE=/lib/dll/pci/pci_debug2.so
PCI_BASE_VERBOSITY=3

PCI_HW_CONFIG_FILE=/etc/system/config/pci/pci_hw-VMware.cfg ## uncomment this line for VMWare image, comment out for other platform

#---------------------------------------------------------------------------------------------------
display_msg “Starting PCI server …”
pci-server --aspace-enable

Note: Specify the highest bus to be scanned during enumeration as below. See also pci-server ‘use’ information

pci-server --bus-scan-limit=16 --aspace-enable

waitfor /dev/pci

#---------------------------------------------------------------------------------------------------

Get the disk up and running

#---------------------------------------------------------------------------------------------------

sh /proc/boot/blk-start.sh

display_msg "Mounting Filesystems"

mount -t qnx6 -o sync=none /dev/hd0t178 /fs/qnx6

mount -t qnx6 -o sync=none /dev/hd0t179 /home

#---------------------------------------------------------------------------------------------------

Note:

If there is a /x86 filesystem in hard disk, Please uncomment the line below,

further commands can now be run from the filesystem in hard disk.

#---------------------------------------------------------------------------------------------------

waitfor /x86

#---------------------------------------------------------------------------------------------------

Starting common services

#---------------------------------------------------------------------------------------------------
display_msg “Starting some common services …”
dumper
pipe
random -t
mqueue
devc-pty

#---------------------------------------------------------------------------------------------------

Starting network driver and services

#---------------------------------------------------------------------------------------------------
sh /proc/boot/net-start.sh

#---------------------------------------------------------------------------------------------------

Starting USB host driver and services

#---------------------------------------------------------------------------------------------------
display_msg “Starting USB host …”
io-usb-otg -d xhci -d ehci -d ohci -d uhci
waitfor /dev/usb/io-usb-otg

display_msg "Starting devb-umass ..."
devb-umass cam pnp &

#---------------------------------------------------------------------------------------------------

Starting audio driver

#---------------------------------------------------------------------------------------------------
sh /proc/boot/aud-start.sh

#---------------------------------------------------------------------------------------------------

Starting Input services

#---------------------------------------------------------------------------------------------------
display_msg “Starting input services …”
io-hid -d usb
waitfor /dev/io-hid/io-hid

#---------------------------------------------------------------------------------------------------

Starting serial driver

#---------------------------------------------------------------------------------------------------
display_msg “Starting serial driver …”
devc-ser8250 -b 115200 3f8,4 2f8,3 3e8,9 2e8,10 &
waitfor /dev/ser1

Note: If need a serial debug port, please uncomment the line below

Please change the device name to the actull debug port name

TERM=qansi on -t /dev/ser1 -l root

Note: If need a USB-serial debug port, please uncomment the line below

Please make sure the USB driver has been lauched first and you have the USB-serial device connected

display_msg “Starting serial USB driver …”

devc-serusb -e -b115200

waitfor /dev/serusb1

TERM=qansi on -t /dev/serusb1 -l root

#---------------------------------------------------------------------------------------------------

Starting consoles and shells

#---------------------------------------------------------------------------------------------------
display_msg “Starting consoles …”
devc-con-hid -n8
waitfor /dev/con1
waitfor /dev/con2
waitfor /dev/con3
waitfor /dev/con4

#---------------------------------------------------------------------------------------------------
display_msg “Starting shells …”
SYSNAME=nto
TERM=qansi

reopen /dev/con2
[+session] sh &

reopen /dev/con3
[+session] sh &

reopen /dev/con4
[+session] sh &

reopen /dev/con1
[+session] sh

}

[type=link] /bin/sh=/proc/boot/ksh
[type=link] /tmp=/dev/shmem
[type=link] /var/run=/dev/shmem
[type=link] /var/db=/dev/shmem

#---------------------------------------------------------------------------------------------------

shared library

#---------------------------------------------------------------------------------------------------
libc.so
libncursesw.so
libpanelw.so
libdevice-publisher.so

#---------------------------------------------------------------------------------------------------

libraries for new PCI driver

#---------------------------------------------------------------------------------------------------
libpci.so
[-followlink search=${QNX_TARGET}/${PROCESSOR}] /lib/dll/pci/=lib/dll/pci

#---------------------------------------------------------------------------------------------------

libraries for block drivers

#---------------------------------------------------------------------------------------------------
io-blk.so
libcam.so
fs-qnx6.so
fs-dos.so
cam-disk.so
cam-cdrom.so

#---------------------------------------------------------------------------------------------------

Note:

If there is a filesystem (/x86) that include the libariries list below

(before the line [data=copy]), you could comment them out to reduces the size of IFS images.

#---------------------------------------------------------------------------------------------------

#---------------------------------------------------------------------------------------------------

more shared libraries

#---------------------------------------------------------------------------------------------------
libm.so
libz.so
libslog2.so
libslog2parse.so
libtracelog.so
libpps.so
libbacktrace.so

#---------------------------------------------------------------------------------------------------

libraries for USB drivers

#---------------------------------------------------------------------------------------------------
libusbdi.so
libhiddi.so
devu-hcd-ehci.so
devu-hcd-ohci.so
devu-hcd-uhci.so
devu-hcd-xhci.so

#---------------------------------------------------------------------------------------------------

libraries for Audio drivers

#---------------------------------------------------------------------------------------------------
deva-ctrl-intel_hda.so
deva-mixer-hda.so
deva-ctrl-audiopci.so
deva-mixer-ac97.so
libasound.so

#---------------------------------------------------------------------------------------------------

libraries for io-hid drivers

#---------------------------------------------------------------------------------------------------
devh-usb.so
devh-ps2ser.so

#---------------------------------------------------------------------------------------------------

libraries for network drivers

#---------------------------------------------------------------------------------------------------
libsocket.so
devnp-e1000.so
devnp-rtl8169.so
libcrypto.so
librpc.so

#-------------------

libraries for drm

#---------------
libdrm.so
libdrm_intel.so

[data=copy]

#---------------------------------------------------------------------------------------------------

script for launching the network driver

#---------------------------------------------------------------------------------------------------
net-start.sh={
#!/bin/sh

PCI_DEVICE_LIST=/dev/shmem/pci_device.list
STD_NULL=/dev/null

supported list for the network devices

INTEL_8086_100f=8086/100f
INTEL_8086_1559=8086/1559
INTEL_8086_1570=8086/1570
INTEL_8086_15a3=8086/15a3
INTEL_8086_15a2=8086/15a2
INTEL_8086_1502=8086/1502
INTEL_8086_1503=8086/1503
INTEL_8086_1f41=8086/1f41
INTEL_8086_1533=8086/1533 #Aries
RTL_RTL8169=10ec/8168

uncomment the line below if any driver use the old PCI API’s

export PCI_BKWD_COMPAT_MODULE=/lib/dll/pci/pci_bkwd_compat.so

#check if there is the pci device list
if [ ! -r $PCI_DEVICE_LIST ]; then
echo “Get PCI device list …”
pci-tool -v > $PCI_DEVICE_LIST
fi

#check if there is the Intel E1000 Ethernet device in the list
if grep $INTEL_8086_100f $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_8086_1559 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_8086_1570 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_8086_15a3 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_8086_15a2 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_8086_1502 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_8086_1503 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_8086_1533 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_8086_1f41 $PCI_DEVICE_LIST > $STD_NULL
then
echo “Starting E1000 Ethernet driver …”
io-pkt-v6-hc -de1000 pci=0
if_up -r 10 -p wm0
ifconfig wm0 up
io-pkt-v6-hc -i1 -de1000 pci=1 -ptcpip prefix=/alt
SOCK=/alt if_up -r 10 -p wm0
SOCK=/alt ifconfig wm0 up

#check if there is the Realtek RTL8169 Ethernet device in the list
elif grep $RTL_RTL8169 $PCI_DEVICE_LIST > $STD_NULL
then
echo “Starting RTL8169 Ethernet driver …”
io-pkt-v6-hc -d rtl8169
if_up -r 10 -p rt0
ifconfig rt0 up

else
echo “No Ethernet device has been detected”
exit 0;

fi

echo "Starting network service ..."
dhclient -nw wm0
SOCK=/alt dhclient -nw wm0
qconn
inetd

}

#---------------------------------------------------------------------------------------------------

script for launching the audio driver

#---------------------------------------------------------------------------------------------------
aud-start.sh={
#!/bin/sh

PCI_DEVICE_LIST=/dev/shmem/pci_device.list
AUD_DEVICE=/dev/snd
STD_NULL=/dev/null

supported list for the intel_hda audio devices

INTEL_HDA_ICH6=8086/2668
INTEL_HDA_ICH7=8086/27d8
INTEL_HDA_ICH8=8086/284b
INTEL_HDA_ICH9=8086/293e
INTEL_HDA_ICH10=8086/3a3e
INTEL_HDA_ICH10_82801JD=8086/3a6e
INTEL_HDA_POULSBO=8086/811b
INTEL_HDA_CPT=8086/1c20
INTEL_HDA_H77=8086/1e20
INTEL_HDA_HASWELL=8086/8c20
INTEL_HDA_3400=8086/3b56
INTEL_HDA_VALLYVIEW=8086/0f04
INTEL_HDA_LYNXPLPHD=8086/9c20
INTEL_HDA_WCPLPHD=8086/9ca0
INTEL_HDA_CHERRYHILL=8086/2284
INTEL_HDA_SUNRISEPLHD=8086/9d70
ATI_HDA_SB600=1002/4383
AMD_HDA_FCH=1022/780d

supported list for the audiopci audio devices

ENSONIQ_1370=1274/5000
ENSONIQ_1371=1274/1371
ENSONIQ_5880=1274/5880
CREATIVE_EV1938=1102/8938

uncomment the line below if any driver use the old PCI API’s

export PCI_BKWD_COMPAT_MODULE=/lib/dll/pci/pci_bkwd_compat.so

#check if there is the pci device list
if [ ! -r $PCI_DEVICE_LIST ]; then
echo “Get PCI device list …”
pci-tool -v > $PCI_DEVICE_LIST
fi

#check if there is Intel HD Audio device in the list
if grep $INTEL_HDA_ICH6 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_ICH7 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_ICH8 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_ICH9 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_ICH10 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_ICH10_82801JD $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_POULSBO $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_CPT $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_H77 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_HASWELL $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_3400 $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_VALLYVIEW $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_LYNXPLPHD $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_WCPLPHD $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_CHERRYHILL $PCI_DEVICE_LIST > $STD_NULL ||
grep $INTEL_HDA_SUNRISEPLHD $PCI_DEVICE_LIST > $STD_NULL ||
grep $AMD_HDA_FCH $PCI_DEVICE_LIST > $STD_NULL ||
grep $ATI_HDA_SB600 $PCI_DEVICE_LIST > $STD_NULL
then
echo “Starting audio driver …”
io-audio -d intel_hda &

#check if there is audiopci device in the list
elif grep $ENSONIQ_1370 $PCI_DEVICE_LIST > $STD_NULL ||
grep $ENSONIQ_1371 $PCI_DEVICE_LIST > $STD_NULL ||
grep $ENSONIQ_5880 $PCI_DEVICE_LIST > $STD_NULL ||
grep $CREATIVE_EV1938 $PCI_DEVICE_LIST > $STD_NULL
then
echo “Starting audio driver …”
io-audio -d audiopci &

else
echo “No audio device has been detected”
exit 0;

fi

waitfor $AUD_DEVICE

}

#---------------------------------------------------------------------------------------------------

script for launching the block driver

#---------------------------------------------------------------------------------------------------
blk-start.sh={
#!/bin/sh

PCI_DEVICE_LIST=/dev/shmem/pci_device.list

please change the device name below to the actull name of block device

BLK_DEVICE=/dev/hd0
STD_NULL=/dev/null

supported list for the block devices

SATA_8086_0f23=8086/0f23
SATA_8086_9c03=8086/9c03
SATA_8086_9c83=8086/9c83
SATA_8086_9d03=8086/9d03
SATA_8086_1c02=8086/1c02
SATA_8086_1e03=8086/1e03
SATA_8086_1f22=8086/1f22
SATA_8086_1f32=8086/1f32
SATA_1022_7801=1022/7801
EIDE_8086_7111=8086/7111

uncomment the line below if any driver use the old PCI API’s

export PCI_BKWD_COMPAT_MODULE=/lib/dll/pci/pci_bkwd_compat.so

#check if there is the pci device list
if [ ! -r $PCI_DEVICE_LIST ]; then
echo “Get PCI device list …”
pci-tool -v > $PCI_DEVICE_LIST
fi

#check if there is the SATA device in the list
if grep $SATA_8086_0f23 $PCI_DEVICE_LIST > $STD_NULL ||
grep $SATA_8086_9c03 $PCI_DEVICE_LIST > $STD_NULL ||
grep $SATA_8086_9c83 $PCI_DEVICE_LIST > $STD_NULL ||
grep $SATA_8086_9d03 $PCI_DEVICE_LIST > $STD_NULL ||
grep $SATA_8086_1c02 $PCI_DEVICE_LIST > $STD_NULL ||
grep $SATA_8086_1e03 $PCI_DEVICE_LIST > $STD_NULL ||
grep $SATA_8086_1f22 $PCI_DEVICE_LIST > $STD_NULL ||
grep $SATA_8086_1f32 $PCI_DEVICE_LIST > $STD_NULL ||
grep $SATA_1022_7801 $PCI_DEVICE_LIST > $STD_NULL
then
echo “Starting AHCI block driver …”
#devb-ahci cam quiet ahci nports=4 blk automount=hd0t179:/:qnx6 &
devb-ahci cam quiet

#check if there is the EIDE device in the list
elif grep $EIDE_8086_7111 $PCI_DEVICE_LIST > $STD_NULL
then
echo “Starting EIDE block driver …”
devb-eide cam quiet blk automount=hd0t179:/:qnx6 &

else
echo “No block device has been detected”
exit 0;

fi

waitfor $BLK_DEVICE

}

#---------------------------------------------------------------------------------------------------

.profile for setting environment for PCI, graphic, etc.

#---------------------------------------------------------------------------------------------------
/root/.profile={

set PCI environment

export PCI_HW_MODULE=/lib/dll/pci/pci_hw-Intel_x86.so ## uncomment this line for Intel platform, comment out for other platform
#export PCI_HW_MODULE=/lib/dll/pci/pci_hw-AMD_x86.so ## uncomment this line for AMD platform, comment out for other platform
export PCI_BKWD_COMPAT_MODULE=/lib/dll/pci/pci_bkwd_compat.so ## uncomment this line if any driver use the old PCI API’s
export PCI_SLOG_MODULE=/lib/dll/pci/pci_slog2.so
export PCI_DEBUG_MODULE=/lib/dll/pci/pci_debug2.so
export PCI_BASE_VERBOSITY=3
#export PCI_HW_CONFIG_FILE=/etc/system/config/pci/pci_hw-VMware.cfg ## uncomment this line for VMWare image, comment out for other platform

set GRAPHICS environment

#export GRAPHICS_ROOT=/usr/lib/graphics/vmware ## uncomment this line for VMWare image, comment out for other platform

export LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/lib/dll/pci:/x86/lib:/x86/usr/lib:/x86/lib/dll:$GRAPHICS_ROOT
export PATH=/sbin:/usr/sbin:/bin:/usr/bin:/proc/boot:/x86/sbin:/x86/usr/sbin:/x86/bin:/x86/usr/bin
}

#---------------------------------------------------------------------------------------------------

PCI support

#---------------------------------------------------------------------------------------------------
pci-server

Note: if you wish to use pci-tool interactive mode, add [+raw] to the pci-tool inclusion below

see ‘use’ information in pci-tool

pci-tool
rsrcdb_query
[search=${QNX_TARGET}/etc/system/config/pci] /etc/system/config/pci/pcidatabase.com-tab_delimited.txt=pcidatabase.com-tab_delimited.txt
#[search=${QNX_TARGET}/etc/system/config/pci] /etc/system/config/pci/pci_hw-VMware.cfg=pci_hw-VMware.cfg
#---------------------------------------------------------------------------------------------------

block driver

#---------------------------------------------------------------------------------------------------
devb-ahci
devb-eide

#---------------------------------------------------------------------------------------------------

general commands

#---------------------------------------------------------------------------------------------------
ksh
waitfor
grep
/sbin/ifconfig=ifconfig

#---------------------------------------------------------------------------------------------------

Network services (telnet) support

#---------------------------------------------------------------------------------------------------
devc-pty

/etc/hosts=${QNX_TARGET}/etc/hosts
/etc/services=${QNX_TARGET}/etc/services

/etc/inetd.conf = {
ftp stream tcp nowait root /usr/sbin/ftpd in.ftpd -l
telnet stream tcp nowait root /usr/sbin/telnetd in.telnetd
}

/etc/ftpusers=${QNX_TARGET}/etc/ftpusers

/etc/ftpd.conf = {
/* Make things a+rw by default */
umask all 0000
}

#[uid=0 gid=0 perms=0666] /etc/passwd = {
/etc/passwd = {
root:x:0:0:Superuser:/root:/bin/sh
qnxuser1:x:1000:1000:qnxuser:/home:/bin/sh
}

#[uid=0 gid=0 perms=0600] /etc/shadow = {
/etc/shadow = {
root:@S@vvd+OXAgwbeNLUt9nkOJll0cg/ikKmlUEQfitqQdsYoESduLX66l1EOKSXljfVvSlcAZNxw/KrFRWrkSe1juIw==@OTE5OTkxNGJjZWM5OGEzNTFjYjY4OTMxNGM0NzNhMzg=:1468494669:0:0
qnxuser1:@S@SH3K++tbdsf3SPVrtpsLUncU7FL4IJ0emlHofpEoYqIbKZVKYI8sAswWIcLmgM1uZMTMsL1IAwDAYCBs8SfnoQ==@Nzc5MDI1NmUzNWI1OWE1NGUwY2YyZTM5NWRhZjhmNzM=:1468488235:0:0
}

#[uid=0 gid=0 perms=0644] /etc/group = {
/etc/group = {
root:x:0:root
qnxuser1:x:1000
}

/etc/resolv.conf = {
search localdomain
nameserver 8.8.8.8
}

#---------------------------------------------------------------------------------------------------

PAM configurations addon build file

#---------------------------------------------------------------------------------------------------
[uid=0 gid=0 perms=4755] /bin/login=login
[uid=0 gid=0 perms=4755] /bin/passwd=passwd
[uid=0 gid=0 perms=4755] /bin/su=su
[uid=0 gid=0 perms=0755] /usr/sbin/sshd=sshd
[uid=0 gid=0 perms=0755] /usr/sbin/ftpd=ftpd
[uid=0 gid=0 perms=0755] /usr/sbin/inetd=inetd
[uid=0 gid=0 perms=0755] /usr/sbin/telnetd=telnetd

[uid=0 gid=0 type=dir dperms=0755] /usr
[uid=0 gid=0 type=dir dperms=0755] /usr/lib
[uid=0 gid=0 type=dir dperms=0755] /etc #aries
[uid=0 gid=0 type=dir dperms=0755] /etc/pam.d
[uid=0 gid=0 perms=0755] /etc/pam.d/login=${QNX_TARGET}/etc/pam.d/login
[uid=0 gid=0 perms=0755] /etc/pam.d/on=${QNX_TARGET}/etc/pam.d/on
[uid=0 gid=0 perms=0755] /etc/pam.d/passwd=${QNX_TARGET}/etc/pam.d/passwd
[uid=0 gid=0 perms=0755] /etc/pam.d/su=${QNX_TARGET}/etc/pam.d/su
[uid=0 gid=0 perms=0755] /etc/pam.d/ftpd=${QNX_TARGET}/etc/pam.d/ftpd

[uid=0 gid=0 perms=0755] /usr/lib/pam_ftpusers.so=pam_ftpusers.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_rootok.so=pam_rootok.so
[uid=0 gid=0 perms=0755] /usr/lib/pam_qnx.so=pam_qnx.so
#[uid=0 gid=0 perms=0755] /usr/lib/pam_deny.so=pam_deny.so
#[uid=0 gid=0 perms=0755] /usr/lib/pam_echo.so=pam_echo.so
#[uid=0 gid=0 perms=0755] /usr/lib/pam_exec.so=pam_exec.so
#[uid=0 gid=0 perms=0755] /usr/lib/pam_group.so=pam_group.so
#[uid=0 gid=0 perms=0755] /usr/lib/pam_mac.so=pam_mac.so
#[uid=0 gid=0 perms=0755] /usr/lib/pam_permit.so=pam_permit.so
#[uid=0 gid=0 perms=0755] /usr/lib/pam_radius.so=pam_radius.so
#[uid=0 gid=0 perms=0755] /usr/lib/pam_self.so=pam_self.so

#---------------------------------------------------------------------------------------------------

serial drivers

#---------------------------------------------------------------------------------------------------
devc-con
devc-con-hid
devc-ser8250
devc-serusb

#---------------------------------------------------------------------------------------------------

audio driver and support

#---------------------------------------------------------------------------------------------------
io-audio
wave
waverec
mix_ctl

#---------------------------------------------------------------------------------------------------

network driver and support

#---------------------------------------------------------------------------------------------------
io-pkt-v6-hc
nicinfo
if_up
ftp
ping
ping6
fs-nfs3
qconn
dhclient
netstat
route
tcpdump
[search=${QNX_TARGET}/sbin perms=a+x] /sbin/dhclient-script=dhclient-script
[search=${QNX_TARGET}/etc] /etc/dhclient.conf=dhclient.conf

#---------------------------------------------------------------------------------------------------

USB driver and support

#---------------------------------------------------------------------------------------------------
io-usb-otg
usb
devb-umass
io-hid

#---------------------------------------------------------------------------------------------------

more general commands

#---------------------------------------------------------------------------------------------------
on
cat
cp
mkdir
ls
pipe
mqueue
random
pidin
rm
uname
slogger2
slog2info
slay
mount
umount
shutdown
less
rtc
date
fdisk
use
dumper
env
find
ln
sleep
tty
sync
coreinfo
mkqnx6fs
dd
dloader
pdebug
chmod
vi
mv
df
setfacl
chown
stty
[/code]

It’s definitely a good idea to try on a second board just to eliminate the potential problem of the physical hardware being bad.

We have checked in another hardware and observed the similar issue(able to send data but not able to receive) in 232 mode.

Could you please tell us how to use qtalk ?

Thanks,
John

Hi John,

Thanks for posting the build file. I now know why you can’t change your password or edit those files. They are contained in the boot image which is read-only in memory (you can see whats in read-only memory by looking at what’s in /proc/boot). You typically need that for initial install on the harddrive and then you remove it if you want to be able to change passwords and add new users etc. We can come back to that later if you really need that feature (not everyone needs or wants it). It’s not related to your serial problem at all.

This is the area that’s starting the serial driver:

#---------------------------------------------------------------------------------------------------
# Starting serial driver
#---------------------------------------------------------------------------------------------------
   display_msg "Starting serial driver ..."
   devc-ser8250 -b 115200 3f8,4 2f8,3 3e8,9 2e8,10 &
   waitfor /dev/ser1

Here you are specifying 4 serial ports and the interrupts for each (4,3,9,10). Do you really have 4 serial ports and require those exact interrupts?

I start my serial driver as:
devc-ser8250 -b 115200
and let the driver interrogate the BIOS for the serial ports and then let it assign the interrupts on it’s own.

I’m wondering if something else that is being started is also using interrupt 4 (ser1). That would explain why you can’t receive anything and it doesn’t work any better on your 2nd board.

Can you try just starting your serial driver using same startup that I do. See if that makes things work for you. If not then gradually you’ll have to kill off all the processes in the system until you figure out what’s also using the same interrupt and not nicely sharing (maybe it’s the sound card).

We won’t worry about qtalk for now since I want to fix the serial driver startup and possible interrupt conflict first.

Tim

Hi Tim,

I now know why you can’t change your password or edit those files. They are contained in the boot image which is read-only in memory (you can see whats in read-only memory by looking at what’s in /proc/boot).

[John] yes, we have password details in build file itself. We have checked the /proc/boot and attached the log files as below. Please refer the same.

You typically need that for initial install on the harddrive and then you remove it if you want to be able to change passwords and add new users etc. We can come back to that later if you really need that feature (not everyone needs or wants it).

[John] Yes, we tried to remove password file from /etc folder after booting in hdd. As we said, we can’t able to edit/remove /etc files. We want to give provision to users for changing the existing user account password and able to create new user account.

In our case, we can’t able to do both new user account creation and password changing. Can you please advise how to do it ?

As of now, we are giving password and user account creation in the buid file itself.

total 37035 -rw-rw-r-- 1 root root 2798 Oct 18 2019 aud-start.sh -rw-rw-r-- 1 root root 1704 Oct 18 2019 blk-start.sh -rwxr-xr-x 1 root root 30087 Sep 11 2019 cam-cdrom.so -rwxr-xr-x 1 root root 22337 Sep 11 2019 cam-disk.so -rwxr-xr-x 1 root root 13084 Sep 11 2019 cat -rwxr-xr-x 1 root root 17619 Sep 11 2019 chmod -rwxr-xr-x 1 root root 14375 Sep 11 2019 chown -rwxr-xr-x 1 root root 29984 Sep 11 2019 coreinfo -rwxr-xr-x 1 root root 48660 Sep 11 2019 cp -rwxr-xr-x 1 root root 22989 Sep 11 2019 date -rwxr-xr-x 1 root root 24375 Sep 11 2019 dd -rwxr-xr-x 1 root root 21343 Sep 11 2019 deva-ctrl-audiopci.so -rwxr-xr-x 1 root root 25270 Sep 11 2019 deva-ctrl-intel_hda.so -rwxr-xr-x 1 root root 39983 Sep 11 2019 deva-mixer-ac97.so -rwxr-xr-x 1 root root 124256 Sep 11 2019 deva-mixer-hda.so -rwxr-xr-x 1 root root 86318 Sep 11 2019 devb-ahci -rwxr-xr-x 1 root root 156084 Sep 11 2019 devb-eide -rwxr-xr-x 1 root root 61496 Sep 11 2019 devb-umass -rwxr-xr-x 1 root root 106594 Sep 11 2019 devc-con -rwxr-xr-x 1 root root 139384 Sep 11 2019 devc-con-hid -rwxr-xr-x 1 root root 79134 Sep 11 2019 devc-pty -rwxr-xr-x 1 root root 84076 Sep 11 2019 devc-ser8250 -rwxr-xr-x 1 root root 172610 Sep 11 2019 devc-serusb -rwxr-xr-x 1 root root 76260 Sep 11 2019 devh-ps2ser.so -rwxr-xr-x 1 root root 30579 Sep 11 2019 devh-usb.so -rwxr-xr-x 1 root root 421274 Sep 11 2019 devnp-e1000.so -rwxr-xr-x 1 root root 468932 Sep 11 2019 devnp-rtl8169.so -rwxr-xr-x 1 root root 64046 Sep 11 2019 devu-hcd-ehci.so -rwxr-xr-x 1 root root 47103 Sep 11 2019 devu-hcd-ohci.so -rwxr-xr-x 1 root root 42801 Sep 11 2019 devu-hcd-uhci.so -rwxr-xr-x 1 root root 96564 Sep 11 2019 devu-hcd-xhci.so -rwxr-xr-x 1 root root 21301 Sep 11 2019 df -rwxr-xr-x 1 root root 713899 Sep 11 2019 dhclient -rwxr-xr-x 1 root root 13893 Sep 11 2019 dloader -rwxr-xr-x 1 root root 142070 Sep 11 2019 dumper -rwxr-xr-x 1 root root 8886 Sep 11 2019 env -rwxr-xr-x 1 root root 66407 Sep 11 2019 fdisk -rwxr-xr-x 1 root root 103732 Sep 11 2019 find -rwxr-xr-x 1 root root 121050 Sep 11 2019 fs-dos.so -rwxr-xr-x 1 root root 122179 Sep 11 2019 fs-nfs3 -rwxr-xr-x 1 root root 305707 Sep 11 2019 fs-qnx6.so -rwxr-xr-x 1 root root 417422 Sep 11 2019 ftp -rwxr-xr-x 1 root root 56377 Sep 11 2019 grep -rwxr-xr-x 1 root root 13716 Sep 11 2019 if_up -rwxr-xr-x 1 root root 491660 Sep 11 2019 io-audio -rwxr-xr-x 1 root root 390132 Sep 11 2019 io-blk.so -rwxr-xr-x 1 root root 42167 Sep 11 2019 io-hid -rwxr-xr-x 1 root root 1802521 Sep 11 2019 io-pkt-v6-hc -rwxr-xr-x 1 root root 500962 Sep 11 2019 io-usb-otg -rwxr-xr-x 1 root root 306501 Sep 11 2019 ksh -rwxr-xr-x 1 root root 224021 Sep 11 2019 less lrwxrwxrwx 1 root root 14 Sep 11 2019 libasound.so -> libasound.so.2 -rwxr-xr-x 1 root root 331004 Sep 11 2019 libasound.so.2 lrwxrwxrwx 1 root root 17 Sep 11 2019 libbacktrace.so -> libbacktrace.so.1 -rwxr-xr-x 1 root root 25042 Sep 11 2019 libbacktrace.so.1 lrwxrwxrwx 1 root root 9 Sep 11 2019 libc.so -> libc.so.4 -rwxr-xr-x 1 root root 783254 Sep 11 2019 libc.so.4 lrwxrwxrwx 1 root root 11 Sep 11 2019 libcam.so -> libcam.so.2 -rwxr-xr-x 1 root root 111610 Sep 11 2019 libcam.so.2 lrwxrwxrwx 1 root root 14 Sep 11 2019 libcrypto.so -> libcrypto.so.2 -rwxr-xr-x 1 root root 2238924 Sep 11 2019 libcrypto.so.2 lrwxrwxrwx 1 root root 24 Sep 11 2019 libdevice-publisher.so -> libdevice-publisher.so.1 -rwxr-xr-x 1 root root 12753 Sep 11 2019 libdevice-publisher.so.1 lrwxrwxrwx 1 root root 11 Sep 11 2019 libdrm.so -> libdrm.so.1 -rwxr-xr-x 1 root root 66100 Sep 11 2019 libdrm.so.1 lrwxrwxrwx 1 root root 17 Sep 11 2019 libdrm_intel.so -> libdrm_intel.so.1 -rwxr-xr-x 1 root root 149372 Sep 11 2019 libdrm_intel.so.1 lrwxrwxrwx 1 root root 13 Sep 11 2019 libhiddi.so -> libhiddi.so.1 -rwxr-xr-x 1 root root 37307 Sep 11 2019 libhiddi.so.1 lrwxrwxrwx 1 root root 9 Sep 11 2019 libm.so -> libm.so.3 -rwxr-xr-x 1 root root 218274 Sep 11 2019 libm.so.3 lrwxrwxrwx 1 root root 16 Sep 11 2019 libncursesw.so -> libncursesw.so.1 -rwxr-xr-x 1 root root 386250 Sep 11 2019 libncursesw.so.1 lrwxrwxrwx 1 root root 14 Sep 11 2019 libpanelw.so -> libpanelw.so.1 -rwxr-xr-x 1 root root 16826 Sep 11 2019 libpanelw.so.1 lrwxrwxrwx 1 root root 13 Sep 11 2019 libpci.so -> libpci.so.2.0 -rwxr-xr-x 1 root root 94028 Sep 11 2019 libpci.so.2.0 lrwxrwxrwx 1 root root 11 Sep 11 2019 libpps.so -> libpps.so.1 -rwxr-xr-x 1 root root 33193 Sep 11 2019 libpps.so.1 lrwxrwxrwx 1 root root 11 Sep 11 2019 librpc.so -> librpc.so.2 -rwxr-xr-x 1 root root 139836 Sep 11 2019 librpc.so.2 lrwxrwxrwx 1 root root 13 Sep 11 2019 libslog2.so -> libslog2.so.1 -rwxr-xr-x 1 root root 37349 Sep 11 2019 libslog2.so.1 lrwxrwxrwx 1 root root 18 Sep 11 2019 libslog2parse.so -> libslog2parse.so.1 -rwxr-xr-x 1 root root 41422 Sep 11 2019 libslog2parse.so.1 lrwxrwxrwx 1 root root 14 Sep 11 2019 libsocket.so -> libsocket.so.3 -rwxr-xr-x 1 root root 260680 Sep 11 2019 libsocket.so.3 lrwxrwxrwx 1 root root 16 Sep 11 2019 libtracelog.so -> libtracelog.so.1 -rwxr-xr-x 1 root root 29144 Sep 11 2019 libtracelog.so.1 lrwxrwxrwx 1 root root 13 Sep 11 2019 libusbdi.so -> libusbdi.so.2 -rwxr-xr-x 1 root root 74822 Sep 11 2019 libusbdi.so.2 lrwxrwxrwx 1 root root 9 Sep 11 2019 libz.so -> libz.so.2 -rwxr-xr-x 1 root root 107005 Sep 11 2019 libz.so.2 -rwxr-xr-x 1 root root 17700 Sep 11 2019 ln -rwxr-xr-x 1 root root 26344 Sep 11 2019 ls -rwxr-xr-x 1 root root 21715 Sep 11 2019 mix_ctl -rwxr-xr-x 1 root root 13346 Sep 11 2019 mkdir -rwxr-xr-x 1 root root 87752 Sep 11 2019 mkqnx6fs -rwxr-xr-x 1 root root 22724 Sep 11 2019 mount -rwxr-xr-x 1 root root 25216 Sep 11 2019 mqueue -rwxr-xr-x 1 root root 13159 Sep 11 2019 mv -rw-rw-r-- 1 root root 1830 Oct 18 2019 net-start.sh -rwxr-xr-x 1 root root 160178 Sep 11 2019 netstat -rwxr-xr-x 1 root root 21438 Sep 11 2019 nicinfo -rwxr-xr-x 1 root root 37915 Sep 11 2019 on -rwxr-xr-x 1 root root 145322 Sep 11 2019 pci-server -rwxr-xr-x 1 root root 855819 Sep 11 2019 pci-tool -rwxr-xr-x 1 root root 71701 Sep 11 2019 pdebug -rwxr-xr-x 1 root root 115238 Sep 11 2019 pidin -rwxr-xr-x 1 root root 72555 Sep 11 2019 ping6 -rwxr-xr-x 1 root root 29646 Sep 11 2019 pipe -rwxrwxr-x 1 root root 937984 Sep 11 2019 procnto-smp-instr -rwxr-xr-x 1 root root 169611 Sep 11 2019 qconn -rwxr-xr-x 1 root root 256358 Sep 11 2019 random -rwxr-xr-x 1 root root 13898 Sep 11 2019 rm -rwxr-xr-x 1 root root 42619 Sep 11 2019 route -rwxr-xr-x 1 root root 14130 Sep 11 2019 rsrcdb_query -rwxr-xr-x 1 root root 59608 Sep 11 2019 rtc -rwxr-xr-x 1 root root 22419 Sep 11 2019 setfacl -rwxr-xr-x 1 root root 25636 Sep 11 2019 shutdown -rwxr-xr-x 1 root root 23717 Sep 11 2019 slay -rwxr-xr-x 1 root root 12967 Sep 11 2019 sleep -rwxr-xr-x 1 root root 32210 Sep 11 2019 slog2info -rwxr-xr-x 1 root root 83473 Sep 11 2019 slogger2 -rw-rw-r-- 1 root root 4636 Oct 18 2019 startup-script -rwxr-xr-x 1 root root 25990 Sep 11 2019 stty -rwxr-xr-x 1 root root 8746 Sep 11 2019 sync -rwxr-xr-x 1 root root 890855 Sep 11 2019 tcpdump -rwxr-xr-x 1 root root 8801 Sep 11 2019 tty -rwxr-xr-x 1 root root 8860 Sep 11 2019 umount -rwxr-xr-x 1 root root 13331 Sep 11 2019 uname -rwxr-xr-x 1 root root 46230 Sep 11 2019 usb -rwxr-xr-x 1 root root 112136 Sep 11 2019 use -rwxr-xr-x 1 root root 645340 Sep 11 2019 vi -rwxr-xr-x 1 root root 37915 Sep 11 2019 waitfor -rwxr-xr-x 1 root root 31047 Sep 11 2019 wave -rwxr-xr-x 1 root root 22460 Sep 11 2019 waverec

Here you are specifying 4 serial ports and the interrupts for each (4,3,9,10). Do you really have 4 serial ports and require those exact interrupts?

[john]yes, we want to use 4 serial ports on our board thats why we have used that command. By deafult , devc-8250 will create 2 serial ports (ser1 and ser2).

We have tried to start devc-8250 driver as per your below suggestion. It created 2 ser 1 and ser2 serial ports, we are able to transmit in both, still observe the receive issue. It seems IRQ doesn’t conflict with other devices.

Only BIOS assigned the address and IRQ to that devices.

devc-ser8250 -b 115200

Does your board actually have 4 serial ports?

pci-tool -vvv should list the IRQ’s assigned to each. And I/O addresses.

I ran into the password problem on both x86 and ARM systems. In the x86 I boot off an external drive and mount it as / (root). On this drive there is a pre-made /etc directory (amongst others). I now have the flexibility of a read/write file system. I removed all the /etc stuff from the image source.

It was not simple - many hours of playing around as I couldn’t find any material dealing with this.

In my case I started devb-eide. The drive has a QNX6 file system and the boot image is in /.boot. After starting devb-eide I use the automount command to mount it and reassign / to it

I will dig out the relevant code tomorrow and post it here. I don’t see why everyone has to go through the pain I went though to get an x86 system up and running! But to understand it it is probably best that you have an understanding of how QNX6 (at least works as QNX7 is pretty much the same in this regard).

Geoff.

Hi Geoff,

Yes, our board is having 4 serial ports. FYI, all the ports are working (transmitting and receiving) in Ubuntu OS. In qnx 7.0,able to transmit using all 4 ports but not able to receive.

Also, you have mentioned that you are able to change the password after installing it in HDD. can you please post your build file and procedure for making /etc as read/write filesystem?

Thanks,
John.

Hi John,

If you want to be able to create accounts and change password you have to run everything from the harddrive and not from the boot image. Running in the boot image is normally only for systems that don’t have a hard drive and that you want to prevent users from modifying the system in any way.

Below is my boot image. It essentially just starts the disk driver, USB driver, 4 consoles and the calls a custom startup script called rc.sysinit located in /etc/rc.d (a directory we created).I could have simplified this even further and put the USB driver and consoles in the rc.sysinit file.

You need to do something similar. Your boot file should do just what mine does (start the disk driver then call a custom sysinit script you create that mounts your 2nd hard drive, starts your own networking info, your serial driver and so on). Just make sure that your sysinit file is set to rwx (ie the execute bit is set) or it won’t execute :stuck_out_tongue:

[virtual=x86,bios +compress] boot = {
	startup-x86 -v
	PATH=/sbin:/usr/sbin:/bin:/usr/bin:/proc/boot:/x86/sbin:/x86/usr/sbin:/x86/bin:/x86/usr/bin LD_LIBRARY_PATH=/proc/boot:/lib:/usr/lib:/lib/dll:/lib/dll/pci:/x86/lib:/x86/usr/lib:/x86/lib/dll procnto-smp-instr -v
}

# Start-up script
[+script] startup-script = {
	procmgr_symlink ../../proc/boot/libc.so /usr/lib/ldqnx.so.2

	display_msg "Advantech Build V1.0"
	
	# Needed for pci-server
	display_msg "Starting slogger2 server ..."
	slogger2 -s2048k &
	waitfor /dev/slog2

    # Needed for consoles	
	display_msg "Starting some common services ..."
	pipe
	devc-pty &
	
    # Settings env for PCI server and starting PCI server
	PCI_HW_MODULE=/lib/dll/pci/pci_hw-Intel_x86.so
	PCI_SLOG_MODULE=/lib/dll/pci/pci_slog2.so
	PCI_DEBUG_MODULE=/lib/dll/pci/pci_debug2.so
	PCI_BASE_VERBOSITY=3
	
	display_msg "Starting PCI Server ..."
	pci-server --aspace-enable
	waitfor /dev/pci	
	
	# Start the disk driver
	display_msg "Starting Disk Driver ..."
	devb-ahci cam quiet ahci nports=4 blk automount=hd0t177:/:qnx6 &
	waitfor /boot 10
	
    # Starting USB host driver and services for keyboard / mouse
	display_msg "Starting USB host ..."
	io-usb-otg -n /dev/io-usb/io-usb -d xhci -d ehci -d ohci -d uhci
	waitfor /dev/io-usb/io-usb

	devb-umass cam pnp &
	io-hid -d usb /dev/io-usb/io-usb
	waitfor /dev/io-hid/io-hid
	
	# Starting consoles and shells
	display_msg "Starting consoles ..."
	devc-con-hid -r50 -n4
	waitfor /dev/con1
	waitfor /dev/con2
	waitfor /dev/con3
	waitfor /dev/con4

	SYSNAME=nto
	TERM=qansi-m

    # Do custom system initialization
    /etc/rc.d/rc.sysinit
}

# Components
[data=copy]
libc.so
# PCI
pci-server
libpci.so
[-followlink search=${QNX_TARGET}/${PROCESSOR}] /lib/dll/pci/=lib/dll/pci
# Sata
devb-ahci
io-blk.so
libcam.so
fs-qnx6.so
fs-dos.so
cam-disk.so
cam-cdrom.so
# USB
io-usb-otg
usb
libusbdi.so
libhiddi.so
devu-hcd-ehci.so
devu-hcd-ohci.so
devu-hcd-uhci.so
devu-hcd-xhci.so
devb-umass
# HID
io-hid
devh-usb.so
devh-ps2ser.so
# Console
devc-con
devc-con-hid
# SLogger
slogger2
slog2info
libslog2.so
libslog2parse.so
libtracelog.so
libpps.so
libbacktrace.so
devc-pty
pipe
ksh
# Create virtual links to the Ram drive so temp files go in Ram 
[type=link] /usr/lib/ldqnx.so.2 = /proc/boot/libc.so
[type=link] /bin/sh=/proc/boot/ksh
[type=link] /var/run=/dev/shmem
[type=link] /var/db=/dev/shmem

My rc.sysinit looks like

#!/bin/sh
echo
echo Executing rc.sysinit Ver 1.0

# A useful function
function waitfor {
	typeset -i i=0
	while test $i -lt 60 -a ! $1 -ef $1 ; do
		sleep 1;
		let i=i+1;
	done
	unset i
}

# Start some common services
random -t
mqueue
devc-ser8250 -e -b115200 &
waitfor /dev/ser1
	
# Make dir and allow all to use it
if ! test -d /var/dumps
then
mkdir -p /var/dumps
chmod -R 777 /var
fi
dumper -d /var/dumps &

# Allow ftp to use /tmp and telnet to login
if ! test -d /tmp
then
mkdir /tmp
fi
chmod 777 /tmp
ln -sP /x86/bin/login /bin/login

# Start networking
# This is the setting for the ethernet chips on the 2 intel ethernet cards on
# the Advantech controller
hostname SURFACE
io-pkt-v6-hc -d e1000 &
if_up -r 10 -p wm0
ifconfig wm0 172.27.12.3 netmask 255.255.255.0 up
ifconfig wm1 up
route add default 172.27.12.1

# Start the ftp/telnet daemon
# Uncomment line below to get dhcp address for wm1
#dhclient -nw
inetd &

# Start qconn to enable momentics to connect (for remote debugging)
qconn qconn_prio=11 &

# Create a 50 meg RAM drive for holding Control System log files
devb-ram ram capacity=1 blk ramdisk=50m,cache=512k,vnode=256 &
waitfor /dev/ram0
mkqnx6fs -q /dev/ram0
mount -t qnx6 /dev/ram0 /fs/ram

# Start SAMBA so Windows can mount QNX drives as Windows network drives
rm -f /usr/local/samba/var/locks/smbd.pid
rm -f /usr/local/samba/var/locks/nmbd.pid
rm -f /usr/local/samba/log.*
/x86/usr/bin/samba/smbd -D
/x86/usr/bin/samba/nmbd -D

# Start gns to enable registering of unique names in the system global name
# space
gns -s

export TERM=qansi-m

# Start the login shell (which auto logs in as root which will then run our S/W)
PATH=/bin:/usr/bin:/sbin exec `which tinit` 

exec sh
exec fesh

Back to your board. Can you post a link to the hardware specs of the board. I want to confirm it has 8250 UARTS.

Tim

Hi Tim,

Thanks for your inputs.

If you want to be able to create accounts and change password you have to run everything from the harddrive and not from the boot image. Running in the boot image is normally only for systems that don’t have a hard drive and that you want to prevent users from modifying the system in any way

We are booting the image from SATADOM 32 Gb (30 GB usable) and we are creating 2 partitions ( Partition 1 (type: 178) 3 GB , mounted under /fs/qnx6 , Partition 2 (type :179) 27 GB , mounted under /home) and storing the x86-generic.bin file in .boot folder and booting from the disk.

It seems we are running the boot image. But we woud need to give provisions for user to change the password and new user account creation.

We have referred our code and noticed that you did automount for HDD. Do we need to follow the same ? Because in our build file, we just mount the partition 1 under /fs/qnx6

Please advise.

Your code

Start the disk driver display_msg "Starting Disk Driver ..." devb-ahci cam quiet ahci nports=4 blk automount=hd0t177:/:qnx6 & waitfor /boot 10

Our code

[code]mount -t qnx6 -o sync=none /dev/hd0t178 /fs/qnx6

mount -t qnx6 -o sync=none /dev/hd0t179 /home[/code]

Can you post a link to the hardware specs of the board. I want to confirm it has 8250 UARTS.

Our Board is using Exar XR28V384 LPC UART chip.

Thanks,
John

Hi John,

You don’t have to do the automount command. You can do the manual mount on separate lines as you have done. You just have to include the mount command in your boot image.

Note that you are mounting the default file system as /fs/qnx6 and I am mounting as the default /. If you must keep the /fs/qnx6 then you may (likely) have to change the default PATH environment variables since QNX will be looking for / as the root folder when searching for things like the /bin folder instead of /fs/qnx6/bin. I would strongly suggest you change yours to /.

I’ve noted that you have mounted the 2nd partition as /home. Does this mean there is no /home folder on your /fs/qnx partition? I just want to be sure there isn’t if you change your /fs/qnx6 to / because otherwise you’d get duplicate /home directories.

I googled your board. It is NOT using a default 8250 UART. It’s using a V384 low pin count UART. Furthermore in their docs here:
maxlinear.com/document?id=22076
on page 8 they talk about having custom QNX drivers. That makes me think you can’t use devc-ser8250. You should contact them directly and ask for the custom QNX driver. I suspect that is what you require or at the very least they can help you setup your board BIOS correctly for QNX.

Tim

The image that Tim has posted is pretty much the same as mine. My rc. file also, although mine there are obviously differences in our startup configurations.

I have two x86 systems to work with - one uses devb-ahci and the other devb-eide. If in your case one doesn’t work try the other. The automount is important but make sure it uses the correct partition type. QNX6 partitions can be type 177, 178, and/or 179)

I call my initialisation file rc.local whereas Tim’s is rc.sysinit. But we both have an /etc/rc.d directory. rc.d is to me a Linux (or UNIX) convention. Likewise rc.local. Perhaps rc.sysinit is a reference back to the old QNX4 days Tim? :slight_smile:

I suspect your next question John is about how to create the external hard (or SSD) drive in the first place. I have built up a bootable USB to do this - the generic x86 can do this for you.

I don’t have an x86 based machine here with more than two 8250 (or derivative) UART’s so I can’t verify that devc-ser8250 actually works with more than two. I have found other QNX7 drivers and utilities that don’t work quite as advertised. Given that all four work with Ubuntu and presumably with the same Linux driver, I suspect something is not working quite right in the QNX driver. I guess we shall soon see.

Geoff.

Maybe I’m barking up the wrong tree but on Page 9 (that has a table reference to the XR28V384) under LPC UARTs it states that:

To me that says that the four UARTs are 16550 compatible. The 16x50 UARTs were derived from the original Intel 8250 and are register compatible. The 16x50 UARTs did have some enhancements (buffer related as I recall) but are backward compatible to the 8250. devc-ser8250 should, in my opinion, work with them. From what John says it does with the first pair but not the second pair. The default I/O addresses correspond to those John says he’s using.

It doesn’t mention interrupts at all however. Perhaps this is an interrupt related issue?

It has been many years since I looked at the source for devc-ser8250 but as I recall it was dependent on working IRQ’s (interrupts) to at least receive. I can’t remember about transmission (and the other two interrupt types of the 8250). It seems to me that John is able to transmit on all four UART’s but simply cannot receive. This also implies to me that devc-ser8250 is indeed compatible with these UARTs and the fact that they transmit backs this up - references that I can find to the V384 state that it is register compatible with the 16550/8250 UARTs.

I don’t think it is possible for devc-ser8250 to poll UARTs.

Maybe a look at the BIOS will show what addresses and IRQ’s have been assigned to the UART? On a machine I just fired up that uses an Award BIOS it shows me the two UARTs being 3f8,4 and 2f8,3 (/dev/ser1 & /dev/ser2 respectively). If your BIOS indicates the assigned addresses and IRQ’s for all four UART perhaps try them and see what happens? And let us know! :slight_smile: (either way).

I’d also like to know what happens with a loopback plug connected to the serial port connector with the qtalk terminal program opening them. Just in case this is a timing related issue between two different machines (I suspect it’s not but it’s still a good test). Is it a DB9 male connector or something else? It’s easy to fabricate an RS232 loopback plug - simply tie the TxD and RxD pins (2 & 3 on a D9 connector) together and disable hardware flow control on the serial port.

Or as Tim suggests, simply ask MaxLinear for the QNX7 driver this I presume will work for you.

Cheers,

Geoff.

I just went on to the MaxLinear website and can’t find any QNX drivers at all - let alone a QNX7 driver. I wonder what version of QNX they refer to on Page 9 of the document. If one is available it has to be for QNX7 - any earlier version most likely will not work.

Geoff.