As an embedded software engineer, one of the most commonly used tools, in addition to the integrated development environment (IDE), is:
- Debugger/Emulator: Debuggers and emulators are used to connect to the target embedded system to monitor real-time program execution and internal states. Through these tools, engineers can schedule code execution step by step, view variables, and debug hardware registers, among other things. Common debuggers include:
- Segger J-Link
- ST-Link
- Black Magic Probe
- DAP-Link
- Serial Tools: Serial tools are used to send debugging information (such as variable values, status information, error messages, etc.) over a serial connection to a host computer. This information helps engineers understand the operational status of the embedded system and identify issues. (Serial debugging is a fundamental debugging method in embedded system development. In practical applications, more advanced debugging tools and methods, such as using a debugger to connect to the target board for hardware-level debugging or using Real-Time Transfer (RTT) and other advanced debugging techniques, may be used.)
Currently, the main USB to TTL modules used are USB2TTL modules, with the main chips being:
- cp210x
- Mostly domestically produced CH340.
For everyday development, only one debugger and one serial module are required. However, for module development and development involving multiple CPUs/multiple boards, multiple sets of debuggers and serial modules may be needed. Your USB hub provides only a limited number of ports. Challenges to address:
- The need for more USB ports to connect debugging tools; therefore, an additional USB HUB may be required.
- More DuPont wires to connect development boards.
- Expensive debuggers (such as J-LINK) may need to be configured for multiple instances.
Referenced internet implementation
PicoXTools can be directly inserted into the 20-pin male header of J-LINK. No additional ribbon cable connection is required; 1-to-4 functionality is achieved through a dual-pole four-throw simulated switch (SWD/cJTAG), with only one channel being active at any given moment.
Excellent performance, a thriving community environment, Based on Raspberry Pi RP2040, the main features of RP2040 include:
- Dual-core M0+ cores capable of running at over 133MHz.
- Memory: It has 264KB of SRAM built-in.
- RP2040 supports USB connectivity and can act as both a USB host and USB device, with good portability for TinyUSB.
- PIO (Programmable Input/Output) can emulate various peripherals such as Ethernet MAC, VGA, HDMI, and other proprietary peripherals, similar to FPGA functionality.
- Excellent community support with numerous geeks developing interesting projects based on it, such as oscilloscopes and logic analyzers.
The DAP-Link (pic-probe) officially implemented by Raspberry Pi can be used to debug RP2040 itself. Combined with OpenOCD, it can debug a wider range of MCUs. Four target devices can be selected for debugging through a dial and a dual-pole four-throw simulated switch. When an external JLINK is inserted (determined by a high level on the second pin of JLINK's VCC), PicoXTools' four SWD/cJTAGE pins will be routed to the external JLINK instead of pic—probe.
PicoXTools features a 4-port USB 2.0 HUB, with two of them dedicated to the RP2040 with ch344 and the remaining two ports available for external USB devices, with a mainstream TYPE-C interface.
While RP2040 has a USB interface that can implement USB to TTL through software, it is embarrassing not to have serial output when RP2040 goes awry as a development tool. Therefore, an independent CH344Q chip is attached to the USB-HUB, separate from the SOC. Of course, you can add additional serial interfaces using software and Pico's PIO.
We can use the built-in Web Server to operate the RP2040 hardware I2C interface and debug I2C devices on the expansion board, such as temperature and humidity sensors, SS1306 OLED displays, etc.
We can use the built-in Web Server to operate the RP2040 hardware SPI interface and debug SPI devices on the expansion board, such as LoRa modules.
- Easily extensible commands
- Command completion
- Command history
- Integrated littlefs/Fatfs, supporting basic file system commands such as ls, cd, copy, rm, mkdir, etc.
- Includes a Vi editor based on busybox, allowing you to directly edit programs and configuration files in the command line using vi.
- Supports X and YModem protocol file transmission.
- NDIS/ECM network card and MSC disk based on TinyUSB
- Offline burning
- A JIT C compiler based on AMaCC (https://github.com/jserv/amacc) and C4 (https://github.com/rswier/c4)
The generated files can be executed directly in the PicoXTools shell.
- Supported scripting languages
- Python This one goes without saying; Python is natively supported for Pico development.
- Lua The scripting language with the highest degree of integration with C.
- C (based on AMaCC & c4) The ultimate glue language is C.
- Javascript JavaScript is one of the most widely used programming languages in the development community. It is a high-level, dynamic, weakly typed programming language used extensively in: >> - Front-end and back-end web development >> - Mobile applications >> - Desktop applications >> - Data visualization (e.g., D3.js) >> - Game development >> - Cloud computing and the Internet of Things (IoT) In this context, we mainly discuss the application of JS in the embedded field.
Supports most of the standard library and PICO's SDK, allowing for quick API verification. You can compile and execute directly on Pico.
Upstream interface for the HUB.
USB HUB downstream ports.
Standard JTAG 20-pin female header
HUB uplink port.
USB HUB Downlink ports.
Standard JTAG 20-pin female connector.
CLK | SWD | GND | 3V3 |
---|
External expansion interface
3V3 | pico-CLK | pico-swd | GPIO-26 | GPIO-26 | UART0-tx | UART0-rx |
---|---|---|---|---|---|---|
GND | GPIO-5 | GPIO-4 | GPIO-11 | GPIO-10 | UART0-9 | UART0-8 |
4 of UART&SWD ports interface.
3V3 | RX0 | TX0 | 3V3 | RX2 | TX2 | 3V3 | RX2 | TX2 | 3V3 | RX3 | TX3 |
---|---|---|---|---|---|---|---|---|---|---|---|
GND | CLK0 | SWD0 | GND | CLK2 | SWD2 | GND | CLK2 | SWD2 | GND | CLK3 | SWD3 |
The project did not reinvent the wheel from scratch but wholeheartedly embraced the open-source community. The open-source community has provided us with invaluable resources and tools. Thousands of open-source libraries, frameworks, and tools cover various fields, from frontend to backend, from databases to artificial intelligence. Having these open-source resources allows us to stand on the shoulders of giants and rapidly build feature-rich, efficient, and stable applications.
thanks for:
- Shell && vi && cc
Weixin | |
---|---|