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

Download "SPM" and "http_update_ota" separately

Hi,

I want to load both "SPM" and "http_update_ota" code separately to the nRF9160.

For that as suggested in "http://developer.nordicsemi.com/nRF_Connect_SDK/doc/0.4.0/nrf/samples/nrf9160/spm/README.html

i changed "CONFIG_SPM=n". 

After this i build "SPM" project and load it to nRF91 first.

Then i compile and load "http_update_ota" project.

But after loading "http_update_ota" project "SPM" doesn't run so i think SPM is getting erased.

Can you tell me how to use both separately ?

Regards,

Smitesh Mali

Parents
  • I assume you are referring to the application "http_application_update"

    I tried build and flash the SPM and the application separately, but was not able to for some reason. However, I was able to to make it work by building the main application as Non-Secure (by setting board to nrf9160_pca10090ns). Then it will build the two applications, the SPM and the http_appl.. before merging them together.

    The lines below are not correct, I mixed the mcuboot with the spm

    The http_applic.. is located in http_application_update/build_nrf9160_pca10090ns/zephyr/signed.hex and the SPM is located in                  http_application_update/build_nrf9160_pca10090ns/mcuboot/zephyr/zephyr.hex.


    You can then flash them separately using SES, nrfjprog or the nRF Connect Programmer app.

    If this is not sufficient, please tell me and I will look more into it.

    Best regards,

    Simon

  • The http_applic.. is located in http_application_update/build_nrf9160_pca10090ns/zephyr/signed.hex and the SPM is located in                  http_application_update/build_nrf9160_pca10090ns/mcuboot/zephyr/zephyr.hex.

    I tried this.

    It works. But can you try compiling SPM and http_update_ota separately and let me know which 

    hex file i should use to make spm and http_update_ota work ?

  • I was mixing the mcuboot and spm in my last answer, and referred to the wrong hex files. My apologies for that.

    Could you try this approach to compile the SPM and http_update_ota separately:

    • Build the SPM application in ..ncs\nrf\samples\nrf9160\spm
    • Add the lines shown below  to ..http_application_update\prj.conf( Change <sourcecode_root> appropriately)

    CONFIG_SPM_BUILD_STRATEGY_USE_HEX_FILE=y
    CONFIG_SPM_HEX_FILE="<sourcecode_root>/ncs/nrf/samples/nrf9160/spm/build_nrf9160_pca10090/zephyr/zephyr.hex"
    

    • Build the http_application_update application with board set as nrf9160_pca10090ns

    Best regards,

    Simon

  • Hi Simon,

    I followed the steps you have mentioned.

    I am getting error when "spm" hex file and "http_update_ota" hex file merges during compilation 

    Following are log of compilation.

    Combining ‘zephyr/merged.hex’
    1> Merged C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/spm/build_nrf9160_pca10090/zephyr/zephyr.hex
    1> Merged C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/asset_tracker/build_nrf9160_pca10090ns/zephyr/zephyr.hex
    1> Traceback (most recent call last):
    1> File "C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/zephyr/scripts/mergehex.py", line 28, in merge_hex_files
    1> ih.merge(to_merge)
    1> File "C:\Python37\lib\site-packages\intelhex\__init__.py", line 859, in merge
    1> 'Data overlapped at address 0x%X' % i)
    1> intelhex.AddressOverlapError: Data overlapped at address 0x0
    1>
    1> During handling of the above exception, another exception occurred:
    1>
    1> Traceback (most recent call last):
    1> File "C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/zephyr/scripts/mergehex.py", line 55, in <module>
    1> main()
    1> File "C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/zephyr/scripts/mergehex.py", line 51, in main
    1> merge_hex_files(args.output, args.input_files)
    1> File "C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/zephyr/scripts/mergehex.py", line 30, in merge_hex_files
    1> raise AddressOverlapError("{} has merge issues".format(hex_file_path))
    1> intelhex.AddressOverlapError: C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/asset_tracker/build_nrf9160_pca10090ns/mcuboot/zephyr/zephyr.hex has merge issues
    Build failed

    Regards,

    khodidas

Reply
  • Hi Simon,

    I followed the steps you have mentioned.

    I am getting error when "spm" hex file and "http_update_ota" hex file merges during compilation 

    Following are log of compilation.

    Combining ‘zephyr/merged.hex’
    1> Merged C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/spm/build_nrf9160_pca10090/zephyr/zephyr.hex
    1> Merged C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/asset_tracker/build_nrf9160_pca10090ns/zephyr/zephyr.hex
    1> Traceback (most recent call last):
    1> File "C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/zephyr/scripts/mergehex.py", line 28, in merge_hex_files
    1> ih.merge(to_merge)
    1> File "C:\Python37\lib\site-packages\intelhex\__init__.py", line 859, in merge
    1> 'Data overlapped at address 0x%X' % i)
    1> intelhex.AddressOverlapError: Data overlapped at address 0x0
    1>
    1> During handling of the above exception, another exception occurred:
    1>
    1> Traceback (most recent call last):
    1> File "C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/zephyr/scripts/mergehex.py", line 55, in <module>
    1> main()
    1> File "C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/zephyr/scripts/mergehex.py", line 51, in main
    1> merge_hex_files(args.output, args.input_files)
    1> File "C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/zephyr/scripts/mergehex.py", line 30, in merge_hex_files
    1> raise AddressOverlapError("{} has merge issues".format(hex_file_path))
    1> intelhex.AddressOverlapError: C:/Users/MTdeveloper01/Desktop/Smitesh/OTA/asset_tracker/ncs/asset_tracker/build_nrf9160_pca10090ns/mcuboot/zephyr/zephyr.hex has merge issues
    Build failed

    Regards,

    khodidas

Children
Related