hybridfree/eevblog-posts huggingface dataset:
Windows and 512 byte blocks - Page 1
Forum section: electronics / general

author: peter-h
author_rank: Super Contributor
timestamp: July 29, 2021, 04:02:20 pm
content: I have a system which implements a USB filesystem, on an Adesto SPI FLASH which has 512 byte block size: AT25PE16 or AT45DB321.These are 2MB and 4MB respectively.FatFS is used to make the filesystem visible to the code running on the target, and the USB removable media side is implemented under interrupts using some ST library.And this works fine.Now looking at using the AT45DB641 which is 1024 byte block size.There seems to be a "wisdom", going back decades, that 512 byte sectors are mandatory for Windows compatibility (for a removable storage device such as this). Some background to this is e.g. here:https://docs.microsoft.com/en-us/troubleshoot/windows-server/backup-and-storage/support-policy-4k-sector-hard-drivesHowever, many years ago when I was messing about with CP/M (!) I implemented a BIOS with two floppy drives which had 2048 byte sectors (this was before the 1.44/2.88MB diskettes came) and one used what was called blocking/deblocking code which translated between the disk physical sectors (2048) and the native CP/M sectors (always 128 bytes). Obviously there was a 2048 byte RAM buffer, with various rules for flushing it to the physical disk. The CP/M implementation manuals gave code (written by Gary Kildall in 808 asm!) for blocking/deblocking. Hilariously, I see this 1970s manual on the bookshelf behind me... In fact the only CP/M systems which did not need blocking/deblocking were ones with 8" floppies (which actually used 128 byte physical sectors). You can laugh at this historical throwback but I doubt this system has changed!This isn't a FatFS issue because FatFS merely makes the filesystem visible to code running on the target. The USB interface to Windows is implemented under interrupts, using some ST library, and they seem to be mapping the blocks 1:1 between the FLASH chip and the sectors presented over USB.Does this stuff ring a bell with anyone?

author: peter-h
author_rank: Super Contributor
timestamp: August 10, 2021, 05:59:45 am
content: I gave up on this and hard-coded the project for the two devices with 512-byte blocks :smile:

author: Kleinstein
author_rank: Super Contributor
timestamp: August 10, 2021, 06:50:48 am
content: This brings back memory: The Amiga normally used it's own file system on 3.5" floppies, but there was a tool to also create DOS compatible disks. This tool allowed to choose a different sector size.I don't remember which Windows version I tried ( windows 3.11 and / or Win95), but the PC did not like larger sectors at all. Windows was not even able to easily reformat such a disk: it tried to read some data first and crashed at the attempt. One had to force it no to look at the disk first.
cfg80211 regulatory.db malformed ?!? - Page 1
Forum section: electronics / general

author: DiTBho
author_rank: Super Contributor
timestamp: July 23, 2021, 03:18:56 pm
content: I am working with a wifi card, the EEPROM reports country->regdmn code 0x3a, which should be "US".I have already update the /lib/firmware imagesCode:# file /lib/firmware/regulatory*firmware/crda/regulatory-2016-06-10-1.bin: CRDA wireless regulatory database file (Version 1)firmware/crda/regulatory.bin: CRDA wireless regulatory database file (Version 1)firmware/crda/regulatory.db: CRDA wireless regulatory database filefirmware/crda/regulatory.db.p7s: dataregulatory.db and egulatory.db.p7s are "2019-06-03"the kernel 5.4 complains thisCode:cfg80211: loaded regulatory.db is malformed or signature is missing/invalidany idea?

author: DiTBho
author_rank: Super Contributor
timestamp: July 23, 2021, 03:29:56 pm
content: I am going to try with anupdatedversion.Umm, it seems these binaries are signed, and there is also a signature with the kernel, so it may be they must be synchronized

author: DiTBho
author_rank: Super Contributor
timestamp: July 25, 2021, 05:32:09 pm
content: temporary solved by hacking the kernel.
[solved] ramspeed crashes with Segmentation fault - Page 1
Forum section: electronics / general

author: DiTBho
author_rank: Super Contributor
timestamp: September 05, 2021, 12:28:13 pm
content: "ramspeed" is a cache and memory benchmarking tool, seeherefor source and documentation.The last version is 3.5.0, it compiles fine, but on my computer it immediately crashesCode:RAMspeed/SMP (GENERIC) v3.5.0 by Rhett M. Hollander and Paul V. Bolotoff, 2002-098Gb per pass mode, 2 processesSegmentation faultDigging into, I found that when shmget () fails its return-value is not checked and the program crashesCode:--- ramsmp.c.original 2021-09-05 04:27:11.680014453 -0000+++ ramsmp.c 2021-09-05 04:55:41.180015268 -0000@@ -334,6 +334,13 @@/* initialise the future master process and a segment of shared memory */shmkey = masterpid = getpid();shmid = shmget(shmkey, (sizeof(STL) << 11), IPC_CREAT | 0666);+ if (shmid <0)+ {+ // On success, a valid shared memory identifier is returned.+ // On error, -1 is returned, and errno is set to indicate the error.+ printf("shmget() failed\n");+ return(1);+ }shm = (UTL *) shmat(shmid, 0, 0);for(cnt = 0; cnt < 2048; cnt++) shm = 0;shmdt(shm);So, the problem is related to shmget(), and I wrote this program to isolate the problemCode:#include <stdio.h>#include <sys/shm.h>#include <sys/stat.h>#include <sys/socket.h>#include <errno.h>#include <unistd.h>int main(){int segment_id;segment_id = shmget(04, getpagesize(), IPC_CREAT | 0666);printf("segment_id = %d\n", segment_id);printf("Page size - %d\n", getpagesize());if (segment_id < 0){printf("Error %d\n", errno);switch (errno){case 38:printf(" the function shmget() is not implemented\n");printf(" enable 'CONFIG_SYSVIPC' in kernel config\n");break;default:printf("dunno, not yet investigated\n");break;}}return 0;}And found that errno=38 corresponds to ENOSYS which means function not implemented.So the solution is to enable 'CONFIG_SYSVIPC' in kernel config (I am on k5.4.128): problem solved.Code:# ramspeed -b3 -m16RAMspeed/SMP (GENERIC) v3.5.0 by Rhett M. Hollander and Paul V. Bolotoff, 2002-098Gb per pass mode, 2 processesINTEGER Copy: 673.21 MB/sINTEGER Scale: 742.19 MB/sINTEGER Add: 278.48 MB/sINTEGER Triad: 262.47 MB/s---INTEGER AVERAGE: 489.09 MB/sNow it works! I wasted 52 minutes on this issue, hope these notes help people save time

author: SiliconWizard
author_rank: Super Contributor
timestamp: September 05, 2021, 06:05:02 pm
content: This shows the problem with not checking return values, and doing no or lazy error checking. It'll never stop annoying the f*ck out of me.Somehow, many developers think that a process crashing is an acceptable way of signaling users that an error occured.

author: ejeffrey
author_rank: Super Contributor
timestamp: September 06, 2021, 03:14:31 am
content: You should always check error codes but why the hell was sysv ipc disabled? That's a standard part of the UNIX api and if you disable it you should expect things to break.
Motorola M-Core, anyone? - Page 1
Forum section: electronics / general

author: DiTBho
author_rank: Super Contributor
timestamp: July 12, 2021, 04:45:16 pm
content: It seems that I have to work with an old RISC-ish core that I have never even heard of: the Motorola M-core. What is that? Something intended for use in embedded systems, introduced in late 1997.I would appreciate is someone sends me any information about current status of M-Core target support in Gcc, or if there is support for some opensource C compiler (sdcc? llvm? lcc? ...).

author: ataradov
author_rank: Super Contributor
timestamp: July 12, 2021, 06:20:57 pm
content: M-Core compatible ISA is used by the C-SKY CK610 SoC, which is supported by Linux, so GCC support must be there. And that C-SKY is the most modern chip to use that architecture, so it may make sense to look for documentation on that.

author: SiliconWizard
author_rank: Super Contributor
timestamp: July 12, 2021, 07:26:38 pm
content: Motorola M-core is supported by GCC:https://gcc.gnu.org/onlinedocs/gcc/Submodel-Options.htmlIt hasn't been removed as far as I can tell, so it should work even with the latest GCC 11.1.https://en.wikipedia.org/wiki/M%C2%B7CORE
Inexpensive SBC for low cost SDR receiver? - Page 1
Forum section: electronics / general

author: cdev
author_rank: Super Contributor
timestamp: June 30, 2021, 01:03:00 pm
content: Are we at the point yet where any of the cheap SBCs with a built in ADC could act as a cheap HF receiver?Say receiving up to a couple MHz? Maybe with its own ADC or an external ADC?I am wondering if it might be possible now to make a small cheap standalone SDR to use as a general purpose shortwave receiver???

author: NiHaoMike
author_rank: Super Contributor
timestamp: July 01, 2021, 12:56:42 am
content: If you don't need to look at a lot of bandwidth at once, find one with a decent audio input and add a Tayloe mixer in front of it.

author: coromonadalix
author_rank: Super Contributor
timestamp: July 01, 2021, 03:33:54 am
content: ?
Programming TinyPico Nano (ESP32) from UART - Page 1
Forum section: electronics / general

author: raff5184
author_rank: Regular Contributor
timestamp: June 23, 2021, 03:55:02 pm
content: Hi,I have a tinyPico Nanohttps://www.tinypico.com/tinypico-nanothat I program from Arduino IDE using USB connection. What I am not able to do is programming the ESP32 directly from UART bypassing the USB-to-UART bridge of the board. I tired 2 different USB-to-UART bridges and connected them directly to pin IO1-TX and IO3-RX of the tinyPico but the issue is that Arduino IDE doesn't find the TinyPico board when I use a different bridgeSome more details:the tinyPico Nano board has a USB/UART bridge chip (cp2104) so that it is connected to a PC USB for programming the ESP32 of the board. But when the ESP32gets programmed, serial/uart communication is actually used.What I want to do is bypassing the cp2104 and use an external chip to do the same thing and connecting this external chip to the UART pins of the tinyPico. I tried with 2 different external chips but no luck, because when Arduino IDE tries to program the tinypico, it can't find the board

author: PlainName
author_rank: Super Contributor
timestamp: June 24, 2021, 03:05:40 pm
content: The ESP needs DTR and RTS toggled in a specific way to enter boot mode (that's EN and IO0 pins on the ESP). Perhaps you haven't connected those? They don't connect directly, either, but kind of block each other. A quick way to find out if this is the problem is to manually toggle them in a random order - eventually you'll hit a sequence that works

author: raff5184
author_rank: Regular Contributor
timestamp: June 24, 2021, 03:30:25 pm
content: yes, that was my last understanding and I played around with them a little.When it is programmed automatically from USB, EN is HIGH all the time and IO0 is HIGH pulls LOW for a moment and then HIGH again before programming starts. And same thing at the end of programming.I did the same but no result yet. I should probably try a different combination (?)

author: PlainName
author_rank: Super Contributor
timestamp: June 24, 2021, 03:44:57 pm
content: You can find the details here:https://github.com/espressif/esptool/wiki/ESP32-Boot-Mode-Selection
Play interactive videos with Raspberry from C ++. - Page 1
Forum section: electronics / general

author: luiHS
author_rank: Frequent Contributor
timestamp: July 02, 2021, 02:19:55 am
content: Hi.I have an application for Raspberry in which I need to trigger videos with sound interactively without delays, they should start playing instantly.Now I don't use omxplayer, because I already tried it and there is a certain lag when triggering the videos, which makes it not useful for me. My current system, without using omxplayer, works fine, but does not support sound, only video.I've looked for some info but can't find the solution, I read about using dbus to control omxplayer, but this doesn't seem to allow opening and closing video files for a background loaded omxplayer to avoid lag. It only allows you to control a video that is already in play, not open a new video or close the one that is playing.Does anyone know any solution based or not on omxplayer, to play videos with sound from a C program? Playback must be instantaneous, there can be no lag.If omxplayer could be controlled with dbus to send commands to open or close video files, it could help me, but it seems that that is not possible.
Azure - Page 1
Forum section: electronics / general

author: PlainName
author_rank: Super Contributor
timestamp: June 22, 2021, 05:51:06 pm
content: Anyone using (or used) Azure RTOS? Only found out about it today, and I am deeply suspicious that it's a Microsoft product (albeit apparently free). Clearly, they want in on the IoT market and expect some kind of payback from it, but is it comparable to FreeRTOS and the like?

author: olkipukki
author_rank: Frequent Contributor
timestamp: June 23, 2021, 07:19:34 am
content: Quote from: dunkemhigh on June 22, 2021, 05:51:06 pmAs you might already know Azure RTOS is actually ex- ThreadXJust make sure what you are familiar with MS licensing before commit to 'free' world of usagehttps://github.com/azure-rtos/threadx/blob/master/LICENSED-HARDWARE.txtand Q&Ahttps://azure.microsoft.com/en-us/pricing/details/rtos/

author: PlainName
author_rank: Super Contributor
timestamp: June 23, 2021, 08:33:28 am
content: QuoteNo, didn't have a clueQuoteThanks. On the one hand that's not surprising (use for free to get nums on seats, then charge once they're locked in and ready to ship), and it was probably the github location that suckered me. But on the other hand it is licensed for some specific MCUs, such as STM and PIC. The implication is that those manufacturers are paying Microsoft to let their users run this, and I wouldn't have thought that would come cheap. STM already use FreeRTOS so are they paying to switch for some reason that might be important (maybe Amazon are trying to monetize it now, or it's too common and does differentiate their chips enough).
How to connect a custom i2c C library here? - Page 1
Forum section: electronics / general

author: triedgetech
author_rank: Newbie
timestamp: June 08, 2021, 10:53:35 am
content: I have NanoPi with installed Ubuntu 16 LTS, kernel 4.14.I want to read value from a specific register on slave device.On default, there's no support for SMBUS commands in C, and I don't have i2c/smbus.hThe read command that there is, reads all values from 0x00 register up to whatever register you pass on as an argument in "read()".I have foundthisC library (though I heard it's not a good C library for i2c). What steps should I do in order to have a simple#include <customI2C.h> in my script?? I readthisguide on how to connect an external library, and it seems like such a hassle, not sure how to start.Looks like i2c.c is implementation file, how do I create an i2c.h interface file then??? It'll take too long for me to figure out. I just need a tl;dr.Its function declaration for read assumes the to pass on the third argument like this I guess:Code:u8 result_val;u8 reg = 0x05;u8 slave_addr = 0x18;if (err = i2c_read(slave_addr, reg, &result_val)) {// handle error}// do things with valDoes it mean, that if this command reads a register 0x05 (System Clock in MAX9867), it might return an 8-bit value in hex like 0x10?Anyhow, using the read command right now:Code:char bufer;read(file, buffer, 15);for (int i=0;i<=sizeof(buffer);i++) {printf("buffer[%d] is %d \n", i, buffer);usleep(1000);}Will print every register's value up to 14 (15 -1, idk why that's so), which in hex is 0x0E. Obviously that won't do, as this is inefficient, a read command should only access the specific register and then return its value.What's the simplest way to achieve that? I noticed some C libraries utilize the ioctl command, as a declared function before int main? Perhaps there's a ready to use (copy & paste) sample of it?
Ignition Missing Tooth Decoder Algorithm - Page 1
Forum section: electronics / general

author: nick39
author_rank: Contributor
timestamp: May 25, 2021, 07:52:17 pm
content: Hi,I need to develop a digital ignition using an embedded system. I'm having trouble finding information about how the algorithm for this is implemented.As a first goal I'm not interested in implementing the spark advanced degree correction acording to the engine load for the system.But I do need to calculate the advance degree acording to RPM. Any ideas about this?Thanks!
What is the most overkill desk clock you can think of? - Page 1
Forum section: electronics / general

author: technix
author_rank: Super Contributor
timestamp: May 17, 2021, 04:48:11 pm
content: Here is the specs and limitatons:* It has to be a desk clock and weather station combo, using a battey-backed RTC and a combined temperature and humidity sensor like SHT30-DIS.* The form factor must be no larger than a small stack of credit cards - no bigger than a credit card, no thicker than 1 inch.* It must be able to run on internal battery with full functionality for at least 2 hours.So, wha would be your most overkill implementation?

author: KE5FX
author_rank: Super Contributor
timestamp: May 17, 2021, 06:14:07 pm
content: A desk stand for my iPhone?

author: technix
author_rank: Super Contributor
timestamp: May 18, 2021, 01:52:16 am
content: Quote from: KE5FX on May 17, 2021, 06:14:07 pmToo big even for iPhone 4s. Also it is not a weather station.

author: KE5FX
author_rank: Super Contributor
timestamp: May 18, 2021, 02:48:44 am
content: Quote from: technix on May 18, 2021, 01:52:16 amSure it is.

author: ucanel
author_rank: Regular Contributor
timestamp: May 18, 2021, 10:44:03 am
content: Ferrolic turned into that specs may do the overkillhttps://youtu.be/dOCGQAXV9FY

author: NiHaoMike
author_rank: Super Contributor
timestamp: May 19, 2021, 12:36:27 am
content: If you want overkill, how about a chip scale atomic clock paired up with a Zynq FPGA driving a touchscreen? Probably still have enough room left for a pair of 18650s and a GPS receiver.
Arduino Makefiles for commandliners on AVR and STM32 - Page 1
Forum section: electronics / general

author: fanOfeeDIY
author_rank: Unknown
timestamp: August 21, 2020, 01:00:17 pm
content: After discussion at the forum here, I end up uploading the project at the github.https://github.com/mcd500/arduino-commandliners/blob/master/README.mdThis project is providing Makefiles for using Arduino which is small as possible on AVR and STM32The initial discussion at the forum was here.https://www.eevblog.com/forum/programming/i-dont-understand-libraries-in-c/msg3185856/#msg3185856There are arduino-mk for avr but it might be handy for stm32 developments.Please let me know for any comments, questions or improvements.

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 10, 2020, 10:19:11 am
content: > $ wgethttps://raw.githubusercontent.com/mcd500/arduino-commandliners/master/Makefilewget for git? Are you serious?> $ git clonehttps://github.com/mcd500/arduino-commandliners> $ rm -rf arduino-commandliners/

author: fanOfeeDIY
author_rank: Unknown
timestamp: May 15, 2021, 11:27:48 am
content: Quote from: Doctorandus_P on September 10, 2020, 10:19:11 amWell, if you have read the entire contents of github, Makefile are the only valuable files for developing, and others are explanation of how to use the Makefile.It is fine git cloning entire repository but letting the users to download the only file you need is reasonable.
Serial communication between Raspberry Pi 4 and STM32F4 - Page 1
Forum section: electronics / general

author: johofz
author_rank: Contributor
timestamp: May 04, 2021, 08:15:17 am
content: Hello dear EEVblog community,I'm working on a project that requires communication between a Raspberry Pi 4 (master) and an STM32F4 (slave).The Pi is supposed to send commands to the STM32F4 to start a measurement and then receive a stream of data until the measurement is done.My first intent was to use USB, since the STM32F4 I'm using has a USB-OTG FS layer on it's silicon and I previously used that to communicate with PCs.The STM32F4 together with analog, power and motor controller circuits is on a single PCB. This PCB will most likely be larger than the Pi's board. I plan on mounting the Pi onto my measurement board and connect them via the pis header.As far as I know, the Pi does not provide USB D+/D- over the header. This is a bummer, since it would require a cable and I don't want that.Does anyone have experience with URAT or SPI communication between the two? I did a lot of SPI communication but never used a Pi for that befor.Greetingsjohofz

author: technix
author_rank: Super Contributor
timestamp: May 14, 2021, 05:12:32 am
content: The serial UART pins on the header is not useable by default because of the lack of a stable clock going to the second UART causing the baudrate to change in the middle of a communication. If you can get away without Bluetooth, you can redirect the primary UART interface to the GPIO pins so you get a direct serial link. Alternatively, you can use some SPI/I2C to UART chip like SC16IS740 to create a stable-clocked serial UART interface from I2C or SPI bus. Or what might be the easiest, have the STM32 and the Pi talk directly over SPI or I2C. STM32 would be the slave device and Pi being the master.Anyway, it doesn't make much sense to use USB as the link between Pi and some slow peripheral.
Book recommendation about embedded Linux/Yocto/Buildroot/Uboot/filesystem - Page 1
Forum section: electronics / general

author: soFPG
author_rank: Frequent Contributor
timestamp: May 13, 2021, 03:46:51 pm
content: Any books you can recommend about embedded linux on Cortex-A CPUs for beginners (covering Yocto/Buildroot/Uboot/filesystems)?
RISC-V Vector extension on the Allwinner D1 - Page 1
Forum section: electronics / general

author: brucehoult
author_rank: Super Contributor
timestamp: April 22, 2021, 09:41:28 pm
content: I've managed to (figuratively) get my hands on a board with the new Allwinner D1 RISC-V SoC using the Alibaba/T-Head C906 core. As in, the machine is in Beijing and I'm sshing in.This SoC will soon be available on SBCs in the Pi Zero category from Sipeed (promised price $12.50) and Pine64 (promised price "under $10") as well I think from Allwinner themselves. And probably others.For that price you might only get 256 MB or 512 MB of RAM. The board I'm using has 512 MB and is running at 1.008 GHz.The most exciting part about this SoC is that it turns out Allwinner have paid for the optional RISC-V Vector extension hardware. It turns out that Sipeed engineers weren't even sure until I sent them some test programs to run. The unfortunate part is the Vector ISA implemented is the 20 month old draft 0.7.1. While this is very similar in spirit to what will shortly be the ratified 1.0 version and it's usually fairly easy to convert assembly language code from one to the other, it is incompatible at both the assembly-language and binary level.But it's probably the only RISC-V Vector hardware most people will be able to get their hands on in the next 12 months. And it's much nicer than MX / SSE / AVX. And no one has ARM chips with SVE yet.Thanks to Sipeed.com and RVBoards.org for generously providing access.I've run a test program comparing the speed of memcpy() on copies of various sizes, and another program comparing strcpy(). The results are at:http://hoult.org/d1_memcpy.txthttp://hoult.org/d1_strcpy.txtThe source code is at:http://hoult.org/test_memcpy.chttp://hoult.org/test_strcpy.chttp://hoult.org/rvv_lib.s

author: hamster_nz
author_rank: Super Contributor
timestamp: April 23, 2021, 10:44:10 am
content: That strcpy() performance is pretty interesting - about 2x as fast, even for (stupidly?) long strings.But then reading that note that the standard code calls strlen() then memcpy() that makes sense...

author: brucehoult
author_rank: Super Contributor
timestamp: April 23, 2021, 11:17:17 am
content: I would expect most fast non-SIMD implementations using scalar instruction sets do. Its hard enough to make optimised block copies without trying to find and check for zero bytes in the middle of them -- and you don't want to overwrite even one byte past the place you're copying the null to.Using strcpy to copy 32 MB is not the common case :-)
Raspberry Pi4 high power consumption after USB overload - Page 1
Forum section: electronics / general

author: jrobi772
author_rank: Newbie
timestamp: March 14, 2021, 01:30:44 pm
content: Hi,Im powered my Raspberry Pi4 2GB from Gpio pins and its worked normaly(booting from USB3 Samsung pendrive 600mA current usage) until i was pluged in an USB hub into the lower USB2 port, with an Ydlidar X4 was plugged in. After that the PI4 basic power consumption rised to 1300mA without the USB hub, im think a PTC fuse or something was the changed the resistance. Just dont find what is that.The board was working just doubled the power consumption.Its looks the VLI VL805 temperature is higher than normal.Thanks

author: oliviasmithh901
author_rank: Newbie
timestamp: March 20, 2021, 04:22:06 am
content: hmmm somethings wrongit happened to me once, I powered up Pi3 and it just went offcouldn't start it again, so I think you should go for a new one and be careful next time
STM32G0 SO8N - Page 1
Forum section: electronics / general

author: Dubbie
author_rank: Unknown
timestamp: March 15, 2021, 11:57:44 pm
content: Has anyone here used this part?I was wondering how it works if you want to use SWD. Does that knock out 2 pins or is it easy to use them dual purpose? Do you need to use the reset pin for programming?I was hoping to use them as a replacement for ATiny85's. I currently have those in a drawer for when I need a quick one off MCU for some sort of basic task like timing, counting or something.I wanted to switch to STM32 so I don't have to maintain 2 toolchains and 2 HALs in my head

author: ataradov
author_rank: Super Contributor
timestamp: March 16, 2021, 12:31:14 am
content: On reset SWD pins are assigned as a programming interface, but the firmware may disable them and then they can be used as standard GPIO pins. Your circuitry attached to the pins must be compatible with SWD. In practice it means that it should not have anything that would pull them strongly high or low.You don't really need a reset, but if the firmware switches off SWD pins immediately, it may be tricky to reprogram the part without a reset pin.

author: Dubbie
author_rank: Unknown
timestamp: March 16, 2021, 12:36:56 am
content: So maybe a 1 second delay or something before configuring the reset as GPIO should do the trick? And then remove power and connect with SWD hardware attached?

author: ataradov
author_rank: Super Contributor
timestamp: March 16, 2021, 12:46:31 am
content: Yes, at least for prototyping, delay reconfiguration of system pins and going into low power modes.Having SWD hardware attached will not do anything, since the software must run and be able to intercept execution. ST devices will let debugger connect to the core while reset is asserted. So asserting the reset while power cycling should recover the device from any state, but the programmer/debugger software must support this.So generally it is better to reuse SWD pins first and leave the reset to be the last pin reassigned as GPIO, since in that case you would not need to power cycle the device to enable SWD pins.

author: Dubbie
author_rank: Unknown
timestamp: March 16, 2021, 04:25:50 am
content: Thanks ataradov. Very helpful info.
Raspberry compute 4, eMMC flash memory - Page 1
Forum section: electronics / general

author: luiHS
author_rank: Frequent Contributor
timestamp: March 09, 2021, 04:22:12 pm
content: HiI would be interested in trying the new Raspberry pi compute 4. Specifically, the version with eMMC flash.I think that compute 3 already had eMMC flash and I don't know if any other model, but I ruled out using compute 3 because of the type of socket required.The question is whether loading the operating system and my applications in the eMMC flash will protect my program, so that no one can extract it. So far the Raspberry that I have used only has SD card, but no eMMC, and in that case anyone can read and copy a user program.It is the main advantage that I would see to use the eMMC instead of the SD card for system and applications, so that the product can be used for commercial development.

author: wraper
author_rank: Unknown
timestamp: March 09, 2021, 04:29:43 pm
content: Quote from: luiHS on March 09, 2021, 04:22:12 pmAt best it will make extracting data a bit more annoying. Even if there was some sort of protection, all you need is desoldering the chip.

author: langwadt
author_rank: Super Contributor
timestamp: March 09, 2021, 04:30:11 pm
content: other than speed and longevity there's not really any difference
STM8 - write 2 bytes to EEPROM? - Page 1
Forum section: electronics / general

author: Saimoun
author_rank: Frequent Contributor
timestamp: March 08, 2021, 01:38:49 pm
content: HiQuick version: how to write 2 bytes (not in the same word) to the EEPROM in STM8? Should I write 1 byte and then wait for the EOP flag to be set before writing the second one?Long version: for now I am simply doing:* unlock EEPROM* write byte 1 (EEPROM->data1 = xx;)* write byte 2 (EEPROM->data2 = xx;) right after* FLASH interrupt is called when finished (byte 1 or 2? I don't know), there I lock the EEPROM againI imagine this is strange since with the RWW (read-while-write) fonctionality, the "write byte 2" instruction is executed while the first one is still running.Anyways funny enough this works perfectly fine, except that it gives me problems with a silicon bug listed in the STM8AL3xx6/8 STM8Lx5xx4/6 Errata sheet (https://www.st.com/resource/en/errata_sheet/cd00237242-stm8al31xx-stm8al3lxx-stm8l052c6-stm8l151xx46-and-stm8l152xx46-device-limitations-stmicroelectronics.pdf)The bug basically says that if the DMA requests access to the bus while an EEPROM write is starting (during the first 11 cycles) the CPU might stay in stall mode.I have implemented the workaround 2, which is a high DMA timeout (I left it at the default value of 63 cycles) and no high priority DMA (I am only using Channel2 which is at the default = low). It works great with all my other EEPROM writes but not with this double write - hence my question: maybe I am just doing it wrong and I should wait for the first write to be finished?Thank youSimon

author: Saimoun
author_rank: Frequent Contributor
timestamp: March 08, 2021, 01:59:55 pm
content: Ok maybe I did not need to askI basically changed the code to make sure I was always done writing a byte when I start writing a second byte and it did seem to solve the problem (at least intense monky testing of 5 minutes cannot get the silicon bug to appear - the CPU does not stall).
ESP32 board with ripped USB socket - Page 1
Forum section: electronics / general

author: bitwelder
author_rank: Super Contributor
timestamp: October 13, 2020, 10:59:45 am
content: I have an ESP32-based small board (one of those small weather/soil condition monitor stations) where the tiny SMD micro-USB socket ripped off from the PCB.Instead of trying it to re-solder it, would it be possible to plug just 'at flashing time' a USB-to-UART converter to the ESP32 TX/RX pins, and work it that way?My hope is to flash there something like Mongoose OS or similar, so that after I flashed and configured it once, in future I could do OTA updates.

author: m k
author_rank: Super Contributor
timestamp: October 20, 2020, 09:42:09 am
content: If that kind of flashing is enabled then yes.Connect a terminal and try it.I read that speed is 115K, mode is unknown but try 8N1.You should receive something meaningful.

author: GodIsRealUnless DefinedInt
author_rank: Contributor
timestamp: February 14, 2021, 04:46:21 am
content: Wish I was here last year, you can hook GND to GND, power 3.3V to the DevKitC and then USB>>Serial>>TTL level TX to the DevKitC RX and USB>>Serial>>TTL RX to the DevKitC TX. Then ground IO0 (Boot) and press the (EN) to enter programming mode. You should see something similar to:rst:0x1 (POWERON_RESET),boot:0x3 (DOWNLOAD_BOOT(UART0/UART1/SDIO_REI_REO_V2))waiting for downloadThen in the Arduino IDE you can upload your sketch. I use the same technique on Arduino UNO boards when having reprogrammed the second ATMEL firmware to be a USB HID but still needing to do program the main ATMEL / upload new sketches.Get yourself the Free book on ESP32 available here:https://leanpub.com/kolban-ESP32it will help you with your ESP32 endeavors.

author: oliviasmithh900
author_rank: Contributor
timestamp: March 08, 2021, 12:49:39 am
content: it won't be wise to use the usb pins that way, you should go with the default style
CM4 carrier board differential pairs swapping - Page 1
Forum section: electronics / general

author: Deku Tree
author_rank: Contributor
timestamp: February 16, 2021, 10:09:48 pm
content: Hi all,I'm working on a small breakout board for the raspberry pi 4 compute module. This is my first time routing differential pairs and I keep running into the same issue. I've moved some of the connectors to the bottom of the board and this has caused many of the differential pairs to be both flipped within the pair, and crossed over other pairs. Here are a few screenshots to clarify:My only thought is to simply run the last part of the pair through two vias with one trace on the top layer and one on the bottom. I typically work with much lower speed layout though and don't have a good idea of how vias will affect impedance matching.Thanks for any help you can offer

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 18, 2021, 05:03:00 pm
content: Note that there's very little room for vias here. Maybe you'll need to push back the HD1 pair a little. Or maybe the smallest vias you can afford will fit.See on this picture how to usually swap the pair:https://www.orcad.com/sites/orcad/files/image2.png(On this they use via in pad, but this is usually a costly manufacturing option. Of course you can use standard vias instead here in the space between HD1_P and the two CAM0_C pins.)You'll need four vias as shown to keep it symmetrical.

author: Deku Tree
author_rank: Contributor
timestamp: February 19, 2021, 04:51:48 am
content: Thanks for the tips! When moving the signals through a via does it matter what direction they come out on the other plane? I'm wondering if I can double back after a via on some of my signals without introducing too many reflections.

author: SiliconWizard
author_rank: Super Contributor
timestamp: February 21, 2021, 03:57:56 pm
content: I don't think there's much to worry about here as long as you keep it symmetrical. Also, I don't know what kind of PCB stack you're working with. I can only see two layers on your capture? Is it a 2-layer PCB? I would suggest a 4-layer arrangement for this kind of stuff...

author: Deku Tree
author_rank: Contributor
timestamp: February 23, 2021, 01:49:41 am
content: The board itself is 4 layers (internal power and ground layers) but the internal planes are hidden.This is kind of what I'm talking about with the vias;It just doesn't look right to me, but I don't see a better way to do it..
Petlinux on Zynq FPGA - Developing on Windows - Page 1
Forum section: electronics / general

author: 8163jb
author_rank: Contributor
timestamp: February 04, 2021, 06:26:32 pm
content: Hi guys,After recently having to bring up an embedded linux project on a Zynq 7015 using petalinux, and going through the various trials and tribulations involved, I managed to get Petalinux working on a windows machine using WSL. Hopefully managed it in such a way that a team can develop the kernel and the application code simultaneously and use git to manage the whole thing.The process was painful enough that I decided to write a post about the whole thing, in the hopes that I can make someone elses day a little less painful.Anyway, if anyone has any interest in the subject the post can be found here:https://doayee.co.uk/petalinux-on-windows-via-wsl-and-git/I was pretty astounded at how arcane the process seems to be for this thing, and how little support Xilinx is willing to give for any petalinux install that isn't theexact sameparameters as they once set up...Anyway I hope this helps someone.
Pico-ITX? - Page 1
Forum section: electronics / general

author: Jester
author_rank: Frequent Contributor
timestamp: December 18, 2020, 10:53:46 am
content: Hi,I'm really not up to speed on the latest and greatest small form factor Win7 compatible embedded PC's, so I'm looking for advice as to where to purchase a suitable replacement for a dead Pico-ITX board.The existing software runs flawlessly under Win7 so I simply want to swap the existing HD over to the new PC.The dead embedded PC that needs to be replaced is a EPIA-P900. The EPIA-P900 is a Pico-ITX form factor 72mm x 100mm. This ran fine with 2G RAM and a small HD. It used a total of 4 USB ports. I don't really have room for a larger board.Any advice is welcome. Thank you.

author: bingo600
author_rank: Super Contributor
timestamp: December 20, 2020, 09:21:54 am
content: Maybe Odroid H2 ?https://www.amazon.com/ODROID-Intel-Quad-core-Processor-Seperately/dp/B07LBB17P2110x110mm

author: 2N3055
author_rank: Super Contributor
timestamp: December 20, 2020, 09:38:35 am
content: I used few Aaeon (part of Asus group) PICO-ITX boards and they worked fine.. I can't attest to longevity, they are now 2-3 years old..We have yet to see how long they will last..Also take a look at VIA EPIA-P910..Just moving HDD to new board would need same board, or board with sufficiently similar processor/chipset, so at least kernel boots, and then it P&P autodetects other drivers...There is no guarantee you will be able to do that. Sometimes you do, sometimes don't...

author: SiliconWizard
author_rank: Super Contributor
timestamp: December 20, 2020, 11:52:56 pm
content: We don't really know what your budget is, nor what specs you're after, although I guess the EPIA board you're mentioning is probably a starting point.Gigabyte, MSI and Asrock have some:https://www.gigabyte.com/Motherboard/Embedded-IoT--Form-Factor--Form-Factor---IOT-Pico-ITX-Motherboardhttps://www.asrockind.com/en-gb/pico-itxhttps://ipc.msi.com/products_list/Single-Board-Computer/Pico-ITXAnd probably a bunch of other vendors...I've used a Qotom board in the past:https://qotom.net/product/90.htmlNot this one, but something similar, and AFAIR, the board was decent and cheaper than your average Pico-ITX motherboard.

author: Nominal Animal
author_rank: Super Contributor
timestamp: December 21, 2020, 07:02:12 am
content: Quote from: bingo600 on December 20, 2020, 09:21:54 amIt's manufactured by South KoreanHardKernel, and the current one isH2+, costing USD $119 without memory. It is a bit nitpicky about the DDR4 RAM modules it can use, so see theH2/H2+ Confirmed RAM Modules Listfirst.I have a couple of other Odroid boards (C1+, HC1), and really like them a lot, but since I don't have a H2 or H2+, I really don't know how good it is. If I needed a tiny x86/x86-64 machine, I would definitely get an H2+, though.
CJC accuracy issue with a removable connector - Page 1
Forum section: electronics / general

author: peter-h
author_rank: Super Contributor
timestamp: December 17, 2020, 04:37:38 pm
content: If one uses the "classic" (HUUUGE) thermocouple connectors, these have a hole in the middle for a sensor.But they are hard to use due to size.Most equipment manufacturers use normal screw terminals. I know some glue a thermistor, or even a diode, to the back of the terminal block.But let's say you are using a plug-in screw terminal. Then there is no way to measure the temp of the plug-in portion, which is likely to be a few degrees cooler than the sensor - even if the sensor is on the PCB and right next to the PCB part of the connector. Experimentally I see a delta of about 3C.I reckon they must be compensating for the delta-T, and this is probably constant over the usual temp range because for a given power dissipation the delta will be constant over ambient, to a first order... One could also measure the incoming powerAnd thermocouples aren't usually expected to be super accurate...
How to decode BG7TBL GPSDO data with Arduino? - Page 1
Forum section: electronics / general

author: 705jas
author_rank: Contributor
timestamp: October 19, 2020, 10:08:59 am
content: HI All,Has anyone come up with a way to decode the data coming from a BG7TBL GPSDO onto an Arduino. I would like to be able to display the time etc on an LCD, via Arduino, connected directly to the GPSDO serial output. I can get it to decode on the PC with VisualGPS without issue but (I am a noob at Arduino) no luck with Arduino. Any help appreciated.cheers

author: MIS42N
author_rank: Frequent Contributor
timestamp: December 11, 2020, 09:49:53 am
content: According to the specs for the BG7TBL GPSDO, the output is NEMA messages. Do a search on arduino nema decoder there are several articles.
Drop-in Wifi component  - Page 1
Forum section: electronics / general

author: MadScientist
author_rank: Frequent Contributor
timestamp: October 02, 2020, 10:10:07 am
content: Im looking for a low cost drop in wifi interface , preferably controlled by SPI or I2C, that I can use in embedded projects , Im not a great fan of the ESP32 and mostly code for Arm Cortex-M. There are modules like the Microchip RN1810 but these are pricey and use standard ASCI UART commands , which Im trying to avoid ( I'd prefer a binary interface ) . The ST SPWF04S seems to be end of lifeany ideasDave

author: sokoloff
author_rank: Super Contributor
timestamp: October 02, 2020, 11:40:27 am
content: I don't know if your objections to ESP32 also apply to the ESP8266, but that's often used as a cheap interface to WiFi. (If your objection to ESP32 is Espressif related, that doesn't help. If it's price, space, or power related, 8266 might be a better fit.)

author: Doctorandus_P
author_rank: Super Contributor
timestamp: December 05, 2020, 02:15:11 am
content: What is your basis for your dislike of ESP32?In the beginning both software and hardware documentation was a bit shaky, but from what I've heard both documentation and software has improved a lot over the last few years and apparently the API is now quite reasonable.

author: james_s
author_rank: Super Contributor
timestamp: December 05, 2020, 03:25:52 am
content: I've used quite a few of the esp8266 modules, using the arduino environment they're rock solid. I have an environment monitor sitting on my desk in the office I haven't been to since March and it just keeps ticking away pushing the data out to dweet.io. Once you get them going they're as stable as anything.
Raspberry Pi Controlled power supply - Page 1
Forum section: electronics / general

author: uofmrob
author_rank: Regular Contributor
timestamp: December 01, 2020, 06:09:25 pm
content: Hi Everyone,I'm certainly an electronics novice, but I've been trying to figure out a way to control an electromagnet with a Raspberry Pi. I thought that I had figured it out trying to use an Adafruit potentiometer and a power supply kit, but the potentiometer doesn't seem to work the way that I thought it did. I purchased these two devices with the thought of wiring in the Adafruit potentiometer in place of the pot.https://www.adafruit.com/product/4286https://www.ebay.com/itm/LM317-Adjustable-Voltage-Power-Supply-Board-Kit-Electronics-DIY-1-25V-12V/142666414264?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2057872.m2749.l2649I need to be able to control the current of the magnet from 0 to about 500 mA. I have a magnetic field meter and just calibrating the field should be sufficient (i.e., I don't need any feedback control or anything). Does anyone have any ideas on how to do this cheaply?Thanks!Rob
are all CompactFlash cartridges "True-IDE"? - Page 1
Forum section: electronics / general

author: DiTBho
author_rank: Super Contributor
timestamp: November 29, 2020, 06:41:24 pm
content: For a couple of CISCO routers, I need something flash-based with a CF connector able to accept IDE commands; so I think I need a "True-IDE" CompactFlash cartridge.I wonder, are all "True-IDE"? Or have I to worry about and to look at specifications (which are usually not easily available)?Which is the best brand to look for? SanDisk? Transcend? ... I need something able to read/write at 10-20Mbyte/sec.

author: NiHaoMike
author_rank: Super Contributor
timestamp: November 30, 2020, 12:30:56 am
content: Consider a SD to CF adapter, in particular check the reviews for mentions that it works in iPod Mini since that indicates it supports IDE mode.

author: T3sl4co1l
author_rank: Super Contributor
timestamp: November 30, 2020, 05:07:30 am
content: Far as I know, anything that fits into a bog standard CF slot, is bog standard IDE.They are getting rather old though. Probably still available? An SD adapter updates your storage card but beware that SD cards may be limited on speed (there are numerous grades). I assume such an adapter also needs to do some buffering (at the very least, it will have to buffer serial packets -- but that doesn't amount to much real time by itself), no idea if that will also affect maximum speed.Tim
Show layer number while printing on Creality CR-10 - Page 1
Forum section: electronics / general

author: MarkF
author_rank: Super Contributor
timestamp: September 27, 2020, 10:33:48 pm
content: Ever want to see the current layer printing instead of the useless elapsed time?(Maybe some ambitious programmer out there can finish this implementation for the other printers.)Sorry, this is ONLY FOR MARLIN 1.1.9.1 on a Creality CR-10I have not been able to get Marlin 2.0.#.# to build with the Arduino IDE.I just finished a modification to Marlin for my Creality CD-10 to showthe current layer being printed instead of the elapsed time.The change parses the GCode comment lines for statements:;LAYER_COUNT:####;LAYER:####that are generated by Cura 4.6.2 and displays the layer info above the progress bar.If the ";LAYER_COUNT:" comment is NOT found, the display reverts back to showing the elapsed time.Edit: See 2nd post for updated source files.

author: MarkF
author_rank: Super Contributor
timestamp: October 23, 2020, 03:02:31 pm
content: Miscellaneous tweaks for CR-10 Mini:-- Status screen layout-- Hide layer display when print ends-- Added Manual Mesh Bed Level-- SD card alpha sortMore tweaks:-- New CR-10 logo for status screen-- Three animation frames for the fan

author: MarkF
author_rank: Super Contributor
timestamp: October 24, 2020, 11:23:17 pm
content: Fan animation(Cleaned up fan blades from dogm_bitmaps.h)Multi-hotends and fan frames
External reset pin on MC9S08PA16 wont reset initially. - Page 1
Forum section: electronics / general

author: Circlotron
author_rank: Super Contributor
timestamp: October 08, 2020, 12:58:23 am
content: A board I make has a MC9S08PA16. The datasheet says paragraph 2.2.4 say "A low on the RESET pin forces the MCU to an known startup state." The thing is, the RESET pin has multiple functions - PORTA5, IRQ, TCLK0 and RESET and I'm not sure RESET is the default. If I power it up then do a reset from the programmer it tells me the MCU is not responding so I cycle the power, press ok and it is reset. From that point onward the programmer can reset it. What am I doing wrong. I'm using a P&E USB multilink thing. Not sure what version the programming software is, I'll have to wait till I get home. It does seem pretty buggy.

author: m k
author_rank: Super Contributor
timestamp: October 20, 2020, 09:44:49 am
content: Maybe your other reset is too fast and it's not a real reset but something like low power.Or maybe your USB port is hibernating and waking up takes time.Or maybe the controller needs a falling edge.