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

DTM test procedure over Bootloader + SoftDevice

Hello,

 

I am using nRF52840, SDK_16.0.0, S140 SoftDevice and Segger 4.16 for flashing the image.

 

1) At factory first we will load Secure Serial Bootloader and SoftDevice. Without erasing them, we want to do DTM. Whether can I load DTM package from below path using nrfutil.

                \examples\dtm\direct_test_mode\pca10056\blank\ses

 

2) As per below post can’t I use load SoftDevice along with DTM.

a) Since SoftDevice only loaded but nowhere enabled, still DTM can be loaded. Please correct my understanding.

                https://devzone.nordicsemi.com/f/nordic-q-a/42488/how-to-run-dtm-on-nrf52840-development-kit-using-mt8852b/167016#167016

                https://devzone.nordicsemi.com/f/nordic-q-a/33236/52840-dtm

 

Thanks & Regards

Vishnu Beema

Parents
  • Hi Vishnu,

    I see. So just to double-check, this is like this. 1) initially you program the DTM app for production test (1). After that, you upgrade to the "normal" application firmware via DFU (2). Is that correct, and with the memory layout as suggested in this drawing?

    If so, then you are right. Then you subsequently reset and the bootloader enters DFU mode based on GPIO pin or other, and you update to the application, right? This should be straightforward. You just need to do the following changes to the DTM example application:

    • Change the flash start address to locate it directly above the SoftDevice, at the exact same location your other application (they will not be on the device at the same time).
    • Change the RAM start address to 0x20000008 (and reduce size correspondingly).

    With these changes, the DTM app will run from the correct location.

    Now for the questions:

    2) The comment about adjusting RAM when the SoftDevice is enabled was just a generic comment, really. It is not relevant since it cannot be enabled while using DTM since that requires direct radio access. Nor is it relevant in this configuration.

    4a) Apparently there is no check preventing the application from starting at page 0. This is a bit odd since the MBR is always located there. However, it should alow SoftDevices hex files that start there (conceptually), since it includes the MBR. The second point here is that for hex files (SoftDevices) page 0 is silently stripped away since the MBR is not overwritten. So that is what you see here as well. The first page of the DTM app is stripped away.

    4b) No. There is a hash of the image in the DFU package, and DFU will only a success if the hash is verified. However, this is generated by nrfutil and if there is an issue with the generated image (as here), this will not help you. That is not something we have seen as an issue though since you should anyway test the image properly before providing it to customers. If you want to verify this during development, you should use a debugger before and after DFU and read the flash that way.

    4c) Because the CRC is only calculated based on the data that is actually part of the image, and that does not include page 0, as explained above. So this is not a problem with the DFU or CRC checking per se.

    Br,

    Einar

Reply
  • Hi Vishnu,

    I see. So just to double-check, this is like this. 1) initially you program the DTM app for production test (1). After that, you upgrade to the "normal" application firmware via DFU (2). Is that correct, and with the memory layout as suggested in this drawing?

    If so, then you are right. Then you subsequently reset and the bootloader enters DFU mode based on GPIO pin or other, and you update to the application, right? This should be straightforward. You just need to do the following changes to the DTM example application:

    • Change the flash start address to locate it directly above the SoftDevice, at the exact same location your other application (they will not be on the device at the same time).
    • Change the RAM start address to 0x20000008 (and reduce size correspondingly).

    With these changes, the DTM app will run from the correct location.

    Now for the questions:

    2) The comment about adjusting RAM when the SoftDevice is enabled was just a generic comment, really. It is not relevant since it cannot be enabled while using DTM since that requires direct radio access. Nor is it relevant in this configuration.

    4a) Apparently there is no check preventing the application from starting at page 0. This is a bit odd since the MBR is always located there. However, it should alow SoftDevices hex files that start there (conceptually), since it includes the MBR. The second point here is that for hex files (SoftDevices) page 0 is silently stripped away since the MBR is not overwritten. So that is what you see here as well. The first page of the DTM app is stripped away.

    4b) No. There is a hash of the image in the DFU package, and DFU will only a success if the hash is verified. However, this is generated by nrfutil and if there is an issue with the generated image (as here), this will not help you. That is not something we have seen as an issue though since you should anyway test the image properly before providing it to customers. If you want to verify this during development, you should use a debugger before and after DFU and read the flash that way.

    4c) Because the CRC is only calculated based on the data that is actually part of the image, and that does not include page 0, as explained above. So this is not a problem with the DFU or CRC checking per se.

    Br,

    Einar

Children
No Data
Related