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.

  • 相关阅读:
    perl linux 编译成可执行程序
    MQSeries::Message 面向对象接口的MQSeries messages
    数据化管理第一步,你真的会做报表吗?
    数据化管理第一步,你真的会做报表吗?
    aix ipcs 官方解释
    使用jquery.qrcode生成二维码及常见问题解决方案
    案例分享|某医药集团的BI建设案例
    aix ipcs OxFFFFFFFF
    案例分享|某医药集团的BI建设案例
    地图应用之 :获取当前位置的经纬度
  • 原文地址:https://www.cnblogs.com/dragen/p/3136839.html
Copyright © 2011-2022 走看看