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 am sorry for the late reply due to the holiday season.

    1a) This is just a matter of how nRF Connect interprets and shows the data. It does not know if the first page is an MBR or some other data. It is odd that nRF Connect Programmer handles this differently when reading flash and when displaying a .hex file, but it is just a matter of presentation. The DTM example .hex files do not include an MBR (or SoftDevice), so it is just an "application", even though nRF Connect does not know this. 

    1b) Yes, it is loaded. This is not a problem.

    2) You cannot merge the examples like this. When I previously wrote that you can include DTM in your application, this was not the approach I had in mind. You cannot merge incompatible .hex files like this. As the error says, merging cannot be done since they files conflict (overlaps). However, there is another much more important issue here, which is that they are incompatible in this way. You can build the DTM example like this, and jump to it from your application (or a bootloader) in the same way that the bootloader starts the application, or you can implement DTM in your application using the DTM libraries.

    2a) If you want to place the DTM application in the flash together with the application and SoftDevice, you need to put it in a region which is not used by either the SoftDevice or application, by adjusting FLASH_START and FLASH_SIZE. But this leaves you with the issue that you need a way to start it. So this is more work (see above).

    3a) The FLASH_SIZE is only important in some cases. If it is set incorrectly, this will only cause problems in two situations. Either if you set it too low, and the application doe snot fit, even though there is an actual room. Or you set it too high and the application is too large, then linking will succeed but it will not fit in the physical flash on the chip. In other cases, having an incorrect value does not matter.

    3b) The RAM start and size typically doe snot depend on the other .hex files you flash, since only one of them will be executed at a time. The only exception si if you are using a SoftDevice or MBR, since then the RAM start must leave 8 bytes for the MBR, even if the SoftDevice is not enabled. (And if the SoftDevice is enabled, it is a different story altogether.)

    4) I am not sure. It could be interesting to see the .hex files and command you used to knot the full answer. But DFU package generation generally doe snot check everything, unlike merging .hex files which is a very simple operation where almost the only thing that can go wrong is overlapping data.

    Please note that we generally don't recomend using DTM in the production firmware. So before going further with this, I suggest you ask yourself why you do this? DTM is typically used when certifying and testing devices, but not commonly used for production tests etc. This is why we just provide an example that is to be used as-is without anything else. It is not intended from our side to be used in production firmware. But that said, it is possible if you really want to, as I outlined in my initial answer, but you need to adapt it yourself.

    Br,

    Einar

Reply
  • Hi Vishnu,

    I am sorry for the late reply due to the holiday season.

    1a) This is just a matter of how nRF Connect interprets and shows the data. It does not know if the first page is an MBR or some other data. It is odd that nRF Connect Programmer handles this differently when reading flash and when displaying a .hex file, but it is just a matter of presentation. The DTM example .hex files do not include an MBR (or SoftDevice), so it is just an "application", even though nRF Connect does not know this. 

    1b) Yes, it is loaded. This is not a problem.

    2) You cannot merge the examples like this. When I previously wrote that you can include DTM in your application, this was not the approach I had in mind. You cannot merge incompatible .hex files like this. As the error says, merging cannot be done since they files conflict (overlaps). However, there is another much more important issue here, which is that they are incompatible in this way. You can build the DTM example like this, and jump to it from your application (or a bootloader) in the same way that the bootloader starts the application, or you can implement DTM in your application using the DTM libraries.

    2a) If you want to place the DTM application in the flash together with the application and SoftDevice, you need to put it in a region which is not used by either the SoftDevice or application, by adjusting FLASH_START and FLASH_SIZE. But this leaves you with the issue that you need a way to start it. So this is more work (see above).

    3a) The FLASH_SIZE is only important in some cases. If it is set incorrectly, this will only cause problems in two situations. Either if you set it too low, and the application doe snot fit, even though there is an actual room. Or you set it too high and the application is too large, then linking will succeed but it will not fit in the physical flash on the chip. In other cases, having an incorrect value does not matter.

    3b) The RAM start and size typically doe snot depend on the other .hex files you flash, since only one of them will be executed at a time. The only exception si if you are using a SoftDevice or MBR, since then the RAM start must leave 8 bytes for the MBR, even if the SoftDevice is not enabled. (And if the SoftDevice is enabled, it is a different story altogether.)

    4) I am not sure. It could be interesting to see the .hex files and command you used to knot the full answer. But DFU package generation generally doe snot check everything, unlike merging .hex files which is a very simple operation where almost the only thing that can go wrong is overlapping data.

    Please note that we generally don't recomend using DTM in the production firmware. So before going further with this, I suggest you ask yourself why you do this? DTM is typically used when certifying and testing devices, but not commonly used for production tests etc. This is why we just provide an example that is to be used as-is without anything else. It is not intended from our side to be used in production firmware. But that said, it is possible if you really want to, as I outlined in my initial answer, but you need to adapt it yourself.

    Br,

    Einar

Children
No Data
Related