WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: [Solved] TC3.8_4 Real Time Upgrade  (Read 70958 times)

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #285 on: July 21, 2021, 09:44:50 PM »
Hi Rich,

Sorry, Peter defined data directory was "/home/data" in setup.c, changed to "'home/tc/data".

David

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #286 on: July 21, 2021, 09:46:12 PM »
Wow, must be bedtime, "/home/data" changed to "/home/tc/data", sorry.

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: TC3.8_4 Real Time Upgrade
« Reply #287 on: July 21, 2021, 09:48:40 PM »
Hi MTCAT
All I can do is make some observations:
Quote
block_index start_read  end_read
 146 21:19:11.845  21:19:11.860
 145 21:19:11.743  21:19:11.845
 144 21:19:11.640  21:19:11.743
 -----Snip-----
The difference between start and end times is 102 to 103 milliseconds for blocks 137 to 145.
For block 146 the difference dropped to 15 milliseconds.

Quote
mt_adc halted - exit code = -2
The -2 exit code is the error code returned by:
Code: [Select]
read_status = read_adc(&ring_buffer[block_index * BLKSIZE], bufsize, error_msg);
Quote
ERROR: read() failure, errno = 110
That's a timeout error. Probably occurring in  read_adc().

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: TC3.8_4 Real Time Upgrade
« Reply #288 on: July 21, 2021, 09:59:59 PM »
Hi MTCAT
... There's a strange script file (attached here), looks pretty odd to me, maybe glade is not getting setup properly ...
The script appears to create a header file containing program version and compilation date for display by the GUI.

This comment suggests the script gets run by a make file when the program gets compiled:
Quote
ui.h - created by makefile from *.glade file

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #289 on: August 08, 2021, 05:58:52 PM »
Hi Rich,

I've been reading up on GLADE and GTK+ and have unfortunately not really gotten anywhere. I tried today to re-compile the MT_logger program with safer compile options, previously I was compiling with all sorts of Pentium specific compiler options, Peter had CFLAGS= -Wall -march=pentium3 -O3 -ffast-math -mmmx -msse -malign-double $(shell pkg-config --cflags gtk+2.0), but he also had a "safer" CFLAGS line defined as "CFLAGS= -Wall -g -march=native -O2 -malign-double -mfpmath=sse $(shell pkg-config --cflags gtk+2.0).

But unfortunately, even when compiling with the "safe" compiler options I still ended up with a hung up GUI....

I did try typing "pkg-config --cflags gtk+2.0" in the MT_logger build directory and got the following error;
Package gtk+2.0 was not found in the pkg-config search path.
Perhaps you should add the directory containing `gtk+2.0.pc'
to the PKG_CONFIG_PATH environment variable
No package gtk+2.0 found

Maybe this is the reason for the problem ??, but strange that I don't get any errors when running "./make" ?

Thanks,

David
 

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #290 on: August 08, 2021, 06:06:25 PM »
Hi Rich,

Sorry, forgot the ending quotes on the "safe" compile option line, should be "CFLAGS= -Wall -g -march=native -O2 -malign-double -mfpmath=sse $(shell pkg-config --cflags gtk+2.0)".

Also, the command to compile the MT_logger code is just "make" (typed in the build directory, /home/tc/newest_mt_loggerv1), this is also the directory where I tried to manually execute the pkg-config command. First I type "make clean" (removes old compiled version from /home/tc/.local/bin) and then "make" to compile, followed by "make install" (to copy executable to /home/tc/.local/bin).

Thanks,

David

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #291 on: August 08, 2021, 06:31:04 PM »
Hi Rich,

I just looked in /mnt/sdb1/tce/onboot.lst, I've installed "gtk2-dev.tcz", maybe I should have installed "gtk2.tcz" ?

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: TC3.8_4 Real Time Upgrade
« Reply #292 on: August 08, 2021, 08:45:09 PM »
Hi MTCAT
... Package gtk+2.0 was not found in the pkg-config search path. ...
Try changing  gtk+2.0  to  gtk+-2.0.

I just looked in /mnt/sdb1/tce/onboot.lst, I've installed "gtk2-dev.tcz", maybe I should have installed "gtk2.tcz" ?
No.  When you load  gtk2-dev.tcz  it loads  gtk2.tcz  automatically because its a dependency of  gtk2-dev.tcz.

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #293 on: August 10, 2021, 08:34:28 AM »
Hi Rich,

I'm sorry, inside the Makefile the command already is gtk+-2.0, I mistyped it when trying to run it manually, I need new glasses I guess, running the proper command at the terminal seems to work fine...darn-it, I don't know what else to try except maybe put the equivalent of "print *, a", etc., throughout the 40 or so individual C++ programs to try to see where the program is hanging up ? Or maybe try gdb ?, the "safe" compile CLFAGS line has the "-g" option which is used to generate debugging info for gdb I think ?

Thanks,

David
 

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: TC3.8_4 Real Time Upgrade
« Reply #294 on: August 10, 2021, 09:50:15 AM »
Hi MTCAT
... Maybe this is the reason for the problem ??, but strange that I don't get any errors when running "./make" ?
Another typo?
That  ./  would tell the operating system the  make  command is in the current directory, it is not. It's in  /usr/local/bin/.
The  make  command looks in the current directory for a file called  makefile  or  Makefile  in that order.

You could try  make -d  on the off chance the debugging information  make  prints out is useful.

Did you execute  MT_logger  by itself from the command line to see if it prints any warnings/errors?
Does the previously compiled version of  MT_logger  that you had run?

What happens if you replace  -march=native  with  -march=i486 -mtune=i686  in the  "safe"  version?

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #295 on: August 12, 2021, 06:43:02 AM »
Hi Rich,

I replaced -march=native with -march=i486 -mtune=i686 and I then got a bunch of warnings saying SSE instructions were being disabled for 387 arithmetics, but when running this version, still got a hung up GUI. Then I removed the -mfpmath=sse line as well and recompiled, that got rid of the SSE warnings, but still no luck with the GUI.

Thanks,

David

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #296 on: August 12, 2021, 07:08:53 AM »
Hi Rich,

I also tried typing out the commands in start_logger_TC.sh and I didn't see any errors come back, but the program behaviour was different, when running the script, three terminal windows get opened, and they stay open, but when I typed the commands out manually, terminal windows just popped up briefly and then disappeared. I guess I'll try gdb next...? I also tried running all commands in the start_logger_TC.sh as root by adding a sudo to the second and third commands in the script, but that didn't help, the first command in the start_logger_TC.sh script has a sudo in there, but that didn't help either.

Thanks,

David

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #297 on: August 12, 2021, 07:47:24 AM »
Hi Rich,

Last thing i tried this morning was to comment out the last line in start_logger_TC.sh so that when I execute the script (./start_logger_TC.sh) it only starts mt_adc and opens the adc log file. Then, in another window, I typed "gdb mt_logger", followed by "break main", and then typed "next" over and over until something happened.
Inside "main.c" there's a function (subroutine ?) called gtk_init(  ), the code hangs up inside gtk_init. As I type "next" repeatedly inside gdb, I saw a bunch of commands coming out of "lib/libc.s06" and then as I kept going, I started to see commands coming out of "lib/ld-linux.s0.2 and eventually saw a segmentation fault as below.

0xb77a0371 in _dl_debug_state () from lib/ld-linux.s0.2
(gdb) next
Single stepping until exit from function _dl_debug_state,
which has no line number information.

Program received signal SIGSEGV, Segmentation Fault.
0x00000003 in ?? ()

Also, in gdb, at the top of the window, it indicates "multi-thre Thread 0xb69ea In:   Line: ??  PC: 0x3

Could there be an issue of some sort with the dual core Vortex as well maybe ? The original application was a on a single core Pentium....

Hopefully there's something in there that jumps out at you, I also attached main.c here.

Thanks,

David

Offline MTCAT

  • Sr. Member
  • ****
  • Posts: 370
Re: TC3.8_4 Real Time Upgrade
« Reply #298 on: August 12, 2021, 07:54:55 AM »
Hi Rich,

By the way, I'm not sure, I wonder if one of the inputs (argv) to gtk_init is junk (not being assigned), this is what I see at the very start of running gdb,

Starting program: /home/tc/newest_mt_loggerv1/mt_logger
[Thread debugging using libthread_db enabled]
Breakpoint 1, main (argc=1, argv=0xbf9c7d14) at main.c:19
(gdb)

Thanks,

David

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11639
Re: TC3.8_4 Real Time Upgrade
« Reply #299 on: August 12, 2021, 01:24:03 PM »
Hi MTCAT
... Breakpoint 1, main (argc=1, argv=0xbf9c7d14) at main.c:19
argc tells you the total number of arguments that make up that command.
argv is an array of strings, each one containing one of the arguments that make up that command.
In this instance, argv contains one string (argv[0]) that if printed would display:
Code: [Select]
/home/tc/newest_mt_loggerv1/mt_logger
... I typed "gdb mt_logger", followed by "break main", and then typed "next" over and over ...
Code: [Select]
gdb mt_logger
run
When it segfaults, you can get a stack trace like this:
Code: [Select]
bt
You said  start_logger_TC.sh  starts 3 programs. Are you sure the other 2 are working? What happens if either of
those 2 are not functioning correctly?