when I flash a fw with generic level server , then flash other fw with sensor server , the system runs error, if I use command "nrfjprog --eraseall -f NRF52" to erase first then flash ,the system runs well, why need to erase first?

Hi,

    I have met one bug.

when I flash a fw with generic level server , then flash other fw with sensor server ,  the system runs error,  if I use command "nrfjprog --eraseall -f NRF52" to erase first then flash ,the system runs well,   why need to erase first?

error as follow:

app_error_weak.c,  115, Mesh error 34314 at 0x00000000 (:0)

Parents
  • Hi,

    Are you flashing the firmware using Segger Embedded Studio or nrfjprog?

    You need to erase the device first to make space for the new firmware.

  • Hi,

    What command line version are you using? 

    Tomlee said:
    2)but if I flash a fw with generic level server , then flash fw with generic level server again , in this situation it don't need to erase first , fw will also runs well

    Is the firmware unchanged when you do this?

  • Hi Mttrinh,

    What command line version are you using? 

    ==nRF-Command-Line-Tools_10_9_0_Installer_64

    2)but if I flash a fw with generic level server , then flash fw with generic level server again , in this situation it don't need to erase first , fw will also runs well

    ==yes, I just changed som function, but not add or del mesh model, if I add or del mesh model it also runs error

  • Hi,

    Are you sure you are using v10.9.0? Can you try using the command nrfjprog --version in the command line? 

    You should get:

    Parsing hex file.
    Reading flash area to program to guarantee it is erased.
    ERROR: The area to write is not erased.

    when you try to flash a firmware without erasing first if you use v10.9.0

    In a later version 10.13.0, --program no longer checks if flash is erased before writing in order to improve performance. So won't get the output above, instead the firmware is just overwritten which will cause it to get corrupt unless the firmware you are flashing is the same without changes(probably what you are seeing). 

    Normally you will have to erase the device first before flashing a new firmware, if you are flashing the same firmware(with or without changes) you can use the command --sectorerase to only erase the application and not the network data if you like to keep the persistent data stored on the device.

  • Maybe we got a wrong idea.

    I use segger to compile and download fw, there are two hex files (softdevice.hex and application.hex),  right?

    before using segger to download,  there should erase first (I think only erase application area) .

    so now I give a question again:

    base on  fw with generic level server of the board

    1) if flash diff mesh server model fw (mean I change mesh model frmo generic level server model to sensor server model) why need to use command "nrfjprog --eraseall -f NRF52" to erase whole area?, otherise if just use segger to download  it works error

    2) if flash same mesh server model fw(mean I just modify some function not about mesh model) , why do not need to use command "nrfjprog --eraseall -f NRF52" to erase whole area, just use segger to download , it also work well?

Reply
  • Maybe we got a wrong idea.

    I use segger to compile and download fw, there are two hex files (softdevice.hex and application.hex),  right?

    before using segger to download,  there should erase first (I think only erase application area) .

    so now I give a question again:

    base on  fw with generic level server of the board

    1) if flash diff mesh server model fw (mean I change mesh model frmo generic level server model to sensor server model) why need to use command "nrfjprog --eraseall -f NRF52" to erase whole area?, otherise if just use segger to download  it works error

    2) if flash same mesh server model fw(mean I just modify some function not about mesh model) , why do not need to use command "nrfjprog --eraseall -f NRF52" to erase whole area, just use segger to download , it also work well?

Children
Related