EPICS Controls Argonne National Laboratory

Experimental Physics and
Industrial Control System

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  <20252026  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  <20252026 
<== Date ==> <== Thread ==>

Subject: Re: Running EPICS on RTEMS/MVME3100
From: Joel Sherrill via Tech-talk <[email protected]>
To: Vijay Kumar Banerjee <[email protected]>
Cc: "Marks, Nicholas" <[email protected]>, Talk EPICS Tech <[email protected]>
Date: Sun, 26 Oct 2025 20:13:25 +0100
Sounds great. Ping me to review them.

--joel

On Sun, Oct 26, 2025, 4:07 PM Vijay Kumar Banerjee <[email protected]> wrote:
Joel,


mvme3100 has an issue with libi2c in both 6 and main. I have a patchset that Nicholas tested on hardware. I will open a ticket in RTEMS and an MR to fix it.

On Sun, Oct 26, 2025, 1:40 AM Joel Sherrill <[email protected]> wrote:
Vijay.. Are these problems on the 6 and main branches for RTEMS.git and libbsd? Are there patches we need to make sure get in 6 and main?

On Sun, Oct 26, 2025, 3:35 AM Vijay Kumar Banerjee via Tech-talk <[email protected]> wrote:
Hi Andrew,


That setting needs to be part of the application that needs libi2c initialized. So, it might be possible to add it somewhere in the IOC instead of rtems_config.

I am not sure about the status of mvme3100 with libbsd. I remember we were able to run nfsv4 on libbsd with one of the boards, but I am not sure if we needed any other configurations. I am not aware of any issues other than the i2c problem we discussed in this thread.



On Sat, Oct 25, 2025, 5:02 PM Johnson, Andrew N. <[email protected]> wrote:
Hi Vijay,

Thanks for responding! Could that setting be part of the BSP, maybe conditionally on some other setting that all our boards might enable? Many different boards will use the EPICS rtems_confic.c file and they wont all need that setting (some of them might not have an i2c bus at all).

What else do you think would be needed for the mvme3100 BSP to be buildable with the netbsd network stack instead of the legacy one? Thats a configuration that were going to want to use...

- Andrew


-- 

Complexity comes for free, Simplicity you have to work for.


On 10/25/25, 6:02 PM, "Tech-talk" <[email protected]> wrote:

Awesome!

I'm glad it worked. I remember having to edit the rtems_confic.c to make it work.

RTEMS defines a macro RTEMS_BSP. Is it possible to add 
#if RTEMS_BSP == mvme3100 

In rtems_config.c, and add the configure option under it, since I2C is always required for EPICS on that BSP? Would that be an okay change for EPICS base?

On Sat, Oct 25, 2025 at 8:45 AM Marks, Nicholas <[email protected]> wrote:
Vijay,

I realized my "hello.exe" test there was a typo in the #define. It works now! For EPICS I tried adding it in a few different places that didn't work before I added to modules/libcom/RTEMS/posix/rtems_config.c in EPICS base which worked. Maybe there is a better way or a way to add it to the IOC itself rather than modifying EPICS base? I need to sort out some NFS issues first before the IOC will boot, but my initial problems are solved.

Thank you!
Nick

From: Vijay Kumar Banerjee <[email protected]>
Sent: Friday, October 24, 2025 10:24 PM
To: Marks, Nicholas <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: Running EPICS on RTEMS/MVME3100
 
This Message Is From an External Sender
This message came from outside your organization.
 
Hi Nicholas,


Have you tried adding the macro

#define CONFIGURE_APPLICATION_NEEDS_LIBI2C_DRIVER




On Fri, Oct 24, 2025, 7:30 PM Marks, Nicholas <[email protected]> wrote:
Hi Vijay,

Thanks, I'm trying with the 6 branches for now. Your patches almost applied without a hitch, however the 0001 patch failed to apply automatically for the rtems_i2c_init function. I believe I made the edits manually so this should be correct?:
/* Note that 'arg' is always passed in as NULL */
rtems_status_code
rtems_i2c_init (rtems_device_major_number major, rtems_device_minor_number minor,
          void *arg)
{
  /* No busses or drivers can be registered at this point;
   * avoid the macro aborting with an error
  DECL_CHECKED_DRV (drv, busno, minor)
   */

    rtems_mutex_init(&libmutex, "LIBI2C");
    rtems_libi2c_is_initialized     = true;
    rtems_libi2c_major = major;
    return 0;

}

The other patches appear to have applied without issue. Running some examples, I get different errors now. Running the hello.exe example, I get a "LIBI2C NOT INITIALIZED" message (see below). I've tried some EPICS applications too which have similar results. My guess is the EPICS network initialization is failing since the I2C driver isn't initialized and the network chip on the MVME communicates via I2C? Anyway, I appreciate the help and if you have any additional suggestions or patches you'd like me to test I'm all ears. Thanks!

Exit from bspstart
Tundra Tsi148 PCI-VME bridge detected at 0x80100000, IRQ 0
Tsi148 Outbound Ports:
Port  VME-Addr   Size       PCI-Adrs   Mode:
0:    0x20000000 0x0e000000 0xc0000000 A32, SUP, D32, SCT
1:    0x00000000 0x00ff0000 0xcf000000 A24, SUP, D32, SCT
2:    0x00000000 0x00010000 0xcfff0000 A16, SUP, D32, SCT
7:    0x00000000 0x01000000 0xce000000 CSR, SUP, D32, SCT
Tsi148 Inbound Ports:
Port  VME-Addr   Size       PCI-Adrs   Mode:
0:    0xc0000000 0x20000000 0x00000000 A32, PGM, DAT, SUP, USR, MBLT, BLT
vmeTsi148 IRQ manager: looking for registers on VME...
Trying to find CSR on VME...
vmeTsi148 - IRQ manager using VME CSR to flush FIFO
Registering /dev/console as minor 0 (==/dev/ttyS0)
LIBI2C NOT INITIALIZED

Hello World

[ RTEMS shutdown ]
RTEMS version: 6.0.0.36a3845d9cf896bb14ad9a9534b8f6acacba39b4-modified
RTEMS tools: 13.3.0 20240521 (RTEMS 6, RSB 9a03d058f3de052ac50e4ea29f78350ea2ecc7ab, Newlib 1b3dcfd)
executing thread ID: 0x0a010001


From: Vijay Kumar Banerjee <[email protected]>
Sent: Friday, October 24, 2025 2:19 PM
To: Marks, Nicholas <[email protected]>
Cc: Heinz Junkes <[email protected]>; [email protected] <[email protected]>
Subject: Re: Running EPICS on RTEMS/MVME3100
 
You don't often get email from [email protected]. Learn why this is important
This Message Is From an External Sender
This message came from outside your organization.
 
The patch should apply cleanly to the main branch. I have not tried applying on branch 6, but I would think that it should apply as the code related to patch has not changed during this time.

rtems-net-legacy is required if your application needs networking. rtems-net-legacy build on main for powerpc is currently broken due to a recent deprecation of "set_vector()" directive. I am working on a fix for this, but it might be next week because I generally get to work on this during weekends only :)

Meanwhile, you can try the patches with RTEMS 6. If it doesn't apply cleanly, I am happy to modify the patch accordingly


Best,

Vijay

On Fri, Oct 24, 2025 at 11:17 AM Marks, Nicholas <[email protected]> wrote:
Thank you all for the suggestions.

Vijay: I am working on trying your patches today. Is this intended to be applied to the version 6 branch, or to the main branch? If it is for the main branch, is the rtems-net-legacy package still required for using RTEMS on the MVME3100 with EPICS? Building rtems-net-legacy with waf on RTEMS 6.1 worked fine but not with RTEMS from the main branch...but perhaps this is expected.

- Nick

From: Vijay Kumar Banerjee <[email protected]>
Sent: Friday, October 24, 2025 1:16 AM
To: Heinz Junkes <[email protected]>
Cc: Marks, Nicholas <[email protected]>; [email protected] <[email protected]>
Subject: Re: Running EPICS on RTEMS/MVME3100
 
You don't often get email from [email protected]. Learn why this is important
This Message Is From an External Sender
This message came from outside your organization.
 


Hello Nicholas, and others

I was able to get the mvme3100 running with EPICS IOC on RTEMS 6 some time ago. I have a patchset to get the RTEMS libi2c properly initialized with mvme3100

Somehow, these patches fell through the cracks and didn't make it to RTEMS upstream.

I'm attaching the patches here. Could you please test them? I do not have access to a hardware to be able to test them. I have only checked that they apply cleanly on the current master. Please let me know if there are any issues with the patches.

Heinz, with these patches, you would not need to directly call _IO_All_drivers_initialized. The EPICS RTEMS application needs to have the following configure option added to the application code

#define CONFIGURE_APPLICATION_NEEDS_LIBI2C_DRIVER


If these patches fix the mvme3100 I2C issue, I am happy to open a merge request at upstream RTEMS and try to get it merged.

Thanks,

Vijay



On Thu, Oct 23, 2025 at 7:41 PM Heinz Junkes via Tech-talk <[email protected]> wrote:
Hello Marks,
We have been running the MVME3100 with the MVME3100 for quite some time now. But still with RTEMS5.

I applied the following kernel patch at the time, which solved a problem with the i2c driver.

rtems@rtems-dev:~/MVME3100$ cat kernel.patch
diff --git a/bsps/powerpc/mvme3100/start/bspstart.c b/bsps/powerpc/mvme3100/start/bspstart.c
index 0ec215e33b..96d6e2f9cd 100644
--- a/bsps/powerpc/mvme3100/start/bspstart.c
+++ b/bsps/powerpc/mvme3100/start/bspstart.c
@@ -52,6 +52,8 @@
 extern unsigned long __rtems_end[];
 extern unsigned      ppc_exc_lock_std, ppc_exc_gpr3_std;

+extern bool _IO_All_drivers_initialized;
+
 /*
  * Copy Additional boot param passed by boot loader
  */
@@ -419,7 +421,14 @@ void bsp_start( void )

 static void mvme3100_i2c_initialize(void)
 {
+  printk("-------- call BSP_i2c_initialize() with _IO_All_drivers_initialized = true\n");
+  /*
+   * we need the drivers registered as they appear, due to get
+   * the i2c devices ready
+   */
+  _IO_All_drivers_initialized = true;
   BSP_i2c_initialize();
+  _IO_All_drivers_initialized = false;
 }

 RTEMS_SYSINIT_ITEM(
diff --git a/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am b/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
index 48a61b9329..842cb92d67 100644
--- a/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
+++ b/c/src/lib/libbsp/powerpc/mvme3100/Makefile.am
@@ -43,8 +43,8 @@ librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/start/bspgetworka
 librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/start/zerobss.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/shared/start/sbrk.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/getentropy/getentropy-cpucounter.c
-librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspfatal-default.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/start/bspreset-empty.c
+librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/mvme3100/start/bspclean.c
 # tod
 librtemsbsp_a_SOURCES += ../../../../../../bsps/shared/dev/rtc/rtc-support.c
 librtemsbsp_a_SOURCES += ../../../../../../bsps/powerpc/mvme3100/rtc/todcfg.c
rtems@rtems-dev:~/MVME3100$


To what extent
has this now been incorporated into the official release?
I'll be happy to look into this when I get the chance.


HTH,
Heinz
------------------------------------------------------------------------------
Fritz-Haber-Institut  | Phone: (+49 30) 8413-4270
Heinz Junkes          | VC: https://zoom.fhi.berlin/junkes
Faradayweg 4-6        | Visitors: Hittorfstrasse 29 (Bld S (Slough House) )
D - 14195 Berlin 
------------------------------------------------------------------------------
“Sorry I’m a bit late, had a terrible time…
All sort of things cropping up at the last moment. Uh, how are we for time?”
—Zarquon's address to Milliways

> On 24. Oct 2025, at 00:12, Marks, Nicholas via Tech-talk <[email protected]> wrote:
>
> Hello,
>
> Has anyone succeeded recently in getting an IOC to run on RTEMS on the MVME3100?  I've been trying but haven't had much luck. I have built RTEMS 6.1 using the RTEMS source builder with the MVME3100 BSP and I have successfully run several of the provided test applications (https://github.com/RTEMS/rtems/tree/main/testsuites/samples). I also built EPICS base 7.0.9 for RTEMS-mvme3100, however any EPICS applications I create do not work. I believe the failure is during BSP initialization before the IOC code even enters the picture since if I remove everything from the IOC's main function except a single printf, the same crash is present, and no print. I've pasted the VME console output below this message.
> Note that the console hangs for several minutes after this line "ds1375_probe (open): No such file or directory" before printing the
> ""%s" is not a valid command pathname." message, which comes from either
> base/modules/libcom/RTEMS/score/rtems_init.c
> or
> base/modules/libcom/RTEMS/posix/rtems_init.c
>
> When running the RTEMS test programs that work, the "ds1375_probe..." line is not present.
> Any suggestions would be appreciated. Thank you.
>
> MVME3100> go -a4000000
> -----------------------------------------
> Welcome to rtems-6.1.0 (PowerPC/Generic (no FPU)/mvme3100)
> BSP: mvme3100, CVS Release ($Name$)
> CPU 0x8020 - rev 0x20
> Additionnal boot options are H
> Initial system stack at 465df0
> Going to start PCI buses scanning and initialization
> Board Type: MVME3100-1263 (S/N EFDD3B6)
> External (=PCI Bus) Clock Freq   :   66666666 Hz
> Core Complex Bus (CCB) Clock Freq:  333333330 Hz
> CPU Clock Freq:                     166666665 Hz
> Ethernet 0                  EC:9E:CD:19:41:FF
> Ethernet 1                  EC:9E:CD:19:42:00
> Ethernet 2                  EC:9E:CD:19:42:01
> Number of PCI buses found is : 3
> BUS:SLOT:FUN  VENDOR-DEV_ID: COMMAND STATUS BASE_ADDR0 BASE_ADDR1 IRQ_PIN ->
>   0:0x00:0    0x1057-0x0008:  0x0006 0x20b0 0x80000000 0x00000000       0 ->
>   0:0x11:0    0x10e3-0x0148:  0x0146 0x02b0 0x80100004 0x00000000       1 ->
>   0:0x12:0    0x10b5-0x6520:  0x0147 0x02b0 0x00000000 0x00000000       0 ->
>   0:0x13:0    0x10b5-0x6520:  0x0147 0x02b0 0x00000000 0x00000000       0 ->
>   0:0x14:0    0x1095-0x3124:  0x01c7 0x02b0 0x80400004 0x00000000       1 ->   2 (=0x0
>   2:0x00:0    0x1033-0x0035:  0x0146 0x0210 0x80300000 0x00000000       1 ->   4 (=0x0
>   2:0x00:1    0x1033-0x0035:  0x0146 0x0210 0x80301000 0x00000000       2 ->   5 (=0x0
> Memory:                             536870912 bytes
> Cleared PCI errors: pci_stat was 0x20b0
> OpenPIC Version 1.2 (1 CPUs and 56 IRQ sources) at 0x3775135744
> OpenPIC Vendor 0 (Unknown), Device 0 (Unknown), Stepping 0
> OpenPIC timer frequency is 41666666 Hz
> MSR is 0x00001000, TCR 0x04000000
> -----------------------------------------
> Exit from bspstart
> Tundra Tsi148 PCI-VME bridge detected at 0x80100000, IRQ 0
> Tsi148 Outbound Ports:
> Port  VME-Addr   Size       PCI-Adrs   Mode:
> 0:    0x20000000 0x0e000000 0xc0000000 A32, SUP, D32, SCT
> 1:    0x00000000 0x00ff0000 0xcf000000 A24, SUP, D32, SCT
> 2:    0x00000000 0x00010000 0xcfff0000 A16, SUP, D32, SCT
> 7:    0x00000000 0x01000000 0xce000000 CSR, SUP, D32, SCT
> Tsi148 Inbound Ports:
> Port  VME-Addr   Size       PCI-Adrs   Mode:
> 0:    0xc0000000 0x20000000 0x00000000 A32, PGM, DAT, SUP, USR, MBLT, BLT
> vmeTsi148 IRQ manager: looking for registers on VME...
> Trying to find CSR on VME...
> vmeTsi148 - IRQ manager using VME CSR to flush FIFO
> libi2c: Library not initialized
> Registering mpc8540 i2c bus driver :No such file or directory
> Registering /dev/console as minor 0 (==/dev/ttyS0)
> ds1375_probe (open): No such file or directory
> "%s" is not a valid command pathname.
>
> *** FATAL ***
> fatal source: 11 (RTEMS_FATAL_SOURCE_PANIC)
> fatal code: 3444772 (0x00349024)
> RTEMS version: 6.1.0.not-released
> RTEMS tools: 13.3.0 20240521 (RTEMS 6, RSB no-repo, Newlib 1b3dcfd)
> executing thread ID: 0x0b010001
>
>
>
> Copyright(C)2008-2013,Emerson Network Power-Embedded Computing,Inc.
> All Rights Reserved
> Copyright Motorola Inc. 1999-2007, All Rights Reserved
> MOTLoad RTOS Version 2.0,  PAL Version 1.2 RM04
> Wed Nov  6 17:17:43 MST 2013
>
> MPU-Type             =MPC8540
> MPU-Int Clock Speed  =833MHz
> MPU-CCB Clock Speed  =333MHz
> MPU-DDR Clock Speed  =166MHz
> MPU-PCI Clock Speed  =66MHz, PCI, 64-bit
> MPU-Int Cache(L2) Enabled, 256KB, L2CTL =A8000300
>
> Reset/Boot Vector    =Flash0
>
> Local Memory Found   =20000000 (&536870912)
> User Download Buffer =0159D000:0179CFFF
>
> MVME3100>



References:
Running EPICS on RTEMS/MVME3100 Marks, Nicholas via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Heinz Junkes via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Vijay Kumar Banerjee via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Marks, Nicholas via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Vijay Kumar Banerjee via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Marks, Nicholas via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Vijay Kumar Banerjee via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Marks, Nicholas via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Vijay Kumar Banerjee via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Johnson, Andrew N. via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Vijay Kumar Banerjee via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Joel Sherrill via Tech-talk
Re: Running EPICS on RTEMS/MVME3100 Vijay Kumar Banerjee via Tech-talk

Navigate by Date:
Prev: Re: Running EPICS on RTEMS/MVME3100 Vijay Kumar Banerjee via Tech-talk
Next: ADEiger complete script Graeme Winter 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  <20252026 
Navigate by Thread:
Prev: Re: Running EPICS on RTEMS/MVME3100 Vijay Kumar Banerjee via Tech-talk
Next: ADEiger complete script Graeme Winter 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  <20252026 
ANJ, 19 Mar 2026 · Home · News · About · Talk · Base · Modules · Extensions ·
· Distributions · Download · Documents · Links · Licensing ·