.. rst-class:: break_before Processing System ================= The processing system (PS) is the part of the Zynq SoC that contains the ARM cores and other peripherals. In XiBIF, the PS handles the communication with the programmable logic (PL) and the host computer. The PL is connected to the PS through a set of AXI interfaces, while the host computer communicates via Ethernet. Normally, there is no reason to modify the software running on the PS. However, XiBIF has foreseen three entry points that can be used to add custom functionality to the PS. .. warning:: You may modify the software running on the PS if needed. However, keep in mind that any changes will be overwritten during a XiBIF upgrade. Bootup Code ----------- There are some cases where it is required to run some custom code during startup of the PS. For example, if you want to enable the voltage of the FMC connector on the ZCU104 board. For this, XiBIF provides the weak function ``XiBIF_startUp()``. This function is called before XiBIF is initialized. You can override this function in your own code and add the required functionality. By default, this function does nothing. The function declaration is as follows: .. code-block:: c void XiBIF_startUp() __attribute__((weak)); .. warning:: Create a new file to overwrite this function. Do not modify any of the files generated by XiBIF. Otherwise, your changes will be lost during the next upgrade of XiBIF. IP-Address Change ----------------- Another case where you may want to add custom code is when the IP address of the PS changes. This can, for example, be used to show the current IP address on the OLED display of the Zedboard. To do this, XiBIF provides the weak function ``XiBIF_printIpSettings()``. This function is called whenever the IP address of the PS changes. You can override this function in your own code and add the required functionality. By default, this function writes the IP address to the console. The function declaration is as follows: .. code-block:: c void XiBIF_printIpSettings(ip_addr_t* ip, ip_addr_t* mask, ip_addr_t* gw) __attribute__((weak)); .. warning:: Create a new file to overwrite this function. Do not modify any of the files generated by XiBIF. Otherwise, your changes will be lost during the next upgrade of XiBIF. Own Command Handler ------------------- In some cases, you may want to add your own command handler to the PS. This can be used to implement custom commands that are not part of the standard XiBIF command set. To do this, XiBIF provides the weak function ``XiBIF_ownCommandHandler()``. This function is called whenever a command with an unknown command code is received by the PS. You can override this function in your own code and add the required functionality. By default, this function does nothing. The function declaration is as follows: .. code-block:: c XiBIF_error_t XiBIF_ownCommandHandler(u32 cmd, int sd) __attribute__((weak)); The received command code is passed as the first argument, and the socket descriptor of the connection is passed as the second argument. You can use this function to implement your own command handling logic. The socket descriptor can be used to send a response back to the host computer or receive additional data from the host. In case the connection is closed, the function should return an error code. If the command is handled successfully, the function should return ``XIBIF_NO_ERROR``. .. warning:: Create a new file to overwrite this function. Do not modify any of the files generated by XiBIF. Otherwise, your changes will be lost during the next upgrade of XiBIF.