• 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.

  • 相关阅读:
    数据库分库分表
    工作笔记----数据库分表
    工作笔记----数据提取
    Runnable和Thread的应用场景
    LeetCode题目按公司分类
    spring boot Java配置搭建ssm (二)
    spring boot java配置搭建ssm 小案例(IDEA)
    spring boot xml配置搭建 ssm 小案例(IDEA)
    连接查询
    限定、模糊、排序、多表查询(3)
  • 原文地址:https://www.cnblogs.com/dragen/p/3136839.html
Copyright © 2020-2023  润新知