I also encountered the issue of 'Flash Download failed - "Cortex-M4"'

Hi Nordic engineer,

I was able to flash before, but I reinstalled Keil5, J-Link, and downloaded Device Family Pack 8.24.1 and CMSIS 4.5.0 from the Nordic website. The SDK version is 15.3.0.

I really don't know how to solve this problem. Can you help me? Thanks

Note: I have three debuggers at hand, 5340 DK, 52840 DK, and a small package debugger given by someone else. The 52840 debugger did not respond when powered on, while the other two could be detected as J-Link and 52811 in Keil. I want to solve the issues with these two debuggers first before asking about the power-on problem with 52840.

  • Hi,

    I don't see any obviously wrong in the settings in the screenshot. Are you able to program the device using nrfjprog or other tools? If not, is it so that you are using the debug out port on a DK to program an external board? If so, how have you connected it?

  • Hi Einar Thorsrud,

    I can program using J-Flash, but during this process, it will erase 52811. After programming (download)the application, you can return to Keil and program the application again. However, if you execute programming softDevice afterwards, you will no longer be able to program the application

    Finally, after powering on, the module did not work properly (the Bluetooth indicator light did not blink)

    Thank you

  • Hi,

    I see, then this makes sense. I assume your nRF52811 device is revision 2 (see SoC revisions and variants)? This has an improved access port protection which is controlled by both SW and HW, and the debug interface is blocked by default (see Access port protection section in the product specification). This SoC is not supported in nRF5 SDK 15.3. See IN151 for more details.

    As you see from IN151, you need to update the MDK if you want to keep using the old SDK (though if this is a new project I recommend you migrate to a newer SDK). With an updated MDK, you only need to use nrfjprog --recover first to open the debug port, and then it will stay open when you flash your new application, as this now includes code from the MDK that allows debugger access.

  • Hi Einar Thorsrud,

    After updating the 'Device Family Pack 8.29.0' I still couldn't download it. However, when I chose 'nRF52xxx softDevice erase,' I was able to download it successfully.

    Does changing the settings have any impact? I tried to download three modules, but only one module worked properly. For the remaining two modules, one module would disconnect when sending data through the phone's connect module, and the other module would receive data but send five times the amount of UART data when I only need one times the amount of data.

    Thank you...

    (This issue has been making my head spin...)

  • Hi,

    There is no need to change these settings in Keil. However, Keil will not know about how to open up the debug interface on the latest revision devices, so if you have an empty device or a device that is flashed with firmware that does not open up the debug interface, you need to first do "nrfjprog --recover" from the command line using a fairly recent version of nRF Command Line Tools. With that, you should be able to program as normally (to be able to program multiple times and/or debug, you will also need the updated MDK).

Related