Hello All,
I followed the steps at EPICS with RTEMS, compiled RTEMS 5, and ran an example hello on MVME2502. The dtb file was generated from the linux source file: $ dtc -I dts -O dtb linux/arch/powerpc/boot/dts/fsl/mvme2500.dts -o mvme2500.dtb
If I didn't change the macro definition #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER to #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER in the file test.c, the OUTPUT is:
Bytes transferred = 12331 (302b hex)
WARNING: adjusting available memory to 30000000
## Booting kernel from Legacy Image at 01000000 ...
Image Name: hello
Created: 2022-06-09 15:06:14 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 51612 Bytes = 50.4 KiB
Load Address: 00004000
Entry Point: 00004000
Verifying Checksum ... OK
## Flattened Device Tree blob at 00c00000
Booting using the fdt blob at 0xc00000
Uncompressing Kernel Image ... OK
ft_fixup_l2cache: FDT_ERR_NOTFOUND
?H?@?LR???r????I?C?=GC?c?
Then, I compiled EPICS base 7.0.6.1, made a EPICS exampleApp test, ran the image file bin/RTEMS-qoriq_e500/test.img. The OUTPUT is:
WARNING: adjusting available memory to 30000000
## Booting kernel from Legacy Image at 01000000 ...
Image Name: test
Created: 2022-06-08 16:51:21 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 2734725 Bytes = 2.6 MiB
Load Address: 00004000
Entry Point: 00004000
Verifying Checksum ... OK
## Flattened Device Tree blob at 00c00000
Booting using the fdt blob at 0xc00000
Uncompressing Kernel Image ... OK
ft_fixup_l2cache: FDT_ERR_NOTFOUND
?C???)???G?}[k???C8V?o?????????????k???J?G&k)?J?gb!?CruB??????g?s ?C1H?cbjR?C?b???c??=?????????C1H?cbjR?C?b???c??=???????? ?C1H?cbjR?C?b???c??=?????????C1H?cbjR?C?b???c??=???????? ?C1H?cbjR?C?b???c??=????????1b?R?W?jR?C?b???c?????gb
So, I had to change the macro definition #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER to #define CONFIGURE_APPLICATION_NEEDS_SIMPLE_CONSOLE_DRIVER in the file base/modules/libcom/RTEMS/posix/rtems_config.c.
Did I do something wrong?
After recompiling EPICS and making the exampleApp, the IOC started to get the ip through DHCP. I set some file paths in the rtems_init.c file, but there was some other information after the IOC initialization was completed:
diff --git a/modules/libcom/RTEMS/posix/rtems_init.c b/modules/libcom/RTEMS/posix/rtems_init.c
index 403cd0785..d7886b6ab 100644
--- a/modules/libcom/RTEMS/posix/rtems_init.c
+++ b/modules/libcom/RTEMS/posix/rtems_init.c
@@ -97,10 +97,10 @@ epicsEventId dhcpDone;
* may provide by dhcp/bootp
* or environments from the "BIOS" like u-boot, motboot etc.
*/
-char rtemsInit_NTP_server_ip[16] = "";
-char bootp_server_name_init[128] = "[email protected]:/epics";
-char bootp_boot_file_name_init[128] = "/epics/myExample/bin/RTEMS-beatnik/myExample.boot";
-char bootp_cmdline_init[128] = "/epics/myExample/iocBoot/iocmyExample/st.cmd";
+char rtemsInit_NTP_server_ip[16] = "10.1.201.31";
+char bootp_server_name_init[128] = "10.1.201.31:/tftpboot";
+char bootp_boot_file_name_init[128] = "/tftpboot/mv2500/bin/RTEMS-qoriq_e500/test.img";
+char bootp_cmdline_init[128] = "/tftpboot/mv2500/iocBoot/ioctest/st.cmd";
struct in_addr rtems_bsdnet_bootp_server_address;
/* TODO check rtems_bsdnet_bootp_cmdline */
some OUTPUT:
MVME2500=> run epicsTest
Speed: 1000, full duplex
Using eTSEC1 device
TFTP from server 10.1.201.31; our IP address is 10.1.201.125
Filename 'mv2500/bin/RTEMS-qoriq_e500/test.img'.
Load address: 0x1000000
Loading: #################################################################
#################################################################
#######
done
Bytes transferred = 1997059 (1e7903 hex)
Speed: 1000, full duplex
Using eTSEC1 device
TFTP from server 10.1.201.31; our IP address is 10.1.201.125
Filename 'mvme2500.dtb'.
Load address: 0xc00000
Loading: #
done
Bytes transferred = 12331 (302b hex)
WARNING: adjusting available memory to 30000000
## Booting kernel from Legacy Image at 01000000 ...
Image Name: test
Created: 2022-06-08 14:23:06 UTC
Image Type: PowerPC Linux Kernel Image (gzip compressed)
Data Size: 1996995 Bytes = 1.9 MiB
Load Address: 00004000
Entry Point: 00004000
Verifying Checksum ... OK
## Flattened Device Tree blob at 00c00000
Booting using the fdt blob at 0xc00000
Uncompressing Kernel Image ... OK
ft_fixup_l2cache: FDT_ERR_NOTFOUND
WARNING: OS Clock time was read before being set.
Using 1990-01-02 00:00:00.000000 UTC
initConsole --- Info ---
stdin: fileno: 0, ttyname: /dev/console
stdout: fileno: 1, ttyname: /dev/console
stderr: fileno: 2, ttyname: /dev/console
tcgetattr failed: Not a character device
time set to : 04/14/14 07:30:06.000000839 UTC
Startup.
epicsThreadSetPriority called by non epics thread
***** RTEMS Version: rtems-5.0.0 (PowerPC/Generic (E500/float-gprs/SPE)/qoriq_e500) *****
***** Initializing network (libbsd, dhcpcd) *****
nexus0: <RTEMS Nexus device>
ofwbus0: <Open Firmware Device Tree> on nexus0
...
-------------- IFCONFIG -----------------
tsec0: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
ether ec:9e:cd:13:47:66
inet6 fe80::ee9e:cdff:fe13:4766%tsec0 prefixlen 64 scopeid 0x1
inet 10.1.201.13 netmask 0xffffff00 broadcast 10.1.201.255
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect (1000baseT <full-duplex>)
status: active
tsec1: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=8000b<RXCSUM,TXCSUM,VLAN_MTU,LINKSTATE>
ether ec:9e:cd:13:47:67
inet6 fe80::ee9e:cdff:fe13:4767%tsec1 prefixlen 64 scopeid 0x2
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
media: Ethernet autoselect (none)
status: no carrier
tsec2: flags=8843<UP,BROADCAST,RUNNING,SIMPLEX,MULTICAST> metric 0 mtu 1500
options=b<RXCSUM,TXCSUM,VLAN_MTU>
ether ec:9e:cd:13:47:68
inet6 fe80::ee9e:cdff:fe13:4768%tsec2 prefixlen 64 scopeid 0x3
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
lo0: flags=8049<UP,LOOPBACK,RUNNING,MULTICAST> metric 0 mtu 16384
options=680003<RXCSUM,TXCSUM,LINKSTATE,RXCSUM_IPV6,TXCSUM_IPV6>
inet 127.0.0.1 netmask 0xffffff00
inet6 ::1 prefixlen 128
inet6 fe80::1%lo0 prefixlen 64 scopeid 0x4
nd6 options=21<PERFORMNUD,AUTO_LINKLOCAL>
groups: lo
-------------- NETSTAT ------------------
Routing tables
Internet:
Destination Gateway Flags Netif Expire
default 10.1.201.1 UGS tsec0
10.1.201.0/24 link#1 U tsec0
10.1.201.13 link#1 UHS lo0
127.0.0.1 link#4 UH lo0
Internet6:
Destination Gateway Flags Netif Expire
::1 link#4 UH lo0
fe80::%tsec0/64 link#1 U tsec0
fe80::ee9e:cdff:fe13:4766%tsec0 link#1 UHS lo0
fe80::%tsec1/64 link#2 U tsec1
fe80::ee9e:cdff:fe13:4767%tsec1 link#2 UHS lo0
fe80::%tsec2/64 link#3 U tsec2
fe80::ee9e:cdff:fe13:4768%tsec2 link#3 UHS lo0
fe80::%lo0/64 link#4 U lo0
fe80::1%lo0 link#4 UHS lo0
***** Until now no NTP support in RTEMS 5 with rtems-libbsd *****
***** Ask ntp server once... *****
debug: tsec0: sending ARP announce (2 of 2)
debug: tsec2: sending DISCOVER (xid 0xa096e1f), next in %0.1f seconds
time from ntp : 06/15/22 06:51:49.000000839 UTC
***** Setting up file system *****
***** Initializing NFS *****
nfsMount("10.1.201.31", "/tftpboot", "/tftpboot")
Mount 10.1.201.31:/tftpboot on /tftpboot
check for time registered , C++ initialization ...
***** Preparing EPICS application *****
chdir("/tftpboot/mv2500/iocBoot/ioctest/")
***** Starting EPICS application *****
#< envPaths
## Register all support components
dbLoadDatabase("../../dbd/test.dbd")
test_registerRecordDeviceDriver(pdbbase)
## Load record instances
#dbLoadTemplate("db/user.substitutions")
dbLoadRecords("../../db/testVersion.db", "user=chengsn")
dbLoadRecords("../../db/circle.db", "user=chengsn")
dbLoadRecords("../../db/dbSubExample.db", "user=chengsn")
#var mySubDebug 1
#traceIocInit
iocInit
Starting iocInit
############################################################################
## EPICS R7.0.6.2-DEV
## Rev. R7.0.6.1-103-g3fadf4a26cfe33dcb9eb-dirty
############################################################################
iocRun: All initialization complete
## Start any sequence programs
#seq(sncExample, "user=chengsn")
RTEMShost> tsec2: sending DISCOVER (xid 0xa096e1f), next in 31.1 secondstimed outallowing 8 seconds for IPv4LL timeouttsec2: probing for an IPv4LL addresstsec2: checking for 169.254.92.20tsec2: sending ARP probe (1 of 3), next in 1.6 secondstsec2: sending ARP probe (2 of 3), next in 1.7 secondstsec2: sending ARP probe (3 of 3), next in 2.0 secondstsec2: using IPv4LL address 169.254.92.20tsec2: adding IP address 169.254.92.20/16tsec0: adding host route to 10.1.201.13 via 127.0.0.1tsec0: ipv4_addroute: mtsec0: adding route to 10.1.201.0/24tsec0: ipv4_addroute: mtsec2: adding host route to 169.254.92.20 via 127.0.0.1tsec2: ipv4_addroute: mtsec2: adding route to 169.254.0.0/16tsec2: ipv4_addroute: mtsec2: writing lease `/var/db/dhcpcd-tsec2.lease'tsec2: executing `ioc boot' IPV4LL
dhcpcd ---> 'interface=tsec2'
'interface' = 'tsec2'
dhcpcd ---> 'reason=IPV4LL'
'reason' = 'IPV4LL'
dhcpcd ---> 'pid=1'
dhcpcd ---> 'ifmetric=203'
dhcpcd ---> 'ifwireless=0'
dhcpcd ---> 'ifflags=4294936643'
dhcpcd ---> 'ifmtu=1500'
dhcpcd ---> 'interface_order=tsec0 tsec2 tsec1'
dhcpcd ---> 'if_up=true'
dhcpcd ---> 'if_down=false'
dhcpcd ---> 'new_ip_address=169.254.92.20'
dhcpcd ---> 'new_subnet_cidr=16'
dhcpcd ---> 'new_network_number=169.254.0.0'
dhcpcd ---> 'new_subnet_mask=255.255.0.0'
dhcpcd ---> 'new_broadcast_address=169.254.255.255'
tsec2: sending ARP announce (1 of 2), next in 2.0 secondstimed outtsec2: sending ARP announce (2 of 2)tsec2: soliciting a DHCP leasetsec2: sending DISCOVER (xid 0x614c417a), next in 3.6 secondstsec2: sending DISCOVER (xid 0x614c417a), next in 7.3 secondstsec2: sending DISCOVER (xid 0x614c417a), next in 15.5 secondstsec2: sending DISCOVER (xid 0x614c417a), next in 32.5 secondstsec2: sending DISCOVER (xid 0x614c417a), next in 63.6 secondstsec2: sending DISCOVER (xid 0x614c417a), next in 63.5 secondstsec2: sending DISCOVER (xid 0x614c417a), next in 63.6 secondstsec2: sending DISCOVER (xid 0x614c417a), next in 63.9 secondstsec0: renewing lease of 10.1.201.13tsec0: rebind in 225 seconds, expire in 300 secondstsec0: sending REQUEST (xid 0x504868fd), next in 4.5 secondstsec0: acknowledged 10.1.201.13 from 10.1.201.31 `10.1.201.31'tsec0: leased 10.1.201.13 for 600 secondstsec0: renew in 300 seconds, rebind in 525 secondstsec0: IP address 10.1.201.13/24 already existstsec0: adding host route to 10.1.201.13 via 127.0.0.1tsec0: ipv4_addroute: mtsec0: adding route to 10.1.201.0/24tsec0: ipv4_addroute: mtsec2: adding host route to 169.254.92.20 via 127.0.0.1tsec2: ipv4_addroute: mtsec2: adding route to 169.254.0.0/16tsec2: ipv4_addroute: mtsec0: writing lease `/var/db/dhcpcd-tsec0.lease'tsec0: executing `ioc boot' RENEW
Then, the IOC will keep restarting...
What should I do to get the IOC working properly?
Best regards,
chengsn
- Replies:
- Re: Some Questions With RTEMS 5 in MVME2502 chengsn via Tech-talk
- Navigate by Date:
- Prev:
RE: Testing Rocky Linux with EPICS Abdalla Ahmad via Tech-talk
- Next:
Re: Some Questions With RTEMS 5 in MVME2502 chengsn via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
<2022>
2023
2024
- Navigate by Thread:
- Prev:
Re: CoreRelease and the attributes of an IOC's build Andrew Johnson via Tech-talk
- Next:
Re: Some Questions With RTEMS 5 in MVME2502 chengsn via Tech-talk
- Index:
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
<2022>
2023
2024
|