I am new to embedded and stm32cubeide, self teaching so I can use it in a group project related to university studies.
After purchasing a "blue pill" from aliexpress, I realized I might of bought a clone chip. I followed the instructions shown here (stm32 community site), and I'm still getting an error that the ide cannot verify my ST device.
Here is what I have as output:
Open On-Chip Debugger 0.11.0+dev-00443-gcf12591 (2022-02-09-13:33) [ST Internal]
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
swv
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : STLINK V2J39S7 (API v2) VID:PID 0483:3748
Info : Target voltage: 3.286227
Info : clock speed 4000 kHz
Info : stlink_dap_op_connect(connect)
Info : SWD DPIDR 0x2ba01477
Info : STM32F103C8Tx.cpu: Cortex-M3 r2p1 processor detected
Info : STM32F103C8Tx.cpu: target has 6 breakpoints, 4 watchpoints
Info : starting gdb server for STM32F103C8Tx.cpu on 3333
Info : Listening on port 3333 for gdb connections
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x20036410
Info : flash size = 128kbytes
Warn : GDB connection 1 on target STM32F103C8Tx.cpu not halted
undefined debug reason 8 - target needs reset
O.K.
O.K.:0xE00FFFD0
Info : dropped 'gdb' connection
shutdown command invoked
I see in the console "undefined debug reason 8 - target needs reset", is this the problem? If so what can I do to solve this? If not, then what do I do other than purchasing another board?
Below is my test Debug.cfg, in case I need to change something in there:
# This is an genericBoard board with a single STM32F103C8Tx chip
#
# Generated by STM32CubeIDE
# Take care that such file, as generated, may be overridden without any early notice. Please have a look to debug launch configuration setup(s)
source [find interface/stlink-dap.cfg]
set WORKAREASIZE 0x5000
transport select "dapdirect_swd"
set CHIPNAME STM32F103C8Tx
set BOARDNAME genericBoard
# Enable debug when in low power modes
set ENABLE_LOW_POWER 1
# Stop Watchdog counters when halt
set STOP_WATCHDOG 1
# STlink Debug clock frequency
set CLOCK_FREQ 4000
# Reset configuration
# use software system reset if reset done
reset_config none
set CONNECT_UNDER_RESET 0
set CORE_RESET 0
# ACCESS PORT NUMBER
set AP_NUM 0
# GDB PORT
set GDB_PORT 3333
# BCTM CPU variables
source [find target/stm32f1x.cfg]
# SWV trace
set USE_SWO 0
set swv_cmd "-protocol uart -output :3344 -traceclk 16000000"
source [find board/swv.tcl]
Thanks
I found some FT232 that I had in spare, and I was able to program the chip using the stm32 programmer software and a generated hex file from the ide.
I'll use this method if ever I run into cloned chips and the st link v2 if ever I get a genuine board.
Related
I am debugging board STM32f4 Discovery on Ubuntu 20.04 with openocd and arm-none-eabi-none. Things work well until yesterday. Today, when I connect the gdb to localhost:4444, following assertion happened and ocd quit:
Open On-Chip Debugger 0.10.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : The selected transport took over low-level target control. The results might differ compared to plain JTAG/SWD
adapter speed: 2000 kHz
adapter_nsrst_delay: 100
none separate
srst_only separate srst_nogate srst_open_drain connect_deassert_srst
Started by GNU MCU Eclipse
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : Unable to match requested speed 2000 kHz, using 1800 kHz
Info : clock speed 1800 kHz
Info : STLINK v2 JTAG v37 API v2 SWIM v26 VID 0x0483 PID 0x374B
Info : using stlink api v2
Info : Target voltage: 2.894743
Info : stm32f4x.cpu: hardware has 6 breakpoints, 4 watchpoints
Info : accepting 'gdb' connection on tcp/3333
Info : device id = 0x100f6413
Info : flash size = 8194kbytes
openocd: src/flash/nor/stm32f2x.c:990: stm32x_probe: Assertion `(bank->size >> 10) == flash_size_in_kb' failed.
I see that it is using stm32f2x.c, is it correct since the chip is stm32f407vgt?
I found the issue: I scale up the clock speed without switching to appropriate Flash Latency so the debugger will lose the track of program address as mentioned here, in Clocks and initial settings part:
https://vjordan.info/log/fpga/first-steps-with-the-stm32f4.html
How to parse or add or delete the node
How do you add a node like this
af-packet:
- interface: eth1
- interface: eth2
- interface: eth3
how to delete - interface: eth1 or delete all interface
af-packet:
- interface: eth1
- interface: eth2
- interface: eth3
how to save comment?
std::ofstream file(strSuricatatFilename);
file << suricateCfg;
file.close();
Such code comments will disappear
Can I keep the first two lines?
whole file:
%YAML 1.1
---
# Suricata configuration file. In addition to the comments describing all
# options in this file, full documentation can be found at:
# https://suricata.readthedocs.io/en/latest/configuration/suricata-yaml.html
##
## Step 1: inform Suricata about your network
##
af-packet:
- interface: eth1
- interface: eth6
#- interface: eth0
# Number of receive threads. "auto" uses the number of cores
#threads: auto
# Default clusterid. AF_PACKET will load balance packets based on flow.
cluster-id: 99
# Default AF_PACKET cluster type. AF_PACKET can load balance per flow or per hash.
# This is only supported for Linux kernel > 3.1
# possible value are:
# * cluster_flow: all packets of a given flow are send to the same socket
# * cluster_cpu: all packets treated in kernel by a CPU are send to the same socket
# * cluster_qm: all packets linked by network card to a RSS queue are sent to the same
# socket. Requires at least Linux 3.14.
# * cluster_ebpf: eBPF file load balancing. See doc/userguide/capture-hardware/ebpf-xdp.rst for
# more info.
# Recommended modes are cluster_flow on most boxes and cluster_cpu or cluster_qm on system
# with capture card using RSS (require cpu affinity tuning and system irq tuning)
cluster-type: cluster_flow
# In some fragmentation case, the hash can not be computed. If "defrag" is set
# to yes, the kernel will do the needed defragmentation before sending the packets.
defrag: yes
# To use the ring feature of AF_PACKET, set 'use-mmap' to yes
thanks.
I'm having trouble using OpenOCD to flash the firmware on a at91sam7s512 micro-controller.
Whenever I send a halt command (via telnet) it throws the following error:
Halt timed out, wake up GDB.
timed out while waiting for target halted
in procedure 'halt'
The board is a Proxmark3 Easy
Below is the configuration file being used:
# Ports
telnet_port 4444
gdb_port 3333
# Interface
interface buspirate
buspirate_port /dev/ttyUSB0
adapter_khz 1000
# Communication speed
buspirate_speed normal # or fast
# Voltage regulator: enabled = 1 or disabled = 0
buspirate_vreg 1
# Pin mode: normal or open-drain
buspirate_mode normal
# Pull-up state: enabled = 1 or disabled = 0
buspirate_pullup 1
# use combined on interfaces or targets that can't set TRST/SRST separately
reset_config srst_only srst_pulls_trst
jtag newtap sam7x cpu -irlen 4 -ircapture 0x1 -irmask 0xf -expected-id 0x3f0f0f0f
target create sam7x.cpu arm7tdmi -endian little -chain-position sam7x.cpu
sam7x.cpu configure -event reset-init {
soft_reset_halt
mww 0xfffffd00 0xa5000004 # RSTC_CR: Reset peripherals
mww 0xfffffd44 0x00008000 # WDT_MR: disable watchdog
mww 0xfffffd08 0xa5000001 # RSTC_MR enable user reset
mww 0xfffffc20 0x00005001 # CKGR_MOR : enable the main oscillator
sleep 10
mww 0xfffffc2c 0x000b1c02 # CKGR_PLLR: 16MHz * 12/2 = 96MHz
sleep 10
mww 0xfffffc30 0x00000007 # PMC_MCKR : MCK = PLL / 2 = 48 MHz
sleep 10
mww 0xffffff60 0x00480100 # MC_FMR: flash mode (FWS=1,FMCN=72)
sleep 100
}
gdb_memory_map enable
#gdb_breakpoint_override hard
#armv4_5 core_state arm
sam7x.cpu configure -work-area-virt 0 -work-area-phys 0x00200000 -work-area-size 0x10000 -work-area-backup 0
flash bank sam7x512.flash.0 at91sam7 0 0 0 0 sam7x.cpu 0 0 0 0 0 0 0 18432
flash bank sam7x512.flash.1 at91sam7 0 0 0 0 sam7x.cpu 1 0 0 0 0 0 0 18432
What steps can be taken to troubleshoot this
Two alternatives are open to you, JTAG and USB.
JTAG
The JTAG interface is disabled by default on some CPUs and needs to be manually enabled due to their Code Readout Protection (CRP).
To do this, you need to erase the chip by shorting PIN 55 (ERASE) with the 3.3V while the device is on.
After this the memory will be erased and protections off. You can then flash as normal.
Sources
Proxmark Forum
http://www.proxmark.org/forum/viewtopic.php?id=6306
Official CPU Documentation, section 4.9.3
http://www.equinox-tech.com/downloads/equinox/ApplicationNotes/AN122%20Atmel%20AT91SAM7%20ISP%20Programming_V1-13_250110.pdf
USB
Alternatively, you could try the process over USB instead.
First check if the Proxmark is detected when plugged in.
Run the watch command to see if any changes occur when you plug it in.
watch ls -l /dev/ttyACM0
Hold the button on the side of the Proxmark down THEN connect via USB and check if the command output for watch changes. If it did and the file becomes present, you can go ahead with this.
Be sure to leave the button pressed until the flashing process is complete.
You are required to have compiled the Proxmark3 source found at official repo https://github.com/Proxmark/proxmark3 to get both the tool for flashing (flasher) and the flash images (bootrom.elf and fullimage.elf). If you have already continue with Flashing, if not do Compilation steps below first.
Flashing
Do NOT press Enter during the flashing process
./client/flasher /dev/ttyACM0 -b bootrom/obj/bootrom.elf armsrc/obj/fullimage.elf
Start the Proxmark Client and test if works
./client/proxmark3 /dev/ttyACM0
Compilation
Add current user to dialout group
sudo adduser $USER dialout
Log out and log back in for changes to take effect
Install necessary components
sudo apt-get install p7zip git build-essential libreadline5 libreadline-dev libusb-0.1-4 libusb-dev libqt4-dev perl pkg-config wget libncurses5-dev gcc-arm-none-eabi libstdc++-arm-none-eabi-newlib
Clone repo
git clone https://github.com/proxmark/proxmark3.git
cd proxmark3
Add Udev rules
sudo cp -rf driver/77-mm-usb-device-blacklist.rules /etc/udev/rules.d/77-mm-usb-device-blacklist.rules
sudo udevadm control --reload-rules
Make
make clean && make all
Identify Proxmark3 on tty interface (usually this is ttyACM0 and this is what I'll use in Flashing)
dmesg | grep -i usb
Continue to Flashing steps
Source https://wiki.elvis.science/index.php?title=Proxmark3:_Debricking (Linux Installation)
Swap the MISO and MOSI lines. For my Bus Pirate v3 and Proxmark3 Easy the correct connections were:
TMS <-> CS
TDI <-> MOSI
TDO <-> MISO
TCK <-> CLK
GND <-> GND
+3.3 <-> +3.3
I'm running Virtualbox 5.1.14 r112924 on a Windows 7 Professional machine. I have installed a Debian Testing guest. Several days ago I tried to save the machine, unfortunately I do not recall the exact circumstances, but I think it had to do with the guest having no network any more after the host came back from suspend-to-RAM.
Anyway, I now have a saved machine with which I cannot do anything: I cannot start it, I cannot delete the saved state, I cannnot clone it and I cannot even delete the entire machine. All these options are greyed out in the VB Manager window. Also, I don't get any errors, so I'm rather clueless what to do.
I include below parts of the most recent log file which I thought are relevant, I didn't want to paste the whole thing.
What sort of witchcraft can bring my machine back to life?
Many thanks, and best regards,
Enno
02:37:32.316550 Changing the VM state from 'RUNNING' to 'SUSPENDING'
02:37:32.319680 AIOMgr: Endpoint for file 'D:\Users\EnnoMiddelberg\VirtualBox VMs\Debian_Testing\Debian_Testing.vdi' (flags 000c0781) created successfully
02:38:32.373466 PDMR3Suspend: 60 056 883 803 ns run time
02:38:32.373494 Changing the VM state from 'SUSPENDING' to 'SUSPENDED'
02:38:32.373520 Console: Machine state changed to 'Paused'
02:38:32.373700 VMR3Suspend:
02:38:32.393131 RUNNING -> SUSPENDING, RUNNING_LS -> SUSPENDING_EXT_LS failed, because the VM state is actually SUSPENDED
02:38:32.393177 VMSetError: F:\tinderbox\win-5.1\src\VBox\VMM\VMMR3\VM.cpp(3619) int __cdecl vmR3TrySetState(struct VM *,const char *,unsigned int,...); rc=VERR_VM_INVALID_VM_STATE
02:38:32.452926 VMSetError: VMR3Suspend failed because the current VM state, SUSPENDED, was not found in the state transition table (old state RUNNING_LS)
02:38:32.501235 ERROR [COM]: aRC=VBOX_E_VM_ERROR (0x80bb0003) aIID={872da645-4a9b-1727-bee2-5585105b9eed} aComponent={ConsoleWrap} aText={Could not suspend the machine execution (VERR_VM_INVALID_VM_STATE)}, preserve=false aResultDetail=0
02:38:32.605107 Console: Machine state changed to 'Saving'
02:38:32.635604 Changing the VM state from 'SUSPENDED' to 'SAVING'
02:38:32.747945 VUSB: Detached 'HidMouse' from port 1
02:38:40.213749 SSM: Footer at 0x23d179e4 (600930788), 34 directory entries.
02:38:40.213777 VUSB: Attached 'HidMouse' to port 1
02:38:40.231560 SSM: Successfully saved the VM state to 'D:\Users\EnnoMiddelberg\VirtualBox VMs\Debian_Testing\Snapshots\2017-05-23T14-48-18-411341300Z.sav'
02:38:40.231578 Changing the VM state from 'SAVING' to 'SUSPENDED'
02:38:40.316839 Console::powerDown(): A request to power off the VM has been issued (mMachineState=Saving, InUninit=0)
02:38:40.342613 Display::handleDisplayResize: uScreenId=0 pvVRAM=000000000c0a0000 w=1920 h=1106 bpp=32 cbLine=0x1E00 flags=0x1
02:38:40.342664 GUI: UIFrameBufferPrivate::NotifyChange: Screen=0, Origin=0x0, Size=1920x1106, Sending to async-handler
02:38:40.350656 Changing the VM state from 'SUSPENDED' to 'POWERING_OFF'
02:38:40.356473 ****************** Guest state at power off for VCpu 0 ******************
...
...
...
02:38:40.406031 ************** End of Guest state at power off ***************
02:38:41.753488 PDMR3PowerOff: Driver 'AUDIO'/0 on LUN#0 of device 'ichac97'/0 took 1 344 979 632 ns to power off
02:38:41.753791 PDMR3PowerOff: 1 347 726 353 ns run time
02:38:41.762544 Changing the VM state from 'POWERING_OFF' to 'OFF'
02:38:41.983956 Changing the VM state from 'OFF' to 'DESTROYING'
02:38:41.984097 ************************* Statistics *************************
...
...
...
02:38:41.990221 ********************* End of statistics **********************
02:38:41.997747 VUSB: Detached 'HidMouse' from port 1
02:38:42.377555 NAT: Zone(nm:mbuf_cluster, used:90)
02:38:42.378711 NAT: Zone(nm:mbuf_packet, used:90)
02:38:42.378737 NAT: Zone(nm:mbuf, used:90)
02:38:42.378763 NAT: Zone(nm:mbuf_jumbo_pagesize, used:0)
02:38:42.379768 NAT: Zone(nm:mbuf_jumbo_9k, used:0)
02:38:42.380260 NAT: Zone(nm:mbuf_jumbo_16k, used:0)
02:38:42.380639 NAT: Zone(nm:mbuf_ext_refcnt, used:0)
02:39:42.706185 GIM: KVM: Resetting MSRs
02:39:42.720224 Changing the VM state from 'DESTROYING' to 'TERMINATED'
02:39:42.723143 Console: Machine state changed to 'Saved'
02:39:42.723504 GUI: Request to close Runtime UI because VM is powered off already.
02:39:42.888614 GUI: Passing request to close Runtime UI from machine-logic to UI session.
Ok, so I got the machine back up by removing the *.sav file in the guest's "Snapshots" subdirectory. It had to sort out its file system when booting, but everything is running as it should now.
Thanks for listening, anyway...
HP Insight Diagnostics Version 8.4.0.3521A (x86_64)
Computer Name: ezsetupsystem3c4a927c9e88
During Device test it gives following error
Total Memory-ECC test Failed
Description- Uncorrectable ECC Events occurred in SEL log Device, Ran on CPU 0
Recommended Repair- Please refer IPMI Sensor Event Log for ECC events
Error Code- 021278
Please help me n finding why is this error coming.
Is it because of WAMP server installation??
This means that the server has a DIMM which has exceeded it's acceptable ECC error count. It's location is denoted in the error. Depending on the platform, you can identify the specific slot. Which HP ProLiant model is this? This is standard warranty repair.
You have faulty memory. To identify the faulty memory run HPS Reports:
http://update.external.hp.com/HPS/HPSreports/
Once completed you have to unzip the archive an open the index.html file insite.
It will collect all hardware information and highlight in
RED
the faulty components.