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

Failure to flash and to erase

Hallo

I am using a nrf52832_xxaa (evaluating on a sparkfun board)

I am unable to program the application (Im trying to flash a blinky examle)

I have tried the S132 version of SDK13,14 and SDK15, but always got a message : 

**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
Full Chip Erase Failed!
Error: Flash Download failed - "Cortex-M4"

as for the memory , for example for the SDK15.0.0  with  s132_nrf52_6.0.0_softdevice, the memory is as follows 

IROM1 : 0x26000 size 0x5A000

IRAM1 : 0x200022B8 size 0x6000

this is the algorithm for flahsing the app, before flushing it I programmed the softdevice and erased all using nrfproj

using nrfjprog I have succesfully erased the flash :eraseall, and programmed the softdevice : s132_nrf52_6.0.0_softdevice.hex

I have also tried to eraseall through the KEIL but was unsuccesful at that.

**JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
Full Chip Erase Failed!

I have also merged it with the application and programmed but could not connect to the blinky application.

interestingly I have succeeded to flush the application from a NRF51822 project that I had ,

there I was using the nRF51xxx External connection algorithm

and 0x1B000 size 0x14000 for IROM1

0x20001FF8 size 0x6018 for IRAM1

I don't understand what's going on,

would appreciate your help very much

Eran

this s the debug J link addapter info and sw device idcode :

  • Hi,

     

    this s the debug J link addapter info and sw device idcode :

    Just to confirm: The CPU core info here indicates a nRF51 device is found (Cortex M0 CPU). Is this the section from your nRF52-based project, or from your test project targeting a nRF51 device?

     

    using nrfjprog I have succesfully erased the flash :eraseall, and programmed the softdevice : s132_nrf52_6.0.0_softdevice.hex


    I have also tried to eraseall through the KEIL but was unsuccesful at that.

    ERASEALL from Keil will only erase the application part. In order to do an erase-all, nrfjprog has to be used. Keil has an in-built protection in the flashing algorithm to not try to overwrite the softdevice, but your addressing looks to be good here, unless you have manually specified a scatter file (.sct file) under "project settings -> linker" tab. Do you see this issue with other examples as well, or is this programming issue related to one example only?

     

    **JLink Warning: T-bit of XPSR is 0 but should be 1. Changed to 1.
    Full Chip Erase Failed!
    Error: Flash Download failed - "Cortex-M4"

    This is a "generic" failure, which is normally due to bad contact, not powering the nRF, switching SWDCLK/SWDIO, or similar. Have you double-checked your connection, and that the nRF is powered with 3.3V?

     

    Kind regards,

    Håkon

  • * I was connecting it to an NRF52832 device, with a NRF52 project from the SDK15 package

    * Yes, I used --eraseall from nrfjprog 

    * I could not program any example 

    * if there is a porblem with the connection how am I succeeding programming using nrfjprog  ?

    Thanks

  • Ron said:
    * I was connecting it to an NRF52832 device, with a NRF52 project from the SDK15 package

     The screenshot shows the device as a Cortex M0 device, not a Cortex M4 device. If you are using the nRF51-DK as a programmer, you are detecting the nRF51xxx device on the DK, not the external board.

    Try powering your external board via the "VDD_NRF" from the nRF5x-DK to ensure that the voltage levels are the same.

    Could you upload a picture of your setup? Are you using P19 or P20 as the debug out?

    Best regards,

    Håkon 

  • Thanks for your answer, 

    how do you understand from the screenshot that it's Cortex M0 ? how would Cortex M4 look like ?

    I am seeing the same information wheter I connect the external NRF51 device or remove it and try to program the on board (NRF51 DK) processor,  they both NRF51 but shouldn't they have different information.

    I am able to program and debug them both, however with the NRF1 for some reason blinky is not connecting with the app..

    Connecting the sparkfun also does not change anything., same SN, same IDCODE..

    Thanks

    Eran

  • I see it on the IDCODE. Here's an example:

    If the IDCODE does not start with 0x2BAetc., then it's not a Cortex M4 that you're communicating with.

    Could you show me a picture of the sparkfun module and the physical setup that you have?

    Kind regards,

    Håkon

Related