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

extra Hardware needed to debugging nRF52832 through USB ?

Hi, maybe my question is a little basic, but this is my first time developing with a Nordic chip, i have been reading how to debug a nrf52 based device, and i know that i must upload a custom bootloader if i want to debug my device through USB or UART, my question is about HW,
as i understand i need a USB to UART chip to debugging the device through UART, but if i want to debug my device through SWD interface but using a USB connection on my board , additionally to upload the bootloader,must i have a USB to SWD chip integrated to my board to achieve the communication?

Thanks for reading 

Best regard

  • Thanks for the information, I did not know about those IDEs, just segger, I will take them into account 

  • ok thanks for clarify my doubt, i was pretty confused about that. So for the first FW upload i must do it over SWD interface and i can use DFU over the air for update FW right?

  • The OP is clearly a beginner, so it will be much easier for her/him to get started with a supported IDE

    Being a beginner is not an excuse.  Whether you're beginner or not, there is always a leaning curve in any environment.  SES or Eclipse, both use the same tool same compiler.  Search the forum and see how many people having issues when they move beyond the example and start working on their own projects.  It is not any harder using Eclipse now a days.  It is just a mater of tastes.  If you are an embedded software engineer and wants to make a career out of it, you are likely to need to work with other MCU vendors such as TI, NXP, Freescale (NXP), ST (STM32)... Guess what all those vendors also provide you with free IDE.  OMG they are all Eclipse!  Unless you are a Nordic only developper, you are likely to have to learn to use Eclipse anyway.  None of them provides you SES.

        

  • None of them provides you SES

    But what they do is provide you with a configured and ready-to-go IDE (based on Eclipse).

    And none of those vendor-customised IDEs is going to work well with other vendors chips.

  • When you have an nRF52 chip that is brand new, its flash will be completely blank. This means it won't have a pre-existing boot loader in it. When you power it up, it'll just sit there unable to do anything. So yes: for a blank chip, the only way to program the flash is using an external SWD debug tool. Once you have programmed it the first time with an image which is able to perform firmware updates on its own, then you can load new code using that mechanism instead.

    That said:

    - If your application code wipes or corrupts the flash, you'll need the debug tool to recover it.

    - The debugger is immensely useful when writing your own software for the MCU. You can use it to examine the CPU state and memory and step through your code line by line (or instruction by instruction) to see what it's doing.

    Without the debugger you'd have to rely on adding lots of printf()s to your code, which can be effective but it's slow going.

    BTW, my preference is to use an completely open source toolchain, including the latest versions of GCC, binutils, GDB, newlib and OpenOCD. You can compile these from the original GNU sources. For the most part, the trick is to configure them using --target=arm-none-eabi.

    Also, there is a free ARM IDE which should work with the nRF52 chip:

    https://gnu-mcu-eclipse.github.io/

    You will want to download the GNU MCU ARM GCC toolchain, which includes binaries of GCC, GDB and binutils. (There's versions for Linux, Windows and MacOS.) You will also want the GNU MCU OpenOCD installation. OpenOCD is what talks to the SWD debug tool and provides support for GDB (or Eclipse) to debug the board.

    -Bill

Related