Open sticky-tea opened 2 years ago
Well, the solution is to execute core-cpu1 as root
Actually there is another problem. My build/exe/cpu2 folder looks like this
.
├── cf
│ ├── arducam.so
│ ├── cfe_es_startup.scr
│ ├── cfs_lib.so
│ ├── ci.so
│ ├── clyde_eps.so
│ ├── generic_reaction_wheel.so
│ ├── hk_cpy_tbl.tbl
│ ├── hk.so
│ ├── hs_amt.tbl
│ ├── hs_emt.tbl
│ ├── hs_mat.tbl
│ ├── hs.so
│ ├── hs_xct.tbl
│ ├── hwlib.so
│ ├── io_lib.so
│ ├── lc_def_adt.tbl
│ ├── lc_def_wdt.tbl
│ ├── lc.so
│ ├── novatel_oem615.so
│ ├── sample.so
│ ├── sch_def_msgtbl.tbl
│ ├── sch_def_schtbl.tbl
│ ├── sch.so
│ ├── sc.so
│ ├── to_config.tbl
│ └── to.so
└── core-cpu2
but core-cpu2 can't load libs:
EVS Port1 42/2/TO 2: Application initialized
1980-012-14:03:20.27358 ES Startup: Loading file: /cf/cs.so, APP: CS
1980-012-14:03:20.27368 ES Startup: Could not load cFE application file:/cf/cs.so. EC = 0xFFFFFFFF
1980-012-14:03:20.27528 ES Startup: Loading file: /cf/ds.so, APP: DS
1980-012-14:03:20.27538 ES Startup: Could not load cFE application file:/cf/ds.so. EC = 0xFFFFFFFF
1980-012-14:03:20.27698 ES Startup: Loading file: /cf/fm.so, APP: FM
1980-012-14:03:20.27705 ES Startup: Could not load cFE application file:/cf/fm.so. EC = 0xFFFFFFFF
1980-012-14:03:20.27867 ES Startup: Loading file: /cf/lc.so, APP: LC
...
1980-012-14:03:20.29084 ES Startup: Loading file: /cf/sample.so, APP: SAMPLE
1980-012-14:03:20.29128 ES Startup: Could not load cFE application file:/cf/sample.so. EC = 0xFFFFFFFF
1980-012-14:03:20.29289 ES Startup: Loading file: /cf/arducam.so, APP: CAM
1980-012-14:03:20.29328 ES Startup: Could not load cFE application file:/cf/arducam.so. EC = 0xFFFFFFFF
1980-012-14:03:20.29489 ES Startup: Loading file: /cf/clyde_eps.so, APP: EPS
1980-012-14:03:20.29524 ES Startup: Could not load cFE application file:/cf/clyde_eps.so. EC = 0xFFFFFFFF
1980-012-14:03:20.29685 ES Startup: Loading file: /cf/novatel_oem615.so, APP: NAV
1980-012-14:03:20.29727 ES Startup: Could not load cFE application file:/cf/novatel_oem615.so. EC = 0xFFFFFFFF
1980-012-14:03:20.29887 ES Startup: Loading file: /cf/generic_reaction_wheel.so, APP: RW
1980-012-14:03:20.29931 ES Startup: Could not load cFE application file:/cf/generic_reaction_wheel.so. EC = 0xFFFFFFFF
What is wrong?
Also there are some other errors:
1980-012-14:03:20.26948 ES Startup: CI loaded and created
EVS Port1 42/2/CI 7: IO_TransUDP Error: bind socket failed. errno:98
EVS Port1 42/2/CI 6: CI - Custom Init failed.
1980-012-14:03:20.26989 CI - Application failed to initialize
1980-012-14:03:20.26991 Application CI called CFE_ES_ExitApp
...
1980-012-14:03:21.25838 CFE_ES_GetTaskInfo: Task ID Not Valid: 7
1980-012-14:03:21.25847 CFE_ES_GetTaskInfo: Task ID Not Valid: 7
EVS Port1 42/2/CFE_ES 14: Exit Application CI on Error Completed.
Two comments I'd suggest:
Check the sample file native_osconfig.cmake
- this defines a couple options to make it easier to run CFS in a debug environment. You'll typically want to enable both of these when debugging. You can either just make an "arm-raspberrypi_osconfig.cmake" or you can simply change the options in your default_osconfig.cmake to make them always set. Also make sure OSAL_CONFIG_DEBUG_PRINTF is set to true somewhere in there, too.
It looks like the module loading is simply because the apps were not built for CPU2. Were they listed in targets.cmake?
As for the socket bind issue, you'll have to look up what errno 98 means (its system-specific).
Well, we defined OS_DEBUG_PRINTF and it shows that hwlib can't load because of undefined spi_unselect_chip, so we just delete all code with it. Idk why, but now it works Errno 98 is "Port in use", but where can I change the port in cFS configs?
I just hardcoded the port
int32 IO_TransUdpBindSocket(IO_TransUdp_t * udp)
{
if (udp == NULL)
{
CFE_EVS_SendEvent(IO_LIB_TRANS_UDP_EID,CFE_EVS_ERROR,
"IO_TransUDP Error: Null input argument. ");
return IO_TRANS_UDP_BAD_INPUT_ERROR;
}
udp->sockAddr.sin_port = 1337;
/* Bind socket to port */
if ((bind(udp->sockId, (struct sockaddr*)&udp->sockAddr,
sizeof(struct sockaddr)) < 0))
{
CFE_EVS_SendEvent(IO_LIB_TRANS_UDP_EID, CFE_EVS_ERROR,
"IO_TransUDP Error: bind socket failed. errno:%d, port:%d",
errno, udp->sockAddr.sin_port);
return IO_TRANS_UDP_SOCKETBIND_ERROR;
}
return IO_TRANS_UDP_NO_ERROR;
}
and it does not work, errno 98
Something worth considering -- just build natively. I understand that folks consider native compilation slow but the fact remains it's the easiest and least error prone. Further, we minimize the time cost by integrating our cFS build into our Azure Devops pipelines on a self-hosted RPi 3B+ agent. Much easier than futzing around with cross-compilations and we get the benefits of ci/cd, artifacts, etc.
I've been fighting this same problem for ages. I'm trying to run cFS on a Raspberry Pi Zero, so the build times are quite long. The problem isn't limited to cFS, Cross-compiling any shared object with arm-linux-gnueabi-gcc -o [libname] [source.c] -shared
seem to have this issue. This minimal example demonstrates the issue. The code fails with ./libshared.so: cannot open shared object file: No such file or directory
.
I've been fighting this same problem for ages. I'm trying to run cFS on a Raspberry Pi Zero, so the build times are quite long. The problem isn't limited to cFS, Cross-compiling any shared object with
arm-linux-gnueabi-gcc -o [libname] [source.c] -shared
seem to have this issue. This minimal example demonstrates the issue. The code fails with./libshared.so: cannot open shared object file: No such file or directory
.
Have you found any solution?
I'm trying to build cfs for Raspberry Pi using cross-compiler in Ubuntu 18.04. I installed gcc-arm-linux-gnueabihf and g++-arm-linux-gnueabihf, setup cmake toolchain file as follows:
And then:
There is core-cpu1 in build-raspberry/arm-raspberrypi/default_cpu1/cpu1. But on Raspberry it crashes with error:
What am I doing wrong?