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.

  • 相关阅读:
    学习 Message(18): WM_SYSCOMMAND 消息[二] : LParam 参数
    学习 Message(20): WM_SYSCOMMAND 消息[四] : 使最大最小化按钮失效
    学习 Message(16): 测试 $0118 号消息
    学习 Message(15): 让窗体同时响应键盘事件的方法
    学习 Message(17): WM_SYSCOMMAND 消息[一]
    请教大家, 关于 $0118 号消息
    学习 Message(21): WM_SYSCOMMAND 消息[五] : 点击关闭按钮让窗体最小化
    学习 Message(22): WM_SYSCOMMAND 消息[六] : 系统菜单综合操作示例
    根据颜色值获取颜色常量名: ColorToIdent
    “博客无双”第二期拍卖活动将于2011年1月26日14:00开始
  • 原文地址:https://www.cnblogs.com/dragen/p/3136839.html
Copyright © 2011-2022 走看看