This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Migrate from Eclipse to Keil

Hello! I work with nRF52. I have a code developed in Eclipse Neon and I have to switch to Keil. I tried to create a new project from the template_project example found in the sdk13 by copying the main.c and the sdk_config.h into the project folder. When I try to compile the code I have many errors like "undefined symbol". Even if I try to add manually the missing libraries into the project, I still have such errors.

Is it the right way to create/import a new project? What should I take into account?

Thank you

P.S.

I have also to fix the libraries for this main.c as well. I still have errors like "undefined symbols" and I can't find which libraries should I add. Can you help me again?

  • Hi,

    There are some modules that you are using that are not added by default in the template_project. You will need to add the following paths to the “Include Paths” in the Options for target -> C/C++ tab:

    ..\..\..\..\..\..\components\libraries\pwr_mgmt
    ..\..\..\..\..\..\components\libraries\experimental_section_vars
    ..\..\..\..\..\..\components\libraries\mutex
    ..\..\..\..\..\..\components\libraries\atomic
    

    image description


    Then you need to add the nrf_pwr_mgmt.c and nrf_section_iter.c to the project. Right click on the nRF_Libraries folder, and click on "Add Existing Files to Group "nRF_Libraries"..

    The files are located in the these folders:

    SDK_folder\components\libraries\pwr_mgmt
    SDK_folder\components\libraries\experimental_section_vars
    

    image description


    You will also need to add the Power management defines and the Section variables iterator define to the sdk_config.h.

    I have added these to the sdk_config.h you uploaded:

    sdk_config.h

    I also changed PWM3_ENABLED to 0 in the sdk_config.h you uploaded, since PWM3 is only available on nRF52840. If you need a complete sdk_config.h file, you can find it in this post.

  • Many Thanks! That's was very helpful and straightforward!

  • I just realized that I can't see anything neither from the UART nor RTT. Is this because of the settings changing in the sdk_config.h file?

  • Yes, you need to set NRF_LOG_ENABLED to 1 in sdk_config.h

    If you want to use UART for logging, set NRF_LOG_BACKEND_SERIAL_USES_UART to 1. If you want to use RTT instead, set NRF_LOG_BACKEND_SERIAL_USES_RTT to 1.

    I also recommend using the "Configuration Wizard", see this answer.

  • I edited the question with another main.c where I have the same problem of the first one. Could you suggest me which libraries are missing?

Related