zoukankan      html  css  js  c++  java
  • Xilinx驱动API的一个重要BUG,ZEDBOARD,ZYNQ7000

    An Important ANNOUNCEMENT at zynq-7000 driver api

    This is really a significant notify you never know!!!

    Once you make a change at the driver api function and ctrl+S to save the changes and re-build it.

    No error occurs , it seems so good !

    But it really works?

    In order to explain the bug of Xilinx, I build a simple hello world application based on zed_hw_platform .

    Type the main as follows:

    XGpioPs Gpio;

        XGpioPs_Config *ConfigPtr;

        ConfigPtr = XGpioPs_LookupConfig(0);

        XGpioPs_CfgInitialize(&Gpio, ConfigPtr, ConfigPtr->BaseAddr);

     

        u32 data=XGpioPs_IntrGetStatusPin(&Gpio,50);

        data++;

    print("Hello World\n\r");

     

    Toggle a breakpoint at the XGpioPs_IntrGetStatusPin and step into the function until :

    XGpioPs_GetBankPin(Pin, &Bank, &PinNumber);

    Executet the sentence and the value of Bank and PinNumber as shown following:

     

    Yes ,you get it ! the variable turns out 0 !

    What a absurd thing! Pin 50 locate in Bank 1 obviously!

     

    And now I try to see clearly what happened during function: XGpioPs_GetBankPin

    I try to modify the function to a clear structure to see the variables :

    for (*BankNumber = 0; *BankNumber < 4; (*BankNumber)++)

        {

            u8 data=XGpioPsPinTable[*BankNumber];

            if (PinNumber <= data )    break;

     

        }

    But once you debug the modified function , you can not see the value of variable: data .

    Now I will show you an more interesting thing!

     

    Change the driver api function name XGpioPs_GetBankPin to XGpioPs_GetBankPin_NO as shown following:

    Remember to save the modified file and re-build project.

    Wow! No error occurs and run the application , it works as nothing happened!

     

    What happened????

    Yes , the driver api can not change by hand . although you can modify and save the changes, but it have no works at all.

     

    NOW select Project>Clean… >Clean all Projects , slect OK to clean all the .o object and re-build BSP/application project.

    This is a temporary screen shot :

     

    Why the bank turn out 0?

    We have known the driver api can not be modified. But XGpioPs_GetBankPin(Pin, &Bank, &PinNumber) remains a bug still.

    Where is wrong ???

     

     

    As we see, the folder ps7_cortexa9_0 disappeared. After a short while , it appears . doudle click xgpiops.c file to locate the XGpioPs_GetBankPin function.

    Yes , any changes you have made disappeared . the libgen tools re-generate the driver api and you changes lost.

    That's really terrible phenomenon. You can modify and save the changes in the driver api files but it have no work at all.

  • 相关阅读:
    什么是 HTTPS
    首页飘雪的效果
    load data导入数据之csv的用法
    phpcms v9 配置sphinx全文索引教程
    js的一些技巧总结
    MySQL 清除表空间碎片
    使用的前台开发在线工具
    (phpQuery)对网站产品信息采集代码的优化
    永远不要打探别人工资
    git 显示多个url地址推送
  • 原文地址:https://www.cnblogs.com/dragen/p/3136839.html
Copyright © 2011-2022 走看看