ERROR: configuring avrdude for ATmega328P-XMINI (i think the evildoer is)->(avrdude: usbdev_send(): wrote -5 out of 7 bytes, err = Input/output error) - embedded

I have an ATmega328P-XMINI microchip (googling gave me a result that its an 8 bit chip).
Im new to embedded programming. And need some help getting on my way. For now im just trying to establish a connection with avrdude (im just trying to get a healthy connection loading code to the chip comes later). But i get this error. I dont know how to fix this or what is going wrong.
What i do know is that there is an usbdev input output error what i think is the culprit.
The other line exclaiming that the usb device is busy is also suspicous.
DISCLAIMER: I use gentoo and cause of this have no access to atmel studio (I have no access to windows programs).
command issued (tried with and without sudo):
sudo avrdude -p m328p -c xplainedmini
Error code:
avrdude: usb_open(): cannot read serial number "Connection timed out"
avrdude: usb_open(): cannot read product name "Connection timed out"
avrdude: usbdev_open(): WARNING: failed to set configuration 1: Device or resource busy
avrdude: usbdev_send(): wrote -5 out of 7 bytes, err = Input/output error
avrdude: jtag3_send(): failed to send command to serial port
avrdude: failed to sync with the JTAGICE3 in ISP mode
Dmesg after connecting:
[ 7704.920695] usb 2-2: new full-speed USB device number 6 using xhci_hcd
[ 7705.048875] usb 2-2: New USB device found, idVendor=03eb, idProduct=2145, bcdDevice=10.00
[ 7705.048877] usb 2-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 7705.048878] usb 2-2: Product: mEDBG CMSIS-DAP
[ 7705.048880] usb 2-2: Manufacturer: ATMEL
[ 7705.048881] usb 2-2: SerialNumber: ATML2323051800004280
[ 7705.051076] hid-generic 0003:03EB:2145.0003: hiddev97,hidraw1: USB HID v1.11 Device [ATMEL mEDBG CMSIS-DAP] on usb-0000:00:14.0-2/input0
[ 7705.051145] cdc_acm 2-2:1.1: ttyACM0: USB ACM device
microchip documentation and product page
Any tips for debugging this problem in general im thankfull for.

Never mind i spent 20 minutes formulating the question and formatting it. Just to realize that plugging it out and in fixed it.
IM AN IDIOT!

Related

How do I make a free VLM from kemp boot on a physical LoadMaster

I know this isn't the right place to ask this but this site has the most users on it. I recently bought a Kemp LoadMaster LM-2600 Load Balancer for my webservers. However, this unit didn't include an SSD because the previous owner decided to erase it. So, I downloaded the VirtualBox version of free VLM from kemp's website. Then, I used VBoxManage clonehd LMOS.vmdk LMOS.img --format RAW to turn the disk into a raw img file. Then, I used dd if=LMOS.img of=/dev/sdb to flash a USB with the os. Then, I booted my loadmaster with the USB.
The boot process went like normal until it finished booting and then the machine switched to runlevel 0 (Shutdown)
This is the logs I got when I plugged the USB into my computer (The log file was so big that stack overflow won't allow me to paste it here):
https://pastebin.com/5PbKzRi6
I noticed that it said something about eth0 being down so I plugged in an ethernet cable and booted it again. The same thing happened but I got a different error (The log was shorter so I labeled it):
-- BOOT --
2022-08-07T19:50:06+00:00 lb100 syslog-ng: syslog-ng starting up; version='3.25.1'
-- ERROR --
2022-08-07T19:50:07+00:00 lb100 raid_events_handler: RAID controller not detected yet (check # 0)
-- LOGIN --
2022-08-07T19:50:11+00:00 lb100 login: pam_unix(login:session): session opened for user bal by LOGIN(uid=0)
-- ERROR --
2022-08-07T19:50:14+00:00 lb100 raid_events_handler: RAID controller not detected yet (check # 1)
-- SHUTDOWN --
2022-08-07T19:50:15+00:00 lb100 init: Switching to runlevel: 0
2022-08-07T19:50:15+00:00 lb100 kernel: S99final (938): drop_caches: 1
2022-08-07T19:50:17+00:00 lb100 syslog-ng: syslog-ng shutting down; version='3.25.1'
2022-08-07T19:50:17+00:00 lb100 kernel: Kernel logging (proc) stopped.
2022-08-07T19:50:17+00:00 lb100 kernel: Kernel log daemon terminating.
2022-08-07T19:50:17+00:00 lb100 sslproxy: (815) caught signal 15
2022-08-07T19:50:17+00:00 lb100 raid_events_handler: stop
I have no idea what to do right now. I already tried everything I knew. What should I do?
Any help would be great,
Thanks!

Raspberry Pi 4B does not detect USB storage devices

I tried plugging two flash drives into a Raspberry Pi 4B one after another but the Pi does not seem to detect any of the drives. Here is the dmesg output
[ 177.737328] cpu cpu0: dev_pm_opp_set_rate: failed to find current OPP for freq 4294967186 (-34)
[ 180.446246] raspberrypi-clk soc:firmware:clocks: Failed to change fw-clk-arm frequency: -110
[ 181.036364] xhci_hcd 0000:01:00.0: Abort failed to stop command ring: -110
[ 181.052412] xhci_hcd 0000:01:00.0: Host halt failed, -110
[ 181.052421] xhci_hcd 0000:01:00.0: xHCI host controller not responding, assume dead
[ 181.052446] xhci_hcd 0000:01:00.0: HC died; cleaning up [ 181.052645] xhci_hcd 0000:01:00.0: Timeout while waiting for setup device command
[ 181.053349] usb 1-1: USB disconnect, device number 2
[ 181.536432] usb 1-1.3: device not accepting address 5, error -108
[ 181.536608] usb 1-1-port3: couldn't allocate usb_device
Any help is appreciated. Thanks in advance
USB problems in RPi typically happens because of a corrupted kernel, try to update it then give me a feedback.

Raspberry Pi Zero as read write mass storage

I am trying to setup a Raspberry Pi Zero as a mass storage with dwc2 and g_mass_storage (using the last Raspbian image available).
I created the data storage file with dd, made it a FAT32 fs with mkdosfs.
I looked for a lot of things. I spent some time to understand that options should be passed in /etc/modprobe.d/g_mass_storage.conf
It is finally seen in ubuntu. My problem is : it is in read only mode.
I tried to set the ro option to y or n without any impact on the behaviour. I changed permissions on the file (777), it changed nothing.
here is the current content of my /etc/modprobe.d/g_mass_storage.conf file :
options g_mass_storage file=/piusb.bin stall=0 removable=y ro=n
here is the of dmesg from the ubuntu :
[Today and now]usb 1-1.2: new high-speed USB device number 28 using ehci-pci
[ +0,299994] usb 1-1.2: device descriptor read/64, error -71
[ +0,959969] usb 1-1.2: device descriptor read/64, error -71
[ +0,187918] usb 1-1.2: new high-speed USB device number 29 using ehci-pci
[ +0,113925] usb 1-1.2: New USB device found, idVendor=0525, idProduct=a4a5
[ +0,000007] usb 1-1.2: New USB device strings: Mfr=3, Product=4, SerialNumber=0
[ +0,000004] usb 1-1.2: Product: Mass Storage Gadget
[ +0,000003] usb 1-1.2: Manufacturer: Linux 4.19.118+ with 20980000.usb
[ +0,001467] usb-storage 1-1.2:1.0: USB Mass Storage device detected
[ +0,000246] usb-storage 1-1.2:1.0: Quirks match for vid 0525 pid a4a5: 10000
[ +0,000283] scsi host9: usb-storage 1-1.2:1.0
[ +1,009528] scsi 9:0:0:0: Direct-Access Linux File-Stor Gadget 0419 PQ: 0 ANSI: 2
[ +0,001079] sd 9:0:0:0: Attached scsi generic sg5 type 0
[ +0,001699] sd 9:0:0:0: Power-on or device reset occurred
[ +0,001211] sd 9:0:0:0: [sde] 67108864 512-byte logical blocks: (34.4 GB/32.0 GiB)
[ +0,000672] sd 9:0:0:0: [sde] Write Protect is on
[ +0,000016] sd 9:0:0:0: [sde] Mode Sense: 0f 00 80 00
[ +0,000740] sd 9:0:0:0: [sde] Write cache: disabled, read cache: enabled, doesn't support DPO or FUA
[ +0,005478] sde:
[ +0,002735] sd 9:0:0:0: [sde] Attached SCSI removable disk
What to do to get a read/write mass storage ?
I reproduced your problem. I had a similar problem with the module g_acm_ms on Raspberry Pi Zero W. If you configure the module in /etc/modprobe.d/, then the system ignores the parameter ro=0. Perhaps this is due to the order of initialization of kernel modules. I got around this by adding the module to the blacklist and writing the initialization in /etc/rc.local. Thus, I managed to get an emulation of a read/write mass storage.
All steps:
Create and format the file:
# dd bs=1M if=/dev/zero of="/piusb.bin" count=2048
# mkdosfs "/piusb.bin"
Add modules-load=dwc2,g_acm_ms to end of /boot/cmdline.txt (after rootwait)
Add the string dtoverlay=dwc2 in /boot/config.txt
Prevent module initialization at startup:
$ echo "blacklist g_acm_ms" | sudo tee -a "/etc/modprobe.d/blacklist-g_acm_ms.conf"
Add initialization in /etc/rc.local above exit 0:
# nano /etc/rc.local
Add string:
/sbin/modprobe file=/piusb.bin removable=y ro=0 stall=0
Reboot system:
# reboot -h
P.S.: If you don't want to use USB for console output, you can use g_mass_storage instead of g_acm_ms.

How to solve: UDP send of xxx bytes failed with error 11 in Ubuntu?

UDP send of XXXX bytes failed with error 11
I am running a WebRTC streaming app on Ubuntu 16.04.
It streams video and audio from Logitec HD Webcam c930e within an Electronjs Desktop App.
It all works fine and smooth running on my other machine Macbook Pro. But on my Ubuntu machine I receive errors after 10-20 seconds when the peer connection is established:
[2743:0513/193817.691636:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1019 bytes failed with error 11
[2743:0513/193817.691775:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1020 bytes failed with error 11
[2743:0513/193817.696615:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1020 bytes failed with error 11
[2743:0513/193817.696777:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1020 bytes failed with error 11
[2743:0513/193817.712369:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1029 bytes failed with error 11
[2743:0513/193817.712952:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1030 bytes failed with error 11
[2743:0513/193817.713086:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1030 bytes failed with error 11
[2743:0513/193817.717713:ERROR:stunport.cc(282)] Jingle:Port[0xa5faa3df800:audio:1:0:local:Net[wlx0013ef503b67:192.168.0.x/24:Wifi]]: UDP send of 1030 bytes failed with error 11
==> Btw, if I do NOT stream audio, but video only. I got the same error but only with the "video" between the Log lines...
somewhere in between the lines I also got one line that says:
[3441:0513/195919.377887:ERROR:stunport.cc(506)] sendto: [0x0000000b] Resource temporarily unavailable
I also looked into sysctl.conf and increased the values there. My currenct sysctl.conf looks like this:
fs.file-max=1048576
fs.inotify.max_user_instances=1048576
fs.inotify.max_user_watches=1048576
fs.nr_open=1048576
net.core.netdev_max_backlog=1048576
net.core.rmem_max=16777216
net.core.somaxconn=65535
net.core.wmem_max=16777216
net.ipv4.tcp_congestion_control=htcp
net.ipv4.ip_local_port_range=1024 65535
net.ipv4.tcp_fin_timeout=5
net.ipv4.tcp_max_orphans=1048576
net.ipv4.tcp_max_syn_backlog=20480
net.ipv4.tcp_max_tw_buckets=400000
net.ipv4.tcp_no_metrics_save=1
net.ipv4.tcp_rmem=4096 87380 16777216
net.ipv4.tcp_synack_retries=2
net.ipv4.tcp_syn_retries=2
net.ipv4.tcp_tw_recycle=1
net.ipv4.tcp_tw_reuse=1
net.ipv4.tcp_wmem=4096 65535 16777216
vm.max_map_count=1048576
vm.min_free_kbytes=65535
vm.overcommit_memory=1
vm.swappiness=0
vm.vfs_cache_pressure=50
Like suggested here: https://gist.github.com/cdgraff/7920db287988463aafd7ea09eef6f9f0
It does not seem to help. I am still getting these errors and I experience lagging on the other side.
Additional info: on Ubuntu the Electronjs App connects to Heroku Server (Nodejs) and the other side of the peer connection (Chrome Browser) also connects to it. Heroku Server acts as Handshaking Server to establish WebRTC connection. Both have as configuration:
{'urls': 'stun:stun1.l.google.com:19302'},
{'urls': 'stun:stun2.l.google.com:19302'},
and also an additional Turn Server from numb.viagenie.ca
Connection is established and within the first 10 seconds the quality is very high and there is no lagging at all. But then after 10-20 seconds there is lagging and on the Ubuntu console I am getting these UDP errors.
The PC that Ubuntu is running on:
PROCESSOR / CHIPSET:
CPU Intel Core i3 (2nd Gen) 2310M / 2.1 GHz
Number of Cores: Dual-Core
Cache: 3 MB
64-bit Computing: Yes
Chipset Type: Mobile Intel HM65 Express
RAM:
Memory Speed: 1333 MHz
Memory Specification Compliance: PC3-10600
Technology: DDR3 SDRAM
Installed Size: 4 GB
Rated Memory Speed: 1333 MHz
Graphics
Graphics Processor Intel HD Graphics 3000
Could please anyone give me some hints or anything that could solve this problem?
Thank you
==============EDIT=============
I found in my very large strace log somewhere these two lines:
7671 sendmsg(17, {msg_name(0)=NULL, msg_iov(1)=[{"CHILD_PING\0", 11}], msg_controllen=0, msg_flags=0}, MSG_NOSIGNAL) = 11
7661 <... recvmsg resumed> {msg_name(0)=NULL, msg_iov(1)=[{"CHILD_PING\0", 12}], msg_controllen=32, [{cmsg_len=28, cmsg_level=SOL_SOCKET, cmsg_type=SCM_CREDENTIALS, {pid=7671, uid=0, gid=0}}], msg_flags=0}, 0) = 11
On top of that, somewhere near when the error happens (at the end of the log file, just before I quit the application) I see in the log file the following:
https://gist.github.com/Mcdane/2342d26923e554483237faf02cc7cfad
First, to get an impression of what is happening in the first place, I'd look with strace. Start your application with
strace -e network -o log.strace -f YOUR_APPLICATION
If your application looks for another running process to turn the work too, start it with parameters so it doesn't do that. For instance, for Chrome, pass in a --user-data-dir value that is different from your default.
Look for = 11 in the output file log.strace afterwards, and look what happened before and after. This will give you a rough picture of what is happening, and you can exclude silly mistakes like sendtos to 0.0.0.0 or so (For this reason, this is also very important information to include in a stackoverflow question, for instance by uploading the output to gist).
It may also be helpful to use Wireshark or another packet capture program to get a rough overview of what is being sent.
Assuming you can confirm with strace that a valid send call is taken place, you can then further analyze the error conditions.
Error 11 is EAGAIN. The documentation of send says when this error is supposed to happen:
EAGAIN (...) The socket is marked nonblocking and the requested operation would block. (...)
EAGAIN (Internet domain datagram sockets) The socket referred to by
sockfd had not previously been bound to an address and, upon
attempting to bind it to an ephemeral port, it was determined that all
port numbers in the ephemeral port range are currently in use. See
the discussion of /proc/sys/net/ipv4/ip_local_port_range in
ip(7).
Both conditions could apply.
The first will be obvious by the strace log if you trace the creation of the socket involved.
To exclude the second, you can run netstat -una (or, if you want to know the programs involved, sudo netstat -unap) to see which ports are open (if you want Stack Overflow users to look into it, post the output on gist or similar and link to it here). Your port range net.ipv4.ip_local_port_range=1024 65535 is not the standard 32768 60999; this looks like you attempted to do something about lacking port numbers already. It would help to trace back to the reason of why you changed that parameter, and the conditions that convinced you to do so.

VxWorks boot hang (starting at 0x100000)

I'm trying to boot VxWorks 6.3 on a Wind River SBC83XX PowerQUICC II Pro. I'm using Wind River Workbench as my IDE. I configured the kernel, built it, and attempted to run it, but it hangs on Starting at 0x100000 with no further output.
Here is the output of the terminal after typing # at the prompt:
boot device : mottsec
unit number : 0
processor number : 0
host name : XXXXXXXXXXX
file name : C:\WindRiver\workspace\vxworks-dev\default\vxWorks
inet on ethernet (e) : 69.88.163.22:ffffff00
host inet (h) : 69.88.163.21
gateway inet (g) : 69.88.163.1
user (u) : XXXXXXXXX
ftp password (pw) : XXXXXXXX
flags (f) : 0x0
Attaching interface lo0... done
Attached IPv4 interface to mottsec unit 0
Loading... 1838288
Starting at 0x100000...
Any suggestions would be greatly appreciated; I need this working for a college class on a tight schedule.
Many things could be wrong.
The first thing I would do is check the RAM size. If it exceed the amount on the board, this might happen.
Is the serial port & shell configured? I would suggest adding the standalone shell bundle.
If the symbol table is compiled as standalone, this can sometimes occur based on other configurations.
Compile the symbol table into the image.
In Work Bench:
Kernel Configuration -> CTRL+F, search "built-in symbol table", -> include it.