Skip to content

JustAnother1/nomagic_probe

Repository files navigation

nomagic probe

The nomagic probe is a firmware for the RaspberryPi Pico board that provides a gdbserver interface for debugging other boards. That is the functionality of the picoprobe and OpenOCD combined. It is also similar to the Black Magic Firmware.

It does not use external libraries. Therefore all code is in this library, no dependencies!

No dynamic memory allocation, no malloc!

features

  • USB CDCD(serial port) gdb server

  • USB MSCD(thumb drive) for configuration files.

  • support for SWD according to ARM ADIv5.0, ARM ADIv5.1, ARM ADIv5.2, ARM ADIv6.0.

targets

this is only the parent repository. The seperate use cases / target have their own repositories:

  • DETECT command line interface on USB serial port. This allows analysis of unsupported chips.

  • RP2040 SWD connection to a RaspberryPi RP2040

documentation

Additional documentation can be created

make doc

the created documentation is then located in the bin/doxygen/ folder.

building and starting

The firmware can be build using make. The generated Files will be placed in the bin folder. For details try

make help

for this to work you (obviously) need to have make installed. Depending on the target you are building for you might need to have additionaltools installed:

  • To build for ARM Cortex-M Targets you need GCC ARM Embedded

  • to flash and program you need OpenOCD

  • to create an *.uf2 file you need elf2uf2

  • for automatic generated documentation you need Doxygen

pinout

pico

The pico has 40 pins (1..40) Numbered counter clock wise starting at the USB connector.

                  +-----+
           +-------+ USB +---------+
   GPIO 0 -+- 1    +-----+     40 -+- Vbus
   GPIO 1 -+- 2                39 -+- Vsys
      Gnd -+- 3                38 -+- Gnd
   GPIO 2 -+- 4                37 -+- 3V3_EN
   GPIO 3 -+- 5                36 -+- 3V3(Out)
   GPIO 4 -+- 6                35 -+- ADC-Vref
   GPIO 5 -+- 7                34 -+- GPIO 28
      Gnd -+- 8                33 -+- Gnd
   GPIO 6 -+- 9                32 -+- GPIO 27
   GPIO 7 -+- 10               31 -+- GPIO 26
   GPIO 8 -+- 11               30 -+- Run = /Reset
   GPIO 9 -+- 12               29 -+- GPIO 22
      Gnd -+- 13               28 -+- Gnd
  GPIO 10 -+- 14               27 -+- GPIO 21
  GPIO 11 -+- 15               26 -+- GPIO 20
  GPIO 12 -+- 16               25 -+- GPIO 19
  GPIO 13 -+- 17               24 -+- GPIO 18
      Gnd -+- 18               23 -+- Gnd
  GPIO 14 -+- 19               22 -+- GPIO 17
  GPIO 15 -+- 20     Debug     21 -+- GPIO 16
           +-----------------------+
                   S  G  S
                   W  n  W
                   C  d  D
                   L     I
                   K     O

Pin 2: (GPIO 1) SWDIR (High = from Probe to target; Low= from Target to probe)

Pin 4: (GPIO 2) SWCLK

Pin 5: (GPIO 3) SWDIO

Pin 6: (GPIO 4) Target Uart TX (UART1) - output from PC - connect to target RX

Pin 7: (GPIO 5) Target Uart RX (UART1) - input to PC - connect to target TX

Pin 9: (GPIO 6) Run = /Reset

Pin 21: (GPIO 16) Debug Uart TX (UART0)

Pin 22: (GPIO 17) Debug Uart RX (UART0)

Acknowledgments

This project would not be possible without many other open source projects. Especially OpenOCD and the black magic probe firmware were great sources of inspiration. This project relies on gcc for ARM Cortex-M, gdb, lcov, doxygen, make and many more. For all this help we want to thank the Linux and open source community.

license

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License version 2
as published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License along
with this program; if not, see <http://www.gnu.org/licenses/>

tinyusb is under he following license

The MIT License (MIT)

Copyright (c) 2018, hathach (tinyusb.org)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

lwip is under he following license

Copyright (c) 2001, 2002 Swedish Institute of Computer Science.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice,
   this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
   this list of conditions and the following disclaimer in the documentation
   and/or other materials provided with the distribution.
3. The name of the author may not be used to endorse or promote products
   derived from this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
OF SUCH DAMAGE.