Forum Discussion

CAlex's avatar
CAlex
Icon for Contributor rankContributor
3 years ago

HWlib baremetal project issue: How to devide the codes.

Hi,

forgive me to ask a foolish question:

How to devide the codes in the project.

I devided the codes into FPGA part and HPS part.

As you can see both header files contain "alt_printf.h" and "alt_clock_manager.h"

which cause the multiple compiling and cause a lot of errors.

Do you have any ideas to solve that problem?

Reguards.

10 Replies

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi Alex


    Including the same header multiple time would not be a problem.

    In the header files there are header guards.


    Could you share me what are the error that you are seeing?


    Regards

    Jingyang, Teh


    • CAlex's avatar
      CAlex
      Icon for Contributor rankContributor

      Hi,

      I deleted the project but the issue is

      alt_printf.c and alt_clock-manager.h have multiple definition.

      Now I wrote these codes in one file using GNU.

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    HI Alex


    After merging both files into one is it still having issues?

    What error that you seen previously?


    Regards

    Jingyang, Teh


    • CAlex's avatar
      CAlex
      Icon for Contributor rankContributor

      No,

      it didnt happen any more.

      BTW,

      could I ask a question about debug?

      While using SPL-debug.ds, it will stop at spl-boot-device function.

      Usually I will do F8 to let it ran and disconnect.

      But sometimes when I re-connect the SPL-debug.ds it will have a invisiable breakpoint at spl-boot-device, I cant step and run, I can only do jump to continue.

      The same thing happened in main function as well, when I make a breakpoint(red dot,which means DS soft breakpoint?), I cant step/jump/continue the function. Actually when I do the step,it will only step till the main function reaches. The only thing I can do is disconnnect, cancel/add the breakpoint and reconnect again.

      And then it will automatically do the main function even when I want to do the step.

      I wrote some timer ISR and enabled some timers,is that the reason?

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi Alex


    Did you do a power cycle before resetting?

    Sometimes the debugger did not clear of the breakpoint properly and might stuck somewhere.


    Regards

    Jingyang, Teh


    • CAlex's avatar
      CAlex
      Icon for Contributor rankContributor

      Hi

      I believe I did.

      Often I waited for 1min ~ 2mins.

      I think it is enough for the power cycle.

      Reguards.

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi Alex


    Sorry I am not a very expert in the debug tool.

    Could it be that the symbols files flashed into the board and the IDE are mismatched?


    Regards

    Jingyang, Teh


  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi Alex


    Do you have an update on this?

    Are you able to check if the symbols files are matching?


    Regards

    Jingyang, Teh


    • CAlex's avatar
      CAlex
      Icon for Contributor rankContributor

      Hi,

      no update yet.

      Since this problem didnt bother me anymore, please do what you must to the thread.

      Reguards.

  • tehjingy_Altera's avatar
    tehjingy_Altera
    Icon for Regular Contributor rankRegular Contributor

    Hi


    Since this thread been resolve, I shall set this thread to close pending. If you still need further assistance, you are welcome reopen this thread within 20days or open a new thread, some one will be right with you. Please login to ‘https://supporttickets.intel.com’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.


    If you happened to close this thread you might receive a survey. If you think you would rank your support experience less than 10 out of 10, please allow me to correct it before closing or if the problem can’t be corrected, please let me know the cause so that I may improve your future service experience.


    Regards

    Jingyang, Teh