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

  • Hi Andreas,

    Likely, your bootloader has support for BLE integrated.

    But I think I have figured out what have gone wrong here.
    From "nrfutil pkg generate --help":

    "--softdevice TEXT The SoftDevice firmware file."

    So to add a softdevice to the image, you must tag it as a soft-device.

    You meged it into the application with:

    AndreasLiebenberg said:
    mergehex -m merged.hex s140_nrf52_6.1.1_softdevice.hex -o merged_output.hex

    Because of this, nrfutil does not know that this is a softdevice, and may have written it to the wrong place in flash.
    Therefore, the bootloader can no longer access the softdevice to do BLE.

    However, as you said, you can do dfu over serial, right?

    AndreasLiebenberg said:
    nrfutil dfu serial -pkg bluetooth_demo_app_xm122.zip -p COM5

    In this case, try to generate a new zip file for DFU using the --softdevice. See nRF52840 Dongle Programming Tutorial  for how to use nrfutil properly.

    Regards,
    Sigurd Hellesvik

  • Thanks Sigurd,

    I will look into this in more detail.  No, unfortunately I cannot DFU Serial anymore, it cannot connect to COM5, probably caused by the same issue.  As I understand J-link is now my only option?

    Thanks

    Cheers

    Andreas

  • Hi Andreas,

    Yes, if it looks like the bootloader is broken, a debugger is the only option.

    You can use a J-Link as you say.

    Another alternative is to use any of our nRF Developement Kits, as they come with a debugger on board, and are able to program external chips.
    For example the nRF52840DK.

    Regards,
    Sigurd Hellesvik

  • Hi Sigurd,

    Thanks nRF52840DK did the trick. I used the 10pin Cable connected to Debug Out on the nRF52840 DK and the SWD/JTAG on the XB122. To solve the power supply I shorted the SB47 on the nRF52840 DK which gave the XB122 power through the debug interface and prevents me from updating the nRF52840 DK itself. I could deploy the bootloader using commands":
    nrfjprog -f nrf52 --erasepage 0xFE000-0x100000
    nrfjprog -f nrf52 --program production_sw.hex --sectorerase --verify
    nrfjprog -f nrf52 --reset

    And the could load the supplied S140_nRF52.6.1.1_Softdevice.hex

    After that I could reload old samples and device is functioning normal.

    This put me back on deploying my own App.  I followed your advice and used the command

    nrfutil pkg generate --hw-version 52 --application-version 1 --application acc_bluetooth_beacon.hex --softdevice s140_nrf52_6.1.1_softdevice.hex --sd-req 0xB6 --sd-id 0xB6 app_dfu_package.zip

    which included the --softdevice setting.  This managed to deploy and I can redeploy, so the alignment and combination of the .hex files seems fine.  Thanks!

    I do now have a next problem, the sample now fails in the create_envelope_service() function.

    service_handle = acc_service_create(envelope_configuration); returns a NULL handle, all up to this point looked fine...

    The errors in the debug window shows:

    "<error> app: sensor_protocol:Timeout waiting for event on sensor 1
    <error> app: cpd_cbank_and_vana_calibration:Failed to get result for vana setting=0
    <error> app: cpd_cbank_and_vana_calibration:Get Vana result failed
    <error> app: sensor_manager:Calibration failure for sensor 1
    <info> app: Could not create envelope service"

    Any idea where to start looking for this next problem?

    Thanks

    Cheers

    Andreas

  • Hi Andreas,

    Nice to hear that you were able to solve your problem, good job!

    AndreasLiebenberg said:
    I do now have a next problem

    Could you create a new ticket for this new problem?
    It would help us keep DevZone tidy, and easier for other users to find solutions later.

    Regards,
    Sigurd Hellesvik

Related