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

mqtt_simple programmed to wrong address range 00008000 -- 00020abb

Hi,

I tried to open the mqtt_simple project on the nonsecure ns nrf9160 DK using SES and after that tried to build and run the project which was successfully done but the the application was programmed to wrong address range , i think the secure part eventhough i selected nonsecure ns board while opening the project whereas i feel the non secure applications should be programmed 00040000 onwards . I tried erasing the programs from the board and try it multiple times and also installed sdk on ubuntu after failed to run on windows sdk. but on ubuntu also the same thing was happening. and on link monitor aso i could see that mqtt_simple program is not starting because of this address issue. i also checked some other files for the address range it is set which seems to be fine. but after building the project the zephyr.elf file seems to program the application 00008000 address onwards.

The following is the output after running the project:

Connecting 'J-Link' using 'USB'
Connecting to target using SWD
Loaded /home/jithu/Nordic/arm_segger_embedded_studio_v416_linux_x64_nordic/bin/libjlinkarm.so
Firmware Version: J-Link OB-K22-NordicSemi compiled Feb 14 2019 14:03:18
DLL Version: 6.44d
Hardware Version: V1.00
Target Voltage: 3.300
Device "NRF9160" selected.
Found SW-DP with ID 0x6BA02477
Scanning AP map to find all available APs
AP[2]: Stopped AP scan as end of AP map seems to be reached
AP[0]: AHB-AP (IDR: 0x84770001)
AP[1]: AHB-AP (IDR: 0x24770011)
Iterating through AP map to find AHB-AP to use
AP[0]: Core found
AP[0]: AHB-AP ROM base: 0xE00FF000
CPUID register: 0x410FD212. Implementer code: 0x41 (ARM)
Found Cortex-M33 r0p2, Little endian.
FPUnit: 8 code (BP) slots and 0 literal slots
Security extension: implemented
Secure debug: enabled
CoreSight components:
ROMTbl[0] @ E00FF000
ROMTbl[0][0]: E000E000, CID: B105900D, PID: 000BBD21 Cortex-M33
ROMTbl[0][1]: E0001000, CID: B105900D, PID: 000BBD21 DWT
ROMTbl[0][2]: E0002000, CID: B105900D, PID: 000BBD21 FPB
ROMTbl[0][3]: E0000000, CID: B105900D, PID: 000BBD21 ITM
ROMTbl[0][5]: E0041000, CID: B105900D, PID: 002BBD21 ETM
ROMTbl[0][6]: E0042000, CID: B105900D, PID: 000BBD21 CTI
Preparing target for download
Executing Reset script TargetInterface.resetAndStop()
Reset: Halt core after reset via DEMCR.VC_CORERESET.
Reset: Reset device via AIRCR.SYSRESETREQ.
Downloading 'zephyr.elf' to J-Link
Programming 98.6 KB of addresses 00008000 -- 00020abb
Programming 0.4 KB of addresses 00020abc -- 00020c67
J-Link: Flash download: Bank 0 @ 0x00000000: 1 range affected (102400 bytes)
J-Link: Flash download: Total time needed: 1.210s (Prepare: 0.076s, Compare: 0.023s, Erase: 0.000s, Program: 1.080s, Verify: 0.004s, Restore: 0.024s)
Download successful

Please suggest if i am analysing the problem in the right way and also suggest some solution if the details i mentioned is enough r should i post any other outputs as well.

Thanks in advance!

  • Hello JNair,

    The current version of SES (v4.16) does not take into account an updated feature which has been introduced in NCS.

    Basically when building the application it will also build the "Secure Partition Manager" (spm) [earlier known as "Secure_boot"] and then merging those two together for your convenience.

    So you need to manually select this "merged.hex" file when you want to flash the application to the nRF91.

    Here is a quick guide on how this is done: 

    • Build solution as normal

    • See that the output shows it has made a “merged.hex” file (which will consist of your application and the “spm”)

    • Then make sure your nRF91DK is powered ON and then “connect J-Link”:

    • And then manually choose the correct “merged.hex” file to be flashed to the kit:

    • It is located in the applications build folder under zephyr:

    • Then it will be flashed to your kit and you should see “Download Successful” in the Output:


     Best Regards,
    Martin L.

  • Hi Martin, 

    Thanks for the answer. I just had a query that should i need to follow these steps only while building programs in applications folder like asset tracker or also for projects in samples folder like mqtt_simple also? 

  • The same would apply for the mqtt_simple sample or any other samples/applications in NCS for that matter.

    Just change the folder paths and samples to what suits your use case.

  • Hi thanks this worked for me too. 

    What is the proper procedure for debugging in this current state of SES/NCS disparity?After I do the Download File step per above the, I initiate Debug..Go then SES proceeds to flash the firmware again (in the wrong location 0x00008000) but somehow debugging magically works. Can I assume the Debug..Go flash isn't affecting the location of the first flash and attaching the debug session in the correct location?

    Thx!

Related