Trying to adapt the MN zynq hybrid ( kernel oplk runs in Microblaze and the user oplk runs in Linux in Arm) design to work as a CN Hybrid design, I followed these steps:
1- Nothing changed in the hardware
2- In order to compile the kernel libraries: remove the module NMT and disable the high resolution timer (CONFIG_TIMER_USE_HIGHRES) add the HARDWARE_DRIVER_OPENMAC_CN_SOURCES and configure the cmake file to compile and generate the libraries necessary for the CN kernel side
3- Nothing changed to build the driver application in the microblaze using the CN kernel libraries: same daemon application and configuration files.
4- In order to compile the user libraries: remove the NMT and CFG modules configure the cmake file to compile and generate the libraries necessary for the CN user side
5- Generate the binary with CFG_BUILD_KERNEL_STACK to Kernel stack on Zynq PCP.
6- Remove the modules NMT and CFM (CONFIG_INCLUDE_NMT_MN, CONFIG_INCLUDE_CFM) to generate the driver drv_kernelmod_zynq to communicate with the shared memory.
Everything is successfully compiled and generated. After running the binary cn, I had the following problem:
Failed to get address for index 6
--pMemBase == NULL--
circbuf_connectBuffer() Memory Not available error 1!
PLK : Could not allocate CIRCBUF_DLLCAL_TXSYNC circbuffer
Dll queues initialization failed (0x8)
Stack interface initialization to PCP Failed (0x8)
-- Pbm in drvintf_executeCmd--
ioctl failed and returned errno Bad address
ctrlucal_executeCmd() ioctl error -1
oplk_create() failed with "General error" (0x000d)
2016/06/09-16:35:11 FATAL CONTROL oplk_create() failed with "General error" (0x000d)
Stack is in state off ... Shutdown
2016/06/09-16:35:11 INFO CPLK: + plkIntfIoctl() (cmd=0 type=61)...
ONTROL Stack is in state off ... Shutdown openPOWERLINK
eventu_postEvent() Eventu module is not initialized
nmtcnu_exit(): 0x8
PLK: + plkIntfRelease()...
PLK: + plkIntfRelease() - OK
The driver fails to allocate the CIRCBUF_DLLCAL_TXSYNC circbuffer in the shared memory. I think that the daemon in microblaze is not generating the correct dynamic mapping table in the shared memory.
If I add the NMT module only in the kernel side configuration, the problem is resolved. The stack is initialized and running but the CN running in hybrid zynq is not getting the pdo value from MN running in Computer and always sends 0 in PRES. There is a preivous topic here
When implementing the CN, I think we do not have to add the NMT module and the the high resolution timer.
Actually, I am trying to understand the role of this buffer CIRCBUF_DLLCAL_TXSYNC ? because when i just ignore circbuf_connectBuffer function which detects the address of the this buffer. the stack is "inititialized" and "running". We can observe the packets Powerlink in Wireshark but with the same previous problem: CN is not getting the value of PDO from the MN.
Now to understand the source of the problem: why is the application in Microblaze not allocating the memory for the CIRCBUF_DLLCAL_TXSYNC ? in Which level is there some misconfiguration ( kernel libraries, daemon in MB, user libraries, demo_cn_console, driver zynq_linux)
Any information regarding this matter would be helpful and thank you.
Regards,
Hassen
Last edit: Hassen G 2018-06-07
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hello,
Trying to adapt the MN zynq hybrid ( kernel oplk runs in Microblaze and the user oplk runs in Linux in Arm) design to work as a CN Hybrid design, I followed these steps:
1- Nothing changed in the hardware
2- In order to compile the kernel libraries:
remove the module NMT and disable the high resolution timer (CONFIG_TIMER_USE_HIGHRES)
add the HARDWARE_DRIVER_OPENMAC_CN_SOURCES and configure the cmake file to compile and generate the libraries necessary for the CN kernel side
3- Nothing changed to build the driver application in the microblaze using the CN kernel libraries: same daemon application and configuration files.
4- In order to compile the user libraries:
remove the NMT and CFG modules
configure the cmake file to compile and generate the libraries necessary for the CN user side
5- Generate the binary with CFG_BUILD_KERNEL_STACK to Kernel stack on Zynq PCP.
6- Remove the modules NMT and CFM (CONFIG_INCLUDE_NMT_MN, CONFIG_INCLUDE_CFM) to generate the driver drv_kernelmod_zynq to communicate with the shared memory.
Everything is successfully compiled and generated. After running the binary cn, I had the following problem:
The driver fails to allocate the CIRCBUF_DLLCAL_TXSYNC circbuffer in the shared memory. I think that the daemon in microblaze is not generating the correct dynamic mapping table in the shared memory.
If I add the NMT module only in the kernel side configuration, the problem is resolved. The stack is initialized and running but the CN running in hybrid zynq is not getting the pdo value from MN running in Computer and always sends 0 in PRES. There is a preivous topic here
When implementing the CN, I think we do not have to add the NMT module and the the high resolution timer.
Actually, I am trying to understand the role of this buffer CIRCBUF_DLLCAL_TXSYNC ? because when i just ignore circbuf_connectBuffer function which detects the address of the this buffer. the stack is "inititialized" and "running". We can observe the packets Powerlink in Wireshark but with the same previous problem: CN is not getting the value of PDO from the MN.
Now to understand the source of the problem: why is the application in Microblaze not allocating the memory for the CIRCBUF_DLLCAL_TXSYNC ? in Which level is there some misconfiguration ( kernel libraries, daemon in MB, user libraries, demo_cn_console, driver zynq_linux)
Any information regarding this matter would be helpful and thank you.
Regards,
Hassen
Last edit: Hassen G 2018-06-07
Hi Hassen,
The Zynq hybrid MN can act as CN if the node ID is set as required. (Other than the MN's Node ID).
Thanks,
Powerlink-Team-Kalycito
Hi Hassen,
We are currently working on implementing Zynq Hybrid as CN. Kindly refer to the Github issue #345 for updates on the same.
Thanks,
Powerlink-Team-Kalycito