Raspberry 4 CM: Unresponsive after Boot

Hello together,

I set up two Raspberry 4 Compute Modules according to the documentation provided here:
https://labs.windriver.com/downloads/wrsdk-vxworks7-docs/2203/README_raspberrypi4b.html

They boot up as expected and also are reachable via telnet:

# microcom -s 115200 /dev/ttyS1
7.9 GiB
RPI Compute Module 4 (0xd03141)
Core:  208 devices, 15 uclasses, devicetree: board
MMC:   mmcnr@7e300000: 1, mmc@7e340000: 0
Loading Environment from FAT... OK
In:    serial
Out:   serial
Err:   serial
Net:
Warning: ethernet@7d580000 MAC addresses don't match:
Address in DT is		e4:5f:01:e0:78:55
Address in environment is	dc:a6:32:07:b3:a4
eth0: ethernet@7d580000
Hit any key to stop autoboot:  1 12667552 bytes read in 555 ms (21.8 MiB/s)
## Booting kernel from Legacy Image at 00100000 ...
   Image Name:   vxworks
   Image Type:   AArch64 VxWorks Kernel Image (uncompressed)
   Data Size:    12667488 Bytes = 12.1 MiB
   Load Address: 00100000
   Entry Point:  00100000
   Verifying Checksum ... Instantiating /ram0 as rawFs,  device = 0x1
Formatting /ram0 for HRFS v1.2
Instantiating /ram0 as rawFs, device = 0x1
Formatting...OK.
Target Name: vxTarget
Instantiating /tmp as rawFs,  device = 0x10001
Formatting /tmp for HRFS v1.2
Instantiating /tmp as rawFs, device = 0x10001
./
    \........\    /......../
     \........\   \......./
      \........\   \...../              VxWorks SMP 64-bit
       \........\   \.../
        \........\   \./     Release version: 22.03
         \........\   -      Build date: Mar 15 2022 18:06:48
          \........\
           \......./         Copyright Wind River Systems, Inc.
            \...../   -                 1984-2022
             \.../   /.\
              \./   /...\
               -   -------

                   Board: Raspberry Pi 4 Model B - ARMv8
               CPU Count: 4
          OS Memory Size: ~7987MB
        ED&R Policy Mode: Deployed
     Debug Agent: Started (always)
         Stop Mode Agent: Not started
              BSP Status: *** UNSUPPORTED ***

Thu Jan  1 00:00:00 1970: ipnet[3cf540]: Error: ipcom_getsockaddrbyaddr failed gw: dhcp

 Adding 21025 symbols for standalone.

->
Network configuration:
ifname genet0 inet 192.168.178.63 mac e4:5f:01:e0:78:55

This device is also accessible over telnet!

When connecting via telnet, I want to access a local FTP server in order to load an executable:

telnet 192.168.178.62
Trying 192.168.178.62...
Connected to 192.168.178.62.
Escape character is '^]'.

-> netDevCreate("wrs", "192.168.178.20", 1)
value = 4294967295 = 0xffffffff
-> cmd
[vxWorks *]# cd wrs
[vxWorks *]# ls
[vxWorks *]#

I tried multiple FTP servers in a local and accessible network, no luck so far. But mostly interesting, the ‘cmd wrs’ command takes minutes and yields no results. I only experienced the Qemu Host VxWorks so far, and responses were very quick.
When trying multiple Cmds in the end, I have to power-cycle the CM4s to get them to respond again.

I’m not sure, the stack trace is nominal, when cancelling one of the Cmds:

[vxWorks *]# cd wrs
pws
pwd

0xffffffff8022895c vxTaskEntry  +0x1c : shellTask ()
0xffffffff80569370 shellTask    +0x618: shellExec ()
0xffffffff8056b64c shellExec    +0x17c: 0xffffffff805607ec ()
0xffffffff805608ac shellInterpCmdInit+0x244: 0xffffffff80561378 ()
0xffffffff80561684 shellInterpCmdInit+0x101c: shellCmdExec ()
0xffffffff805645e0 shellCmdExec +0x18c: 0xffffffff80571774 ()
0xffffffff805717a4 usrFsShellCmdInit+0xbc : cd ()
0xffffffff80424cfc cd           +0x18 : ioDefPathCat ()
0xffffffff802cc7d4 ioDefPathCat +0xa0 : iosPathResolveFollow ()
0xffffffff802bf604 iosPathResolveFollow+0x58 : ioOpenFollowLinks ()
0xffffffff802b8e38 ioOpenFollowLinks+0x1a0: iosOpen ()
0xffffffff802bc9d8 iosOpen      +0x44 : 0xffffffff8021c20c ()
0xffffffff8021c2e0 netDrvEx     +0x5c8: 0xffffffff8021e2e8 ()
0xffffffff8021e314 netHomeDir   +0x800: 0xffffffff8021d5d8 ()
0xffffffff8021d6bc netLsByName  +0x250: 0xffffffff8021dc08 ()
0xffffffff8021dc84 netHomeDir   +0x170: ftpHookup ()
0xffffffff80213d1c ftpHookup    +0x1e8: connect ()
0xffffffff8057d3fc connect      +0xfc : 0xffffffff80781244 ()
0xffffffff80781270 ipcom_set_for_each+0x17c: ipcom_connect ()
0xffffffff801e73c0 ipcom_connect+0x14c: ipnet_usr_sock_wait_until_writable ()
0xffffffff801e6504 ipnet_usr_sock_wait_until_writable+0x44 : 0xffffffff801e6518 ()
0xffffffff801e65b4 ipnet_usr_sock_wait_until_writable+0xf4 : 0xffffffff801e9790 ()
0xffffffff801e97c8 ipcom_sendmsg_sock+0x1798: 0xffffffff801ac8f8 ()
0xffffffff801ac91c ipnet_pipe_create+0x1ec: 0xffffffff801ac93c ()
0xffffffff801aca38 ipnet_pipe_create+0x308: ipcom_block_wait ()
0xffffffff801396a4 ipcom_block_wait+0x60 : semTake ()
0xffffffff80690354 semTake      +0xc8 : semBTakeInternal ()

Shell task 'tShellRem18446603336412708704' restarted...

I have the same behavior for both CM4s, so I do not see a hardware issues. Also the FTP servers do not write logs about the connection of the CM4s, however they work from a different host flawlessly. The U-Boot I’m using is from 2022.10. I installed VxWorks on the eMMC on the CM4s, a complete FAT32 partition of 8GiB.

Are there any hints on what is wrong in my setup?

Best regards,
Jan

As mentioned within Raspberry Pi VxWorks Faults when booting - #7 by amannini there needs to be a leading slash, which then enables me to access the FTP server without any issues.

I compiled the Hello World example for the Arm8/64bit target and then get the following result:

[vxWorks *]# arm_helloWorld.vxe
Launching process 'arm_helloWorld.vxe' ...
Process 'arm_helloWorld.vxe' (process Id = 0xffff800000477a10) launched.
Shared object "libc.so.1" not found Or Cannot stat "libc.so.1" Or "libc.so.1" is not a regular file

Does this seem nominal?

-> hostShow
hostname         inet address                                    aliases
--------         ------------                                    -------
localhost        127.0.0.1
vxTarget         192.168.0.3
host             192.168.0.2
value = 0 = 0x0
-> bootParamsShow sysBootLine

boot device          : usb2End
unit number          : 0
processor number     : 0
host name            : host
file name            : vxWorks
inet on ethernet (e) : 192.168.0.3:ffffff00
host inet (h)        : 192.168.0.2
gateway inet (g)     : 192.168.0.1
user (u)             : target
ftp password (pw)    : vxTarget
flags (f)            : 0x40
other (o)            : genet0

value = 1 = 0x1
-> devs
drv refs name
 13 [ 5] /dev/random
 13 [ 5] /dev/urandom
 12 [ 5] /dev/zero
 11 [ 5] /fifos
 16 [ 5] /host.host
 14 [ 5] /input/event
  0 [ 5] /null
 10 [ 5] /ram0
  3 [ 5] /shm
  8 [ 7] /stdio_pty_0xffff8000003f5930.M
  7 [ 7] /stdio_pty_0xffff8000003f5930.S
 10 [ 5] /tmp
  2 [ 7] /ttyS0
value = 2 = 0x2

Hi Jan,

The binary you’re trying to run is a dynamic executable, so you will need to specify the location of the shared libraries it requires.

I haven’t seen any entry for the eMMC in your VxWorks device list. The SD card would appear as device /sd0a. Assuming a copy of the vxsdk/sdcard/sysroot folder is available on the SD card, to explicitly set the library path you would need to run this command in the cmd shell
set env LD_LIBRARY_PATH="/sd0a/sysroot/lib/;/sd0a/sysroot/usr/lib/"
before running your application.

You can also use the /wrs net drive as shared library location, but you will need to adjust the paths in LD_LIBRARY_PATH accordingly.

The other option is create a statically linked executable by specifying -static in the wr-cc compilation command.

Regards,
Dan

Hi Dan,

Thank you for helping out. The statically compiled binary works fine now! Amazing!

[vxWorks *]# helloWorld.vxe
Launching process 'helloWorld.vxe' ...
Process 'helloWorld.vxe' (process Id = 0xffff800000431780) launched.
Hello, World!

Regarding the eMMC vs SD card issue, I have a question: My CM4s both do not have an SD card inserted, so it has to be loaded and installed on the eMMC. I’m not sure whether the filesystem is all sound. What are my options to check that? Because commands like ls /lib yield to no result.

[vxWorks *]# ls /lib
Can't open "/lib".

Is there a way of automating the loading and execution process of a binary? The manual way works now, I wanted to start going towards a CI approach here. Is my only option to tell the CI agent to telnet onto the target and execute the netDevCreate and run? Are there like boot arguments to aways fetch from a specific source on startup? I do not yet have access to the knowledge base and all documentation of VxWorks from my University.

Also, I wonder how the product separation works: Is the NCL SDK, like for the RPi, still able to use partitioning and all that? I know, the BSP is not officially supported, but as a playground for students, I wanted to evaluate the features on an affordable board.

Best,
Jan

Hi Jan,

There aren’t any drivers for the eMMC included in the VxWorks kernel you booted on the CM, so there will not be a file system to access. You can use the net drive just as the SD card is used in my example which sets LD_LIBRARY_PATH (replace /sd0a with /wrs).

VxWorks supports startup scripts which are specified in the boot line, and in a startup script you would be able to include any valid C shell command. However, the boot line is not editable in the prebuilt VxWorks kernel included in the SDKs.

Regards,
Dan

Hi @dan.milea,

I’m getting back to the topic and I am trying to implement some kind of persistence to write measurement entries. Ideally, I’d be able to write to a local file (to not interfere with the performance of the network) on my RP4 CMs, which all have the 8GB eMMC.

What options do I have to create a file in this setup? Is there a way to ‘easily’ add an eMMC driver? Is RAM disk maybe an option? I have access to self-build a VxWorks Kernel with the Workbench; however I am not very familiar with that and have only used the pre-built one.

Any hints, particularly ‘quick’ solutions, maybe?

I’d appreciate some advice,
Jan

On adding an eMMC driver, I’d start with the documentation on docs.windriver.com. A quick intermediate solution is to use RAM disks, because you can create them dynamically from the C shell using xbdRamDiskDevCreate.

The xbdRamDiskDevCreate parameters are block size in bytes, disk size in bytes, “support disk partitions” flag and RAM disk name.

-> xbdRamDiskDevCreate 512,1024*1024,0,"/ram1"
-> dosfsDiskFormat "/ram1"

Dan

1 Like