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

Disable pin reset for west flash

I have an application that is utilizing P0.21 as gpio.  However, if I use the command "west flash", I P0.21 get configured as a pin reset.

Is it possible to disable this so west doesn't doesn't configure the system for a reset pin?

Parents
  • Answering my own question.  I found the documentation for choosing a flash runner.  I also found I was able to list the available flash runners and options using the command west flash -H.

    The command to flash without a pin reset is

    west flash --softreset

  • I have to say tho, in case someone else experiences the same problem:

    I could not use the west command manually because I used a freestanding app with VS Code and west would always complain about something when I tried it manually.

    VS Code seems to use west under the hood, but also runner configurations.
    The runner seems to be configured in the board.cmake config file, which in my case was located in the zephyr ncs directory under .../ncs/v2.4.0/zephyr/boards/arm/myBoardID/board.cmake
    And there I had to add this one line to solve it:

    board_runner_args(nrfjprog "--softreset")

    And then the lines

    Enabling pin reset.
    Applying pin reset.

    did not show up anymore in the VS Code output of the terminal during flashing.

    Note, that I also had to run this command manually in a terminal once in advance in order to get my P0.18 pin working as a CS GPIO pin instead of the Reset-feature.

    nrfjprog --eraseall

    Note, that, one can also duplicate the already existing board config directory in the ncs file hierarchy to their freestanding app repo folder and rename it slightly (I think it should have a different board name then to be unique?) so one can track this changed board.cmake line in their git repo. I think this is cleaner than having local changes in a local ncs installation which is separate from the app itself.
    Also, beware that you than have to change the board ID in your project.
    In my case using VS Code, it will ask this setting when I add a new build configuration which sets

    CONFIG_BOARD="nrf52840dk_nrf52840"

    inside .../app/build/zephyr/.config and therefore knows which board.cmake should be used.

Reply
  • I have to say tho, in case someone else experiences the same problem:

    I could not use the west command manually because I used a freestanding app with VS Code and west would always complain about something when I tried it manually.

    VS Code seems to use west under the hood, but also runner configurations.
    The runner seems to be configured in the board.cmake config file, which in my case was located in the zephyr ncs directory under .../ncs/v2.4.0/zephyr/boards/arm/myBoardID/board.cmake
    And there I had to add this one line to solve it:

    board_runner_args(nrfjprog "--softreset")

    And then the lines

    Enabling pin reset.
    Applying pin reset.

    did not show up anymore in the VS Code output of the terminal during flashing.

    Note, that I also had to run this command manually in a terminal once in advance in order to get my P0.18 pin working as a CS GPIO pin instead of the Reset-feature.

    nrfjprog --eraseall

    Note, that, one can also duplicate the already existing board config directory in the ncs file hierarchy to their freestanding app repo folder and rename it slightly (I think it should have a different board name then to be unique?) so one can track this changed board.cmake line in their git repo. I think this is cleaner than having local changes in a local ncs installation which is separate from the app itself.
    Also, beware that you than have to change the board ID in your project.
    In my case using VS Code, it will ask this setting when I add a new build configuration which sets

    CONFIG_BOARD="nrf52840dk_nrf52840"

    inside .../app/build/zephyr/.config and therefore knows which board.cmake should be used.

Children
No Data
Related