Toolchain manager issues: Cleaning the build files / moving code to another folder

I'm using NCS 1.9.1 and Segger SES

Following Nordic's recommendation I first made a copy of BLE/peripheral_uart in order to preserve the original code and then used the toolchain manager to open the project. I selected nrf52DK_52832 as target and so far, things are working not bad.

1.) when the code is properly built, the project folder contains approx 1600 files with 40 MB size - my actual code is less than 30 kB. It is not clear to me which files can easily be deleted because they are rebuilt - I tried once to delete "build_nrf52dk_nrf52832" which is a most stupid idea, because all my project settings regarding BLE GATT were gone.

"Clean Zephyr" or "clean solution" does not really help too much, still 37 MB and if even fails with
"...ncs/v1.9.1/nrf/samples/bluetooth/peripheral_uart/build_nrf52dk_nrf52832/zephyr/dev_handles.c does not exist."

I find it very strange that I'm not able to peroperly clean a project, get rid of temprorary files - and I found no documentation so far on the Nordic system.

2.) the other issue is the location of sources: it seems that the full path to all files goes somewhere into the build process, which means, I'm not able to rename my project folder or move it to another location / harddisk / server and build there.

Is there any strategy how to handle this ?

As example lets look at c:/ncs/v1.9.1/nrf/samples/bluetooth/peripheral_uart - this is the sample I'm referring to. What is necessary to move this to : f:\customerXYZ\BLE-development\product1

thanks, Matthias

Parents
  • Hi Jonathan

    just to mention this, so far I never created a "clean" NCS project from scratch - people from Nordic recommended to me to use an existing sample code and modify it to my needs, and that worked so far not too bad.

    I made some tests : I started to work with a virgin copy of "peripheral_uart". Since my target is PCA10040 compatible I selected "nrf52dk_nrf52832" so the build folder was created, including the zephyr-folder and a .config file.

    I used the Kconfig tool (Segger SES > Menu > Project > Configure NCS project) and modified some settings to my needs, such as bluetooth device name, some GATT services etc. Hit "configure" and then compile the code, so far so good.

    I copied the whole folder "peripheral_uart" into something like "test_uart" and tried to open this project through SES "open nRF connect SDK project", but then the error pos up "cannot create project - create_nordic_project.py failed (1)"

    When I try to "clean the build directory" all the build folder is gone, including all my .config settings

    I tried this and then replaced the .config file manually from the original working version - and rebuild the solution : this seems to work.

    What I dont understand: how is prj.conf used ? Is .config derived from prj.conf ? and, am I supposed to modify prj.conf ?

    thanks for helping me, Matthias

    PS. I found another Q&A post about "Use of Pristine Build on VScode..." and I guess this is a similar issue ... It's not clear to me which files in the build folders are important to generate the code I want.

    PPS. I tried yesterday an upgrade to NCS 2.0.0 - I don't like being forced to using VS code, but hey, I tried it. After 4 crazy hours I downgraded everything because I even was not longer able to compile NCS 1.9.1 code and had suddenly issues with my Segger J-Link+

  • MDF said:
    What I dont understand: how is prj.conf used ? Is .config derived from prj.conf ? and, am I supposed to modify prj.conf ?

    To move the configurations out of the build folder, so that it does not get deleted when you do a clean build then you need to ad them manually in the prj.conf file. So yes, use the prj.conf to keep the settings you want permanently.  


    We do have some tutorials and videos on how to get started with VS code. VS code will be the default editor going forward from NCS v2.0.0 as SEGGER will no longer be supported. It is possible to use SEGGER but it will not be tested by us and getting it to work properly will most lily be even greater hassle. 


    I would recommend to check out the DevAcadamy for a  better tutorial. 

    As for the issues you have with NCS 2.0.0 there seem to have been a issue that broke previous installations when using SEGGER, so sorry about that. I hadde to remove the contents of the NCS folder and redownload, then previous versions worked with SEGGER again. It also caused issues with the manual insulation i have separately so if you also have manual installation that could cause som extra hassle.

    AS for what is important or not, i would recommend that you check out our guide on NCS, it is a built outdated but i goes over all the different parts of the projects. 
    nRF Connect SDK Tutorial - Part 1 | v1.5.0 - Getting Started - nRF Connect SDK guides - Nordic DevZone (nordicsemi.com) 

    Then there is the new docs, Features - nRF Connect for VS Code , it is more intuitive in the VS code IDE, as the Konfig is structured in a more direct way and not hidden in menus as it is in SEGGER, this also removes the issue where removing the build folder brakes the project. 

    Regards,
    Jonathan

Reply
  • MDF said:
    What I dont understand: how is prj.conf used ? Is .config derived from prj.conf ? and, am I supposed to modify prj.conf ?

    To move the configurations out of the build folder, so that it does not get deleted when you do a clean build then you need to ad them manually in the prj.conf file. So yes, use the prj.conf to keep the settings you want permanently.  


    We do have some tutorials and videos on how to get started with VS code. VS code will be the default editor going forward from NCS v2.0.0 as SEGGER will no longer be supported. It is possible to use SEGGER but it will not be tested by us and getting it to work properly will most lily be even greater hassle. 


    I would recommend to check out the DevAcadamy for a  better tutorial. 

    As for the issues you have with NCS 2.0.0 there seem to have been a issue that broke previous installations when using SEGGER, so sorry about that. I hadde to remove the contents of the NCS folder and redownload, then previous versions worked with SEGGER again. It also caused issues with the manual insulation i have separately so if you also have manual installation that could cause som extra hassle.

    AS for what is important or not, i would recommend that you check out our guide on NCS, it is a built outdated but i goes over all the different parts of the projects. 
    nRF Connect SDK Tutorial - Part 1 | v1.5.0 - Getting Started - nRF Connect SDK guides - Nordic DevZone (nordicsemi.com) 

    Then there is the new docs, Features - nRF Connect for VS Code , it is more intuitive in the VS code IDE, as the Konfig is structured in a more direct way and not hidden in menus as it is in SEGGER, this also removes the issue where removing the build folder brakes the project. 

    Regards,
    Jonathan

Children
No Data
Related