updated readme for flatsat debugging

This commit is contained in:
Jakob Meier 2020-11-15 10:53:23 +01:00
parent d56d10b75d
commit e25fd2f9b9
4 changed files with 95 additions and 6 deletions

View File

@ -8,8 +8,9 @@
* 766 MHz
* Artix-7 FPGA (85K pogrammable logic cells)
* Datasheet at https://eive-cloud.irs.uni-stuttgart.de/index.php/apps/files/?dir=/EIVE_IRS/Arbeitsdaten/08_Used%20Components/Q7S&fileid=340648
* Also a lot of informatin about the Q7S can be found on the xiphos trac platform: https://trac.xiphos.com/trac/eive-q7/wiki/Q7RevB
* Linux OS
* Build with Yocto 2.5
* Built with Yocto 2.5
* Linux Kernel https://github.com/XiphosSystemsCorp/linux-xlnx.git
@ -49,14 +50,14 @@ git submodule update
* When on Linux right click project → Properties → C/C++ Build → Set build command to make -j
* -j causes the compiler to use all available cores
* On windows create a make target (Windows → Show View → Make Target)
* Right click eive_obsw → New →
* Right click eive_obsw → New
* Target name: all
* Uncheck "Same as the target name"
* Uncheck "Use builder settings"
* As build command type: <path to make>\make -j all WINDOWS=1
7. Run build command (double click the generated target)
### Debugging the software
### Debugging the software (when workstation is directly conncected to Q7S)
1. Assign static IP address to Q7S
* Open serial console of Q7S (Accessible via the micro-USB of the PIM, see also Q7S user maunal chapter 10.3)
* Baudrate 115200
@ -66,7 +67,7 @@ git submodule update
* Set IP address and netmask with
````
ifconfig eth0 192.168.133.10
ifconfig eth0 255.255.255.0
ifconfig eth0 netmask 255.255.255.0
````
2. Connect Q7S to workstation via ethernet
3. Make sure the netmask of the ehternet interface of the workstation matches the netmask of the Q7S
@ -105,6 +106,93 @@ git submodule update
* Local File Path: Path to eiveobsw-linux.elf (in _bin\linux\devel)
* Remote File Path: /tmp/eive_obsw.elf
### Debugging the software via Flatsat PC
Open SSH connection to flatsat PC:
````
ssh eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5
````
To access the console of the Q7S run the following:
````
sudo picocom -b 115200 /dev/ttyUSB0
````
To debug an application, first make sure a static IP address is assigned to the Q7S. Run ifconfig on the Q7S serial console.
````
ifconfig
````
Set IP address and netmask with
````
ifconfig eth0 192.168.133.10
ifconfig eth0 netmask 255.255.255.0
````
To launch application from Xilinx SDK setup port fowarding on the localhost.
````
ssh -L 1534:192.168.133.10:1534 eive@2001:7c0:2018:1099:babe:0:e1fe:f1a5
````
This forwards any requests to localhost:1534 to the port 1534 of the Q7S with the IP address 192.168.133.10.
Note: When now setting up a debug session in the Xilinx SDK, the host must be set to localhost instead of the IP address
of the Q7S.
### Launching an application after boot
Load the root partiton from the flash memory (there are to nor-flash memories and each flash holds two xdi images).
Note: It is not possible to modify the current loaded root partition.
1. Disable write protection of the desired root partition
````
writeprotect 0 0 0 # unlocks nominal image on nor-flash 0
````
2. Mount the root partition
````
xsc_mount_copy 0 0 # Mounts the nominal image from nor-flash 0
````
3. Copy the executable to /bin/usr
4. Make sure the permissions to execute the application are set
````
chmod +x application
````
5. Create systemd service in /lib/systemd/system. The following shows an example service.
````
cat > example.service
[Unit]
Description=Example Service
StartLimitIntervalSec=0
[Service]
Type=simple
Restart=always
RestartSec=1
User=root
ExecStart=/usr/bin/application
[Install]
WantedBy=multi-user.target
````
6. Enable the service. This is normally done with systemctl enable. However, this is not possible when the service is
created for a mounted root partition. Therefore create a symlink as follows.
````
ln -s '/tmp/the-mounted-xdi-image/lib/systemd/system/example.service' '/tmp/the-mounted-xdi-image/etc/systemd/system/multi-user.target.wants/example.service'
````
7. The modified root partition is written back when the partion is locked again.
````
writeprotect 0 0 1
````
8. Now verify the application start by booting from the modified image
````
xsc_boot_copy 0 0
````
9. After booting verify if the service is running
````
systemctl status example
````
More detailed information about the used q7s commands can be found in the Q7S user manual.
### Update file in rootfs
````
writeprotect 0 0 0 # qspi0 nom unlock (see also Q7S user manual)
````
### Setting up UNIX environment for real-time functionalities
Please note that on most UNIX environments (e.g. Ubuntu), the real time functionalities
used by the UNIX pthread module are restricted, which will lead to permission errors when creating these tasks

2
fsfw

@ -1 +1 @@
Subproject commit edecb7882b1d2bc444da17dec94a1a03501f1164
Subproject commit 113397c6c6ae4c46341f4880710e4e4d9b6e7630

View File

@ -103,6 +103,7 @@ void ObjectFactory::produce(){
new TmTcUnixUdpBridge(objects::UDP_BRIDGE,
objects::CCSDS_PACKET_DISTRIBUTOR,
objects::TM_STORE, objects::TC_STORE);
new TcUnixUdpPollingTask(objects::UDP_POLLING_TASK, objects::UDP_BRIDGE);
/* PUS stack */

2
tmtc

@ -1 +1 @@
Subproject commit ee295fa849ec7af33204f437d60742d173ac5c4b
Subproject commit 3fc71f9094e8fb670942f0c29a9dea0b6e03d17f