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

Parents
  • i know that i must upload a custom bootloader if i want to debug my device through USB or UART

    Actually, a bootloader just allows you to load code - it does not give you any debug facilities at all.

  • OK, so to debug my board the only way is through the SWD pins using a j-link or something similar, and to upload code via USB once i have installed a bootloader i need a USB / serial (UART) chip and connect it to any pin previously specified by FW, right? I know that this is may be redundant since i can upload code over the air but my boss insisted on being able to upload code via usb .

  • Yes, this is correct. But please note that you cannot upload code via USB directly, even with a bootloader, as there i no USB support on the nRF52832. You can use a USB-UART bridge though and use a serial bootloader. However, as has explained, this mostly useful in the end product. When you are developing you anyway need a debugger to debug, so you probably want to use that for programming as well.

  • to debug my board the only way is through the SWD pins

    Well, it's not the only way. As already mentioned, you can also use old-school (sic) things like printf, toggling output pins, flashing LEDs, oscilloscopes, logic analysers etc.

    But using SWD will give you a far better view of what is happening internally within the chip - without having to write specific debug code.

    Having said all that, the "old school" methods are still valid and useful and have their place - and, in some cases, can actually be more useful.

    But to not use the SWD on a chip which has it really is folly !

    You really need to learn all these tools & techniques.

    my boss insisted on being able to upload code via usb

    Why? once you have the SWD access in place, it's easier to update via the SWD  than to provide yet another connection via UART!

    As  said, "When you are developing you anyway need a debugger to debug, so you probably want to use that for programming as well"

Reply
  • to debug my board the only way is through the SWD pins

    Well, it's not the only way. As already mentioned, you can also use old-school (sic) things like printf, toggling output pins, flashing LEDs, oscilloscopes, logic analysers etc.

    But using SWD will give you a far better view of what is happening internally within the chip - without having to write specific debug code.

    Having said all that, the "old school" methods are still valid and useful and have their place - and, in some cases, can actually be more useful.

    But to not use the SWD on a chip which has it really is folly !

    You really need to learn all these tools & techniques.

    my boss insisted on being able to upload code via usb

    Why? once you have the SWD access in place, it's easier to update via the SWD  than to provide yet another connection via UART!

    As  said, "When you are developing you anyway need a debugger to debug, so you probably want to use that for programming as well"

Children
Related