XM122 XB122 prototyping

Hi new to this, so excuse the elementary question

Can I put custom software on a XM122 using the XB122 dev kit?
This is the only hardware I have, is nRFUtil my only option to push software to the XM122?  Seems like the other tools need different dev boards or debugger interfaces.
If so, what is the best tool to build new hex files on a Windows platform, and some pointer to a sample of doing this?

Thanks

Cheers

Andreas

Parents
  • Hi there,

    Can I put custom software on a XM122 using the XB122 dev kit?

    This is an external third party module, but as far as I can see it has a nRF52840 which has a SWD debug interface that can be used to flash fw. I'm not sure if the devkit you're referring to has an on board debugger that can be used to flash external boards (It doesn't look like it). Either way, you could use a stand alone J-link debugger from SEGGER to flash the XM122 as long the SWD interface has been routed out. 

    regards
    Jared

  • Hi Jared,

    Thanks for the prompt reply, I made some progress, but stuck again.  After lots of reading and downloading, I have now picked all the tools to be used, and all steps working, except the actual DFU flashing (which now also works, but BLE not advertising).

    Toolset:

    SEGGER Embedded Studio for ARM Release 6.34a Build 2022083102.51023 Windows x64

    Python 3.7

    nrfutil - latest version 6.1.6

    mergehex - latest version 10.17.3

    nRF5_SDK_15.3.0_59ac345

    Sample App acconeer_xm122_v2_11_0.zip

    Sample project segger_embedded_studio.emProject

    The project compiles after fixing the issue as explained in  undefined reference to `__RAM1_segment_end__' 

    I changed the link settings to add a .hex file as output, also seems successful

    I thengenerated the settings.hex with:

    nrfutil settings generate --family NRF52 --application acc_bluetooth_beacon.hex --application-version 1 --bootloader-version 2 --bl-settings-version 1 settings.hex

    Then merged settings with app with:

    mergehex -m acc_bluetooth_beacon.hex settings.hex -o merged.hex

    Then added what seems to be the appropriate softdevice with:

    mergehex -m merged.hex s140_nrf52_6.1.1_softdevice.hex -o merged_output.hex

    Then generated the deployment package with:

    nrfutil pkg generate --hw-version 52 --application-version 1 --application merged_output.hex --sd-req 0xB6 --sd-id 0xB6 app_dfu_package.zip

    All seems fine.  But when I try to deploy package to XM122 via XB122 and nRF Toolbox DFU app, the process fails after Bootloader Enabled - ok

    Initializing DFU - fail

    Ok, now for the catch, I was repeating these steps as I was typing and this time it worked, no fail on DFU Init.  BUT when I reset the XB-/XM122 I do not see any BLE advertisements as expected, I do not even see the device.

    Any advice on how to debug this will be appreciated.

    Thanks

    Cheers

    Andreas

  • Hi Sigurd,

    I have read so much and downloaded so much and tried so many things, I decided I will redo my first basic steps to confirm the actual versions before I answer in detail, but now I see after my last DFU I cannot see the device to do a DFU again.  I assume I must now first restore the bootloader.  The instructions from the XM122 Module Software User Guide says:

    "2.4 Restore Bootloader

    A backup copy of the bootloader is delivered as part of the “production sw.hex” file, which also includes Nordic’s softdevice (containing their Bluetooth stack). Bootloader and softdevice has been merged into a single hex file, because as of version 15.3.0 of the Nordic SDK they cannot be flashed separately. To restore an XM122 device to its factory condition, do the following using a J-Link: 1. Download and install “nRF5x Command Line Tools” from www.nordicsemi.com 2. Download and install “J-Link Software and Documentation Pack” from www.segger.com nrfjprog -f nrf52 -- erasepage 0 xFE000 -0 x100000 nrfjprog -f nrf52 -- program production_sw . hex -- sectorerase -- verify nrfjprog -f nrf52 -- reset "

    My 3 questions now are:

    1) Do I need a J-Link device, is this now the only way to communicate with the XB122?

    2) If so, which is the smallest/cheapest version that will get the job done?

    3) If not, what is the alternative way?

    Thanks

    Cheers

    Andreas

  • Hi Andreas:

    AndreasLiebenberg said:
    The instructions from the XM122 Module Software User Guide says:

    If you have questions to the XM122 guides, contact Acconeer.

    Sigurd Hellesvik said:
    Just to be clear, you have already followed the tutorial and generated the package with hrm and performed a DFU successfully?

    I did not get the answer to this. Have you ever been able to do DFU on your device?

    AndreasLiebenberg said:

    1) Do I need a J-Link device, is this now the only way to communicate with the XB122?

    2) If so, which is the smallest/cheapest version that will get the job done?

    3) If not, what is the alternative way?

    There are two ways to program a device: Using a Debugger or a Bootloader.

    Here is the top result when I search for "bootloader vs debugger": https://www.playembedded.org/blog/difference-bootloader-debugger/

    I suspect the XB122 came preprogrammed with a bootloader.
    If you programmed it using a debugger, you might have overwritten the bootloader.
    In this case you need to program an application with a bootloader to the chip using a debugger.

    With a bootloader, you no longer need a debugger to program the chip.

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    Thanks, here the answers:

    I take your point on the XM122 User guide and Acconeer, but am I missing something? Are all the steps not referring to your tools?  It starts with "Download and install “nRF5x Command Line Tools” from www.nordicsemi.com" I must say, it is confusing who's tools is who's and who to talk to.  Thanks for the patience!

    I did follow a tutorial https://www.youtube.com/watch?v=JaVWA4c8-2I (not sure if it is the one you are referring to), which instructed me on how to put the bootloader on the device.  This DFU was done successfully.  I did not generate the package with HRM (I do not know what HRM is).  I downloaded a file acc_module_server_dfu_package.zip and deployed that with the command "nrfutil dfu serial -pkg acc_module_server_dfu_package.zip -p COM5"

    This worked.  I deployed a second .zip "nrfutil dfu serial -pkg bluetooth_demo_app_xm122.zip -p COM5"

    This also worked and I could see distance measurements on my phone as the demo should do.

    Regarding the last part of restoring the bootloader.  Their instructions on how I loaded the original with nrfutil does not work again, it just says no response from COM5.  So, I suspect XM/XB122 it is in a vegetable state, I need a "Factory Reset" and a J-Link debugger is the only option?  

    Thanks again

    Cheers

    Andreas

  • Hi Andreas,

    Sorry for the notifications, but I managed to misclick on your answer and "Mark as Solution".

    AndreasLiebenberg said:
    This also worked and I could see distance measurements on my phone as the demo should do.

    Ah, so it worked first, good to know!

    Just to be sure: Have you ever connected a J-Link debugger or other debugger to your XM/XB122?

    Regards,
    Sigurd Hellesvik

  • No, I do not have a J-Link, I was hoping there might be another solution...

Reply Children
Related