博文

How to erase chip in STM32CubeIDE?

图片
 To erase the flash of an STM32 “chip” from STM32CubeIDE , you basically use the built-in STM32CubeProgrammer backend. Here’s the standard way, step by step. 1. Full-chip erase from STM32CubeIDE A) Using the Run/Debug configuration (most common) Connect your board Plug in your STM32 board via ST-LINK (or built-in debugger on Nucleo / Discovery ). Make sure drivers are installed and the board shows up in CubeIDE. Open Run/Debug configurations In the menu: Run → Run Configurations… or Run → Debug Configurations… (both dialogs are similar). Select your project/MCU config In the left tree, under STM32 Cortex-M C/C++ Application , click your project’s configuration. Go to the “Startup” or “Debugger” tab (name slightly varies by version) Look for a section like “Initialization” or “Load/Erase” . Enable Flash erase You will see options such as: “Reset behaviour” (Connect under reset, etc.) “Erase Flash” or “Flash Download” option...

What format does a makefile have to be while uploading it on a FPGA board?

图片
Short answer: you don’t upload a Makefile to an FPGA at all. An FPGA never “sees” your Makefile—only the bitstream (or similar config file) that the tools generate from your HDL. What’s actually going on Makefile Plain text file for your PC, read by make (GNU make, nmake, etc.). It just tells the host tools what commands to run: synthesize HDL run place & route generate bitstream optionally call the programmer to flash the FPGA FPGA input The FPGA only gets a configuration file , typically something like: Xilinx : .bit , .bin , sometimes .mcs Intel/Altera : .sof , .pof , .rbf Lattice : .jed , .bit , etc. So there is no special “format” for the Makefile for the FPGA . The format requirement is simply: It must be a valid Makefile syntax for make on your PC. Stored as plain text (no Word, no PDF, etc.). Usually named Makefile or makefile so make finds it automatically. Typical flow You write Makefile with rules like: # ...

How to power Raspberry Pi 5?

图片
 To power a Raspberry Pi 5 safely and reliably, treat it more like a small PC than a toy board. Here’s what you need and what not to do. 1. Official / recommended way (best choice) Use a USB-C 5V / 5A PD power supply The Raspberry Pi 5 is designed for: 5 V, up to 5 A via USB-C The official Raspberry Pi 5 PSU is: 27 W USB-C PD (5 V at up to 5 A), and it negotiates PD correctly for the board + USB devices. Why this matters: Pi 5 can draw much more current than older models, especially with: USB SSDs Cameras, HATs, Wi-Fi load, CPU+GPU under stress A random 5 V / 3 A phone charger may: Not negotiate PD correctly Drop voltage under load → crashes, throttling, SD corruption So: Best practice: Use the official Raspberry Pi 5 power supply (or a high-quality USB-C PD PSU that supports 5 V / 5 A and is known to work with Pi 5). 2. Can I use a normal phone charger? Short version: Maybe, but not recommended . If it is USB-C PD and...

How to get microcontroller stuck on breadboard out?

图片
 Unplug everything first, then treat it like a fragile LEGO brick, not a nail you yank out. Here’s a safe way to free a stuck DIP microcontroller from a breadboard without wrecking the pins or the board. 1. Before you start Power off & unplug Remove USB, battery , bench supply – everything . Remove all jumper wires from that IC It’s much easier to pull straight when nothing is tugging on the pins. 2. Best method: lift a little from each side If you have proper tools IC extractor or IC puller Hook onto both ends of the package. Pull straight up , very gently, rocking side-to-side by 1–2 mm max until it walks out. If you don’t have an extractor (common case) Use two small flat tools : tiny flat screwdriver metal spudger butter knife / guitar pick (careful!) Steps: Insert tool on one long side Slide the tip between the plastic body of the MCU and the breadboard top, not under the pins. Gently twist or lever Aim...

How to program an Arduino?

图片
  You “program” an Arduino by writing a sketch (a C/C++ program), compiling it, and uploading it to the board over USB. Let’s walk it from zero to blinking LED. 1. What you need An Arduino board (Uno, Nano, Mega, etc.) USB cable that matches your board (Uno: USB-B, newer: USB-C/micro-USB) A computer (Windows / macOS / Linux) Arduino IDE installed If you don’t have the IDE yet, download it from the official Arduino site (Arduino IDE 2.x). Install it like any normal app. 2. Connect the Arduino Plug the USB cable into the Arduino and your computer. The power LED on the Arduino should turn on. Windows may install a driver automatically; on macOS and Linux it usually just works. 3. Open the Arduino IDE and select your board Start Arduino IDE . Go to Tools → Board and choose your board, for example: Arduino Uno Arduino Nano Arduino Mega or Mega 2560 , etc. Go to Tools → Port and pick the port that shows something like: COM3 (...

How to boot stm32 Blue Pill?

图片
 On the STM32 “Blue Pill”, “booting” basically means: Power the board correctly Put it in the right boot mode (BOOT0/BOOT1) Have valid firmware in flash I’ll walk you through the typical ways to boot it. 1. Powering the Blue Pill (don’t skip this) The board has an STM32F103C8 (or CB) + a 3.3 V regulator. You can power it in three safe ways : Via USB port (Mini-USB) Plug into USB → board gets 5 V → regulator makes 3.3 V for the MCU. Via 5V pin Feed regulated 5 V into the 5V pin, GND to GND. Direct 3.3 V Feed 3.3 V into 3.3V pin, GND to GND (bypasses regulator). ⚠️ Never put 5 V on the 3.3 V pin → instant blue smoke risk. If power is good, the red power LED should light. 2. Boot mode basics: BOOT0 & BOOT1 The STM32 decides where to boot from using BOOT0 and BOOT1 at reset: On the Blue Pill: BOOT0 is broken out with a jumper. BOOT1 (PB2) is usually fixed low (GND) with a resistor. So the useful modes are: BO...

How to power on DE10 FPGA?

图片
 To power on a Terasic DE10 FPGA board , you mainly need the right power source and the correct switch/jumper settings. I’ll cover the common boards (DE10-Nano, DE10-Lite, DE10-Standard). The exact steps are very similar. 1. Identify which DE10 board you have Look at the silkscreen on the PCB: “DE10-Nano” (with HPS/ARM and RJ45 Ethernet) “DE10-Lite” (small, MAX 10 FPGA, usually used in courses) “DE10-Standard” (larger, Cyclone V , more connectors) If you’re not sure, follow the section that visually matches what you see. 2. DE10-Nano – how to power it on The DE10-Nano can be powered in two main ways : Option A: Via DC barrel jack (recommended for heavy loads) Use a 5V regulated DC adapter , usually 5V / 2A (check label on board or kit PSU). Plug the adapter into the DC jack on the board. Make sure the power select jumper (often labeled JP3 / PWR or similar) is set to DC IN / EXT (depends on revision). Slide the ON/OFF switch (if present) t...