# FFTの極大値から周波数を推定する
y=np.append(0, f[maxi[0][1:14]])
x=np.arange(len(y))
# y=mxとして最小二乗法
A = np.vstack([x, np.zeros(len(x))]).T
m, _ = np.linalg.lstsq(A, y, rcond=None)[0]
plt.plot(x,y,'gx',label='peaks of FFT(Rectangular window)')
plt.plot(x,m*x,label='Approximate line by least squares method')
plt.plot(1,m,'ro',label='Estimated frequency')
plt.xlabel('scale of tone')
plt.ylabel('frequency [Hz]')
plt.legend()
print("最小二乗法で推定した周波数", m,"[Hz]")
When running on-premises servers, edge devices, and virtual machines (VMs) in a hybrid environment, SSM Agent gathers a number of system attributes (referred to as the hardware hash) and uses these attributes to compute a fingerprint. The fingerprint is an opaque string that the agent passes to certain Systems Manager APIs. This unique fingerprint associates the caller with a particular on-premises managed node. The agent stores the fingerprint and hardware hash on the local disk in a location called the Vault.
If the current machine attributes don't match the stored hardware hash, SSM Agent computes a new fingerprint, ~. This causes RequestManagedInstanceRoleToken to fail, and the agent won't be able to obtain a role token to connect to the Systems Manager service.
This failure is by design and is used as a verification step to prevent multiple on-premises managed nodes from communicating with the Systems Manager service as the same managed node.
[ec2-user@ip-172-31-47-131 ~]$ sudo dmidecode -t
dmidecode: option requires an argument --'t'
Type number or keyword expected
Valid type keywords are:
bios
system
baseboard
chassis
processor
memory
cache
connector
slot
[ec2-user@ip-172-31-47-131 ~]$ sudo dmidecode -t processor
# dmidecode 3.2
Getting SMBIOS data from sysfs.
SMBIOS 2.7 present.
Handle 0x0401, DMI type4, 35 bytes
Processor Information
Socket Designation: CPU 1
Type: Central Processor
Family: Other
Manufacturer: Intel
ID: F2 060300 FF FB 8B 17
Version: Not Specified
Voltage: Unknown
External Clock: Unknown
Max Speed: 2394 MHz
Current Speed: 2394 MHz
Status: Populated, Enabled
Upgrade: Other
L1 Cache Handle: Not Provided
L2 Cache Handle: Not Provided
L3 Cache Handle: Not Provided
Serial Number: Not Specified
Asset Tag: Not Specified
Part Number: Not Specified
pi@raspberrypi:~ $ cat /proc/cpuinfo | grep Hardware -A10
Hardware : BCM2835
Revision : a020d3
Serial : 000000009cc7694f
Model : Raspberry Pi 3 Model B Plus Rev 1.3
func isSimilarHardwareHash(log log.T, savedHwHash map[string]string, currentHwHash map[string]string, threshold int) bool {
var totalCount, successCount int
isSimilar := true// similarity check is disabled when threshold is set to -1if threshold == -1 {
returntrue
}
// check inputiflen(savedHwHash) == 0 || len(currentHwHash) == 0 {
returnfalse
}
// check whether hardwareId (uuid/machineid) has changed// this usually happens during provisioningif currentHwHash[hardwareID] != savedHwHash[hardwareID] {
isSimilar = false
} else {
// check whether ipaddress is the same - if the machine key and the IP address have not changed, it's the same instance.if currentHwHash[ipAddressID] == savedHwHash[ipAddressID] {
} else {
// identify number of successful matchesfor key, currValue := range currentHwHash {
if prevValue, ok := savedHwHash[key]; ok && currValue == prevValue {
successCount++
}
}
// check if the changed match exceeds the minimum match percent
totalCount = len(currentHwHash)
iffloat32(successCount)/float32(totalCount)*100 < float32(threshold) {
isSimilar = false
}
}
}
return isSimilar
}
(gdb) monitor swdp_scan
Target voltage: 3.2V
Available Targets:
No. Att Driver
1 ARM Cortex-M
(gdb) attach 1
Attaching to Remote target
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
0x0000176a in ?? ()
(gdb) monitor erase_mass
erase..
(gdb) r
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program:
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
Program received signal SIGSEGV, Segmentation fault.
0x00000000 in ?? ()
loadコマンドでファイルを読み込んでみましょう。
(gdb) load build/blinky/zephyr/zephyr.hex
Loading section .sec1, size 0x43c8 lma 0x0
Start address 0x1704, load size 17352
Transfer rate: 19 KB/sec, 964 bytes/write.
(gdb) run
The program being debugged has been started already.
Start it from the beginning? (y or n) y
Starting program:
warning: No executable has been specified and target does not support
determining executable automatically. Try using the "file" command.
Jeff ProbeはBlackMagic Probeから派生している製品ですのでservertypeにbmpを使用するとCoretex-Debugから使用できます。あとは毎回erase_massを実行するようにoverrideLaunchCommandsを使用してデバッガ起動時の処理をオーバーライドしています。
(gdb) monitor version
Black Magic Probe (Firmware v1.6.3) (Hardware Version 0)
Copyright (C) 2015 Black Sphere Technologies Ltd.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>