Workshop Exercises - Böblingen

Hands on Session netX 90 Workshop - Profinet Exercises


Please follow the instructions below step by step to complete the practical part of the netX 90 Workshop.

Start by completing the hardware setup of the netX Studio project attached at the end of this document. From there, we will move on to complete the implementation of a netX 90 Profinet example Application.


  • Hardware Configuration

        Adjust the default hardware configuration and tag list of the firmware in order to use the netX 90 SHARED UART and a virtual COM port on the PC to output debug information from the application.

  1. Disable the UART Diagnostic Interface in the LFW/X090D000.nxi with the Taglist Editor (double click X090D000.nxi)
    1. disable the "Enable ()" check box in the tag "UART Diagnostic Interface". This frees the UART interface for usage on the netX 90 APP side.
    2. save the file LFW/X090D000.nxi

  2. assign the UART to the netX 90 APP side by configuration of firewall settings in the hardware configuration file hardware_config_idpm.xml
    1. double click /HWC/netx90/hardware_config_idpm_flash_sdram.xml
    2. open the General Configuration Dialog (right bottom corner of the HW Editor window)
    3. set UART firewall: APP has read/write access, COM has now access (by default, the COM has read/write access)
    4. save the file hardware_config_idpm.xml


       Generate the hardware configuration files


  1. right click /HWC/netX90/hardware_config_idpm.xml
  2. choose context menue entry "Build Hardware Configuration"
  3. specify location for the *.hwc and the *.mwc file


      Setup the netX 90 COM side flash memory


      Use the menue item Tools→Flasher

  1. erase internal flash INTFLASH0 and INTFLASH1 (resp. INTFLASH01)
  2. program the hardware config file *.hwc into INTFLASH0
  3. program the maintenance firmware hardware config file *.mwc into INTFLASH1
  4. program the FDL use case A file FDL/FDL_NXHX90-JTAG_7833000r3_20000_ProductionTemplate_UseCaseA into INTFLASH0
  5. program the maintenance firmware MFW/MFW_netX90_flash.mxf into INTFLASH1
  6. program the loadable firmware LFW/X090D000.nxi into INTFLASH0


    notes: after these steps, you could create a flash dump by reading out the complete INTFLASH01

    this readout flash image can be programmed into the flash in one single step if required





  •   netX 90 application

    note: to find the exercises in the project → keyboard shortcut CTRL+H for a “file search” – search the string “Exercise” in *.c files
  1. Exercise 1 – identify the firmware pre stack config:

    1. Before going to stack configuration, we would like to identify the firmware (LFW / Protocol stack) in communication channel 0

    2. The system packet service “HIL_FIRMWARE_IDENTIFY_REQ” can be used for this purpose.

    3. As the very first DPM mailbox packet, we send the HIL_FIRMWARE_IDENTIFY_REQ packet

    4. The packet is assembled in the function App_SysPkt_AssembleFirmwareIdentifyReq()

    5. Please complete the implementation of App_SysPkt_AssembleFirmwareIdentifyReq().

    notes:

             The application data structure APP_DATA_T ptAppData contains a mailbox packet object “tPacket”.
              You have access to this mailbox packet over the pointer “ptAppData→aptChannels[index]→tPacket”, This object is used here to hold the mailbox packet.

  2. Exercise 2 – Communication channels:

    1. after the protocol stack configuration packet was successfully sent to the netX, and the corresponding confirmation packet was received, the communication channel must be INITIALIZED to activate the new stack configuration.
    2. this can be achieved by sending a specific DPM packet.
    3. please refer to the manual “netX Dual-Port Memory packet-based services netX 90 4000 4100 API” and search for “HIL_CHANNEL_INIT_REQ” for a description.
    4. The project comes with a helper function “App_SysPkt_AssembleChannelInitReq()” which can be used to fill the content with the respective DPM mailbox packet data structure. complete the implementation of this function.
    5. In a second step, this prepared mailbox packet must be sent, e.g., by using the helper function “Pkt_SendReceivePacket()”.

    notes:

             alternatively, instead of sending a packet, the channel can be initialized by using a cifX API function.
              You have access to this mailbox packet over the pointer "ptAppData→aptChannels[index]→tPacket", This object is used here to hold the mailbox packet.

  3. Exercise 3 – Communication channels

    1. after the cifX driver was initialized, we need to open the communication channels so we can send and receive data packets.
    2. please refer to the cifX API documentation, section “Channel-specific Functions → xChannelOpen”.
    3. to complete this exercise, please finish the implementation of the "App_AllChannels_Open" function

    notes:
               The application data structure APP_DATA_T ptAppData contains the required channel definitions in ptAppData->aptChannels[channel index],
                and the channel configuration is in the substructure ptAppData->aptChannels[index]→tProtocol.pfStartChannelConfiguration.
                the handle to the channel functions is accessible through &ptAppData→aptChannels[index]→hChannel.

  4. Exercise 4 – Packet Handling:

    1. now that the bus is running, we need to manage incoming packets on all open channels.
    2. This can be achieved by calling the “pfPacketHandler” function inside the protocol stack of the corresponding channel and passing the current application data structure as a paramtere.
    3. To complete this exercise, please finish the implementation of the function "App_AllChannels_PacketHandler".

    note:
             Inspect the application data structure to determine the location of the functions you need to call. please, hover the cursor over the structure tag and press ctrl/strg + press on the struct.

  5. Exercise 5 –Cyclic IO data Read/Write:

    1. One way to acquire IO data is through cyclic cifX API function calls.
    2. this is made available through the two function xChannelIORead and xChannelIOWrite.
    3. Plase refer to the cifX API manual section Channel-specific Functions to complete this exercise.

    note:
             Inspect the application data structure as it holds the references to tInputData and tOutputData.

  6. Exercise 6 – Cyclic ARM Timer:

    1. the ARM timer is used to generate a cyclic interrupt for  the cyclic call of the IO data handler "App_IODataHandler()".
    2. complete the configuration structure by adding the preload value for a 1msec cylce time.

      note:
               you can use DRV_TIM_PRELOAD_VALUE_ constants in netx_drv_tim.h, check also other source code parts inside netX_hostAbstractionLayer.c
               related to the timer driver
Resources

  File Modified

ZIP Archive netXStudio-PNS-Exercises.zip

2022-03-29 by Former user

ZIP Archive netXStudio-PNS-Solution.zip

2022-03-30 by Former user