This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

Combining Different Apps

Hi,

I want to add my flash driver code to http_sample_update example. How can I combine these two applications. I want to use the flash driver on http example since I need to send the data that I dowloaded via http example to external flash with spi. Which folders should I need modify. Also should these two different code files(http and fash driver) be in the same folder to make things work?

Thank you

Parents
  • Hi, Verulia!

    Correct me if I'm wrong, are you referring to the http_application_update sample? Anyway, to use your flash driver code with your sample I suggest that you add the flash driver source code to the http_application_update/src folder and expose the relevant functionality with a header file, called flash_driver.h for example. You will also have to add the configurations from the prj.conf of the flash driver to the prj.conf of the main project. Lastly you must update CMakeLists.txt to be aware of the additional source files. To do this for a single source file, like flash_driver.c, add the following line of code:

    target_sources(app PRIVATE src/flash_driver.c)

    Below I have attached a simple demonstration on how additional sources can be added to an NCS project. 

    4130.include_demo.zip
    Hope this helps you on your way!

    Best regards,
    Carl Richard

Reply
  • Hi, Verulia!

    Correct me if I'm wrong, are you referring to the http_application_update sample? Anyway, to use your flash driver code with your sample I suggest that you add the flash driver source code to the http_application_update/src folder and expose the relevant functionality with a header file, called flash_driver.h for example. You will also have to add the configurations from the prj.conf of the flash driver to the prj.conf of the main project. Lastly you must update CMakeLists.txt to be aware of the additional source files. To do this for a single source file, like flash_driver.c, add the following line of code:

    target_sources(app PRIVATE src/flash_driver.c)

    Below I have attached a simple demonstration on how additional sources can be added to an NCS project. 

    4130.include_demo.zip
    Hope this helps you on your way!

    Best regards,
    Carl Richard

Children
No Data
Related