Problem bringing up a custom board (cant see board outside of bootloader mode)

I have designed a custom board for the nrf52840 and upon testing it in the nrf connect sdk (using a JLink), I can only see the board when it's in bootloader mode. When it's in normal operation, the debugger does not show it. 

Additionally, it does not appear as a USB device although I enabled USB CDC. In fact, I kept the configuration pretty much similar to the nrf52840 dongle when I defined the custom board on the nrf connect sdk.

Has anyone run into a similar issue? Are there any guidelines for how to debug such a problem?

Parents
  • Hi,

    I have designed a custom board for the nrf52840 and upon testing it in the nrf connect sdk (using a JLink), I can only see the board when it's in () mode. When it's in normal operation, the debugger does not show it. 

    If the debugger is connected, then you should always see it. Can you explain a bit both how you test, how your firmware is and how your HW is.

    Additionally, it does not appear as a USB device although I enabled USB CDC. In fact, I kept the configuration pretty much similar to the nrf52840 dongle when I defined the custom board on the nrf connect sdk.

    Difficult to say here. Bu tif you are not even able to debug, there could be a more fundamental issue. I think you need to get the basics working first.

    Could it for instance be that you have connected the debug (SWD) lines to a GPIO that you force high or low from your application? (that is just a wild guess, we need more information to make more precise suggestions).

  • Sorry for my late reply. I tried to get a GPIO to output a high but nothing is happening. I tried the same program on a dongle and it worked.

    Here is the schematic of the custom board:

  • Have you got debugging working? I wrote about bootloader, but please keep that out of things. No need to complicate more then necessary, so don't use a bootloader at first.

    Can you start by just trying to flash the Blinky sample and observe that it toggles the pin (you don't even need a LED on it, just check it with a logic analyzer if hat is easier). Next step is to debug. Are you able to debug? Then gradually move on.

  • I have tried a Blinky example, and it compiles fine with the custom board that i have defined, however, i dont see the voltage changing on the pin at all. I also tried this: https://devzone.nordicsemi.com/f/nordic-q-a/77570/zephyr-project-on-a-custom-board-wont-start-up-after-removing-debugger

    But it did not seem to work for me.

  • I see. So Blinky is also not working. Please continue testing with Blinky, as that is the simplest possible example application and that really should work. As it does not, something is fundamentally wrong.

    1. Can you upload your schematics and layout, and also your Blinky project (with any modifications you have made for your board). That way I can review to see if I see something obvious.
    2. Let me know whatever you find from attempting to debug? What exactly happens? Can you share logs, screenshots, etc, to make tit clearer?
  • Thanks @.

    1. I attached the schematics as well as the custom board I defined withing nrf connect sdk. It was modified from the nrf52840 dongle board definition.

    2. In terms of debugging, I am in a conundrum because the debugger only sees the board in reset mode. I attached the output.

    Additionally, I tried the code on a fresh board. I noticed that prior to installing any code, I can see the chip through the debugger whether the chip is in reset mode or not. However, after flashing the blinky program (which still doesnt work), I noticed the debugger can only see the chip when it's in reset mode. 

Reply
  • Thanks @.

    1. I attached the schematics as well as the custom board I defined withing nrf connect sdk. It was modified from the nrf52840 dongle board definition.

    2. In terms of debugging, I am in a conundrum because the debugger only sees the board in reset mode. I attached the output.

    Additionally, I tried the code on a fresh board. I noticed that prior to installing any code, I can see the chip through the debugger whether the chip is in reset mode or not. However, after flashing the blinky program (which still doesnt work), I noticed the debugger can only see the chip when it's in reset mode. 

Children
  • Can you elaborate by what you mean by chip being in "reset mode"? Anyway, looking at the screenshot it looks like you are able to debug, and you get a SIGTRAP at 0xFFFFFFFE, which indicates you gat a hard fault for some reason.

  • By reset mode I meant flipping the nreset pin which can be seen on our schematic. I attached a screenshot highlighting it.


    I am using the base blinky program. I wonder there is a hard fault. Maybe it’s the board configuration but I’m pretty sure I left most aliases the same so it would be compatible with the demo blinky out of the box  ( ex: left led 0 with the same name but changed the pin to match our board) 

  • Ah, so you mean that you can "debug" when reset is asserted (held low)? At that point the CPU is not running, though (and in fact most of the IC is in an undefined state while the reset pin is asserted).

    hmahdi said:
    I am using the base blinky program. I wonder there is a hard fault.

    Yes, it looks like it. Can you upload the full project including any modifications you have done so that I can take a look (in your previous upload I saw the board file etc but not the blinky project etc)? It could also make sense to remove your board specific code just for simplicity to try to narrow down the issue.

  • I have not modified the blinky program at all. It should work because I created an LED with the same alias in the device tree. Here is the .dts file which I think is most relevant from the board defintion so it's simpler to sift through.

  • Hi,

    I do not see anything sticking out in your dts.

    I just remember one thing though, and checking that I see an issue. In your Kconfig and Kconfig.defconfig you have BOARD_HAS_NRF5_BOOTLOADER and FLASH_LOAD_OFFSET etc. This is inherited from the nRF52840dongle_nrf52840, and is becaue this dongle ships with a nRF5 SDK bootloader, where the first page is the MBR. As you write that you see the board in bootlaoder mode I assume you flashed the nRF5 SDK bootloader on your custom board as well? If not (for instance you are using another bootlaoder, like MCUBoot), this is not correct and should be removed. It is generally only sensible for the nrf52840 dongle, and not other (though similar) boards.

Related