Difference between revisions of "Debugging softMC Firmware Linux"

From SoftMC-Wiki
Jump to: navigation, search
m (Access to Linux shell)
(FWCONFIG)
 
(33 intermediate revisions by 3 users not shown)
Line 1: Line 1:
There are some situations where a controller is no longer accessible with terminal of ControlStudio.  
+
== Introduction ==
 +
In some situations, a controller is no longer accessible with terminal of ControlStudio. This occurs when the controller has encountered a serious problem and tasks are suspended or the network stack of the operating system is corrupted. For the core-development it is necessary to collect data when such a situation occurs to collect data and analyze the root-cause to be able to fix/correct it.
  
Mostly the controller has encountered a serious problem and some task(s) are suspended or the network stack of the operating system is corrupted.
+
This entry presents the controller file system and some useful commands for debugging.
For the core-development it is necessary to collect data when such a situation occurs to collect data and analyze the root-cause to be able to fix/correct it.
 
  
= Controller file system and useful commands =
+
== Access to Linux Shell ==
== Access to Linux shell ==
 
 
COM1 of softMC is reserved for Linux shell.
 
COM1 of softMC is reserved for Linux shell.
  
Shell is used for editing ofFWCONFIG, IO.DAT or solving of problems such as:<br />
+
Shell is used for editing [[FWCONFIG|FWCONFIG]] and IO.DAT or for solving problems such as:<br />
 
*softMC does not boot<br />
 
*softMC does not boot<br />
 
*softMC does not get IP address<br />
 
*softMC does not get IP address<br />
Line 21: Line 20:
 
Also possible to login with ssh or telnet: user '''mc''', password '''mc'''
 
Also possible to login with ssh or telnet: user '''mc''', password '''mc'''
  
== Location of files at softMC file system ==
+
== File Locations ==
  
'''''FWCONFIG<br />'''''
+
'''[[FWCONFIG|FWCONFIG]]'''<br>
 
/FFS0/<br />
 
/FFS0/<br />
'''''Programs and Libraries:<br />'''''
+
'''Programs and Libraries:<br />'''
/FFS0/<font color="red">SSMC/</font><br />
+
/FFS0/SSMC/<br />
'''''Linux Log files'''''<br />
+
'''Linux Log files'''<br />
 
/var/log/<br />
 
/var/log/<br />
'''''RAM disk'''''<br />
+
'''RAM disk'''<br />
 
/RAM/<br />
 
/RAM/<br />
  
 
{{Note|Access to FWCONFIG file is allowed only under ''PRIVILEGELEVEL{{=}}1''.}}
 
{{Note|Access to FWCONFIG file is allowed only under ''PRIVILEGELEVEL{{=}}1''.}}
  
== Useful commands ==
+
== Useful Commands ==
 
* /sbin/ifconfig - gives IP information
 
* /sbin/ifconfig - gives IP information
 
* '''vi''' - text editor
 
* '''vi''' - text editor
Line 44: Line 43:
 
* '''du''' - space used by directory/files. For example "du /FFS0/ -h" will show usage of softMC libraries and programs
 
* '''du''' - space used by directory/files. For example "du /FFS0/ -h" will show usage of softMC libraries and programs
  
== Application autostart ==
+
== Application Autostart ==
 +
No local I/O or dedicated DIP-switch for automatic start of application.
  
Unlike SERCOS version EtherCAT and CANOpen motion controllers do not have local I/O or dedicated DIP-switch for automatic start of application.
+
DIP-Switch is emulated. Firmware reads DIP-Switch value from file /FFS0/SSMC/IO.DAT<br/>
DIP-Switch is emulated. Firmware reads a "value" of DIP-Switch from file /FFS0/<font color="red">SSMC/</font>/IO.DAT
+
DIP=0x0<br/>
DIP=0x0
 
 
INP=0x00
 
INP=0x00
Bit #6 of "DIP-Switch" is responsible for autostart of application.
+
 
 +
Bit #6 of DIP-Switch is responsible for autostart of application.<br/>
 
IO.DAT is created automatically if it does not exist, values are zeros.
 
IO.DAT is created automatically if it does not exist, values are zeros.
 
* IO.DAT can be edited either via softMC user interface or directly from Linux shell: <br />
 
* IO.DAT can be edited either via softMC user interface or directly from Linux shell: <br />
vi /FFS0/<font color="red">SSMC/</font>/IO.DAT<br />
+
:: vi /FFS0/SSMC/IO.DAT<br />
 
* Simplest way to disable autostart would be deletion of IO.DAT<br />
 
* Simplest way to disable autostart would be deletion of IO.DAT<br />
rm /FFS0/<font color="red">SSMC/</font>/IO.DAT
+
:: rm /FFS0/SSMC/IO.DAT
  
 
== FWCONFIG ==
 
== FWCONFIG ==
FWCONFIG contains firmware initialization options<br />
+
See [[FWCONFIG | FWCONFIG]]
* Syntax:<br />
+
 
option value[{byte|kbyte|mbyte}]<br />
+
===== TCP/IP keepalive timeouts =====
* Supported options<br />
+
Refer to:
'''libstacksize''' - library stack size<br />
+
*'''[[Socket_keep-alive_timeouts|Socket_keep-alive_timeouts]]'''
'''taskstacksize''' - default task stack size<br />
 
'''sysdatarecfilename''' - system data recorder file name<br />
 
'''sysdatareclen''' - system data recorder length (number of records)<br />
 
'''ipaddressmask''' - sets ip address and mask for motion controller. <br />
 
'''sleep''' - delay in mSecs<br />
 
'''stringpreload''' - initial size of BASIC strings. Default is "0" - strings are created empty.<br />
 
'''stringblockpreload''' - initial size of string descriptors. Default is 300,000. Reduce this value if application has less than 300,000 string variables.<br />
 
'''translatormempartsize''' - initial size for translator memory partition<br />
 
'''passbuffersize''' - ????<br />
 
'''hpetfreq'''...<br />
 
<br />
 
''Examples'':<br />
 
'''ipaddressmask''' 192.168.20.20:255.255.0.0 <br />
 
'''sleep''' 20 <br />
 
'''libstacksize''' 20kbyte<br />
 
'''hpetfreq''' 2000 for cycle time 500 microsecond  or '''hpetfreq''' 1000 for cycle time up to 1 millisecond <br />
 
  
 
== Troubleshooting a Software Crash ==
 
== Troubleshooting a Software Crash ==
Line 88: Line 72:
 
User name and password are given at the top of this page.
 
User name and password are given at the top of this page.
  
[[Category:Axystems:MCHD Firmware]]
+
<!-- [[Category:MCHD Firmware]] -->

Latest revision as of 10:05, 26 October 2017

Introduction

In some situations, a controller is no longer accessible with terminal of ControlStudio. This occurs when the controller has encountered a serious problem and tasks are suspended or the network stack of the operating system is corrupted. For the core-development it is necessary to collect data when such a situation occurs to collect data and analyze the root-cause to be able to fix/correct it.

This entry presents the controller file system and some useful commands for debugging.

Access to Linux Shell

COM1 of softMC is reserved for Linux shell.

Shell is used for editing FWCONFIG and IO.DAT or for solving problems such as:

  • softMC does not boot
  • softMC does not get IP address
  • File system has overflow of log files or core dumps that need to be deleted manually.
  • Autostart (CONFIG.PRG or AUTOEXEC.PRG) makes softMC unresponsive


Important: COM1 should not be used by applications

The shell has input and output by default on COM1.
Automatic login: user name mc, password mc
Also possible to login with ssh or telnet: user mc, password mc

File Locations

FWCONFIG
/FFS0/
Programs and Libraries:
/FFS0/SSMC/
Linux Log files
/var/log/
RAM disk
/RAM/

NOTE-Info.svgNOTE
Access to FWCONFIG file is allowed only under PRIVILEGELEVEL=1.

Useful Commands

  • /sbin/ifconfig - gives IP information
  • vi - text editor
  • cp - copy files
  • rm - delete files
  • ls - list directory
  • threads - lists linux threads
  • df - free space on disk. For example "df /FFS0/ -h" will show free space on the flash disk
  • du - space used by directory/files. For example "du /FFS0/ -h" will show usage of softMC libraries and programs

Application Autostart

No local I/O or dedicated DIP-switch for automatic start of application.

DIP-Switch is emulated. Firmware reads DIP-Switch value from file /FFS0/SSMC/IO.DAT
DIP=0x0
INP=0x00

Bit #6 of DIP-Switch is responsible for autostart of application.
IO.DAT is created automatically if it does not exist, values are zeros.

  • IO.DAT can be edited either via softMC user interface or directly from Linux shell:
vi /FFS0/SSMC/IO.DAT
  • Simplest way to disable autostart would be deletion of IO.DAT
rm /FFS0/SSMC/IO.DAT

FWCONFIG

See FWCONFIG

TCP/IP keepalive timeouts

Refer to:

Troubleshooting a Software Crash

In case of software crash operating system creates complete snapshot of crashed process. Firmware saves snapshots to directory /cores.
These snapshots (or "core" files) contain important information and may help to improve software quality. It is recommended to check contents of /cores upload files to support@servotronix.com and erase contents of /cores.

softMC can be accessed with any SFTP software, such as WinSCP or Bitvise SSH client.
User name and password are given at the top of this page.