/r/embedded
This sub is dedicated to discussion and questions about embedded systems: "a controller programmed and controlled by a real-time operating system (RTOS) with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints."
Welcome to embeddit!
This sub is dedicated to discussion and questions about embedded systems: "a controller programmed and controlled by a real-time operating system (RTOS) with a dedicated function within a larger mechanical or electrical system, often with real-time computing constraints."
The FAQ is in the wiki.
(*) At mods' discretion, certain self-promotion submissions from people who contribute to this sub in other ways may be allowed and tagged with the "Self-promo" flair
Complete rules:/r/embedded/about/rules/
After posting a submission, please select a flair:
After your question is answered, please change the flair to "Resolved".
/r/embedded
Hello,
I'm a beginner in embedded systems/firmware. I just got done with a bare-metal programming course that taught me things like interrupt programming, I2C, SPI, and ADC.
I now want to build an automated plant watering system, which is something I've seen online and I think that would be a good first project to do. I know I'll need a soil moisture sensor and a water pump.
Could I get some tips on things to check when ordering such items? What do I need to confirm on the product info page in order to see if my microcontroller (STM32) is compatible with such sensors?
I am assuming that some things would need to see are what communication protocols the sensor uses, and maybe the voltage needed to operate? I have a 5V pin on my STM32 which I have used previously to power an ADXL345 accelerometer. What else would I need to check?
Thank you.
Has anyone been able to program the MSPM0G3507 on the register level? I would love to see how its programmed.
I'm working on an ESP32-S3 project where I need to add an RFID reader, and I’m considering the MFRC522. However, I’m running into an issue with I2C address conflicts.
My setup includes a Waveshare ESP32-S3 4.3" LCD with a CH422G touch controller, which reserves the following I2C addresses:
```
0x20 - 0x27 0x30 - 0x3F 0x5D
```
I need to confirm:
If the MFRC522 won’t work in I2C due to conflicts, I’m considering an I2C multiplexer (TCA9548A) or switching to SPI mode (if supported by my display). Would love to hear what others have done in similar setups!
Thanks in advance!
I'm working on a Arm Cortex based microcontroller and using Cmake as build system. Taking a look at the .map file under the section "Linker script and memory map", I can see references to the same static library multiple times. E.g: LOAD foo.a LOAD foo.a LOAD bar.a ...
Is this a problem ? Does that mean the library got linked multiple times ? I'm suspecting it as my application is linking against libraries that require inter dependancies: app links against A, B & C where A itself links against B.
https://www.reddit.com/r/hacking/s/T9NfxtMh0s
Someone in the community recommended posting it here.
Hi,
I’m using an STM32 MCU. I’m communicating with a module that uses AT commands. I need to know if the module is responding.
My current thought is to call HAL_UART_Receive_IT before calling HAL_UART_Transmit and have a while( rx_flag == false ) where the flag will be set in the receive callback function but I want this flag to expire after a few seconds.
Is using a while loop for this appropriate and what’s the best method to check how much time has elapsed in order to exit the while loop after that much time?
I haven’t had any experience with timers yet, assuming they’ll be what is required.
I'm new to the game and when talking about safe firmware updates of embedded devices i am quite lost. I have heard of a concept where memory is split in two, one "running" and one "golden" part. The update is done in one part and, if successfu, it becomes the running one. I dont know which terms to search online to learn more about it. Any clues? Thanks in advance
I bought this board a long time ago with 3-4 click boards, 7" TFT and the V8 easypic dev board. I want to go deeper into the Pic microcontroller but what software/IDE should I use? Is necto studio good?
I am very familar with Arduino (been doing it for years) and I want to step up my game.
thanks.
Hey everyone,
I’m working on a school project where I need to build a mock version of an Apple AirTag—something that can be tracked via Bluetooth Low Energy (BLE) and possibly play a sound when located. I don’t need it to integrate with Apple’s Find My network, but I do want to make it as compact and functional as possible.
I’m looking for advice on the best parts to use for this. Right now, my rough plan is:
Microcontroller – ESP32 or nRF52832 (which is better for low power + BLE?)
Battery – Coin cell (CR2032) or LiPo (but worried about size & longevity)
Buzzer – To make a sound when triggered via BLE
Enclosure – Ideally something small, but open to ideas
Other sensors/components? (Not sure if I’m missing anything crucial)
1️. Which microcontroller is the best balance of size, power efficiency, and BLE capabilities?
2️. Battery choice: What’s the most power-efficient way to keep this running for a long time?
3️. Any must-have components I might be overlooking?
4️. How small can I realistically make this while keeping it functional?
If anyone has experience working with BLE devices, beacons, or compact hardware builds, I’d love to hear your thoughts! Thanks in advance.
Hello,
I am using this TFT LCD. I connected my Uno to the LCD as shown in the image on the Adafruit site, and I used this example to test my display.
My code always stops after ts.begin() fails; it seems like the STMPE610 controller fails to initialize. I noticed they defined a CS pin on pin 8 for this controller, but I do not see an additional CS pin on my module, and I do not see pin 8 on the Arduino connected to anything in the image on the Adafruit site.
I removed the STMPE610 code and ran the simple program below to turn the LCD blue, but the LCD still would not respond.
#include <SPI.h> #include <Wire.h> #include <Adafruit_ILI9341.h> #define TFT_CS 10 #define TFT_DC 9 Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC); void setup(void) { Serial.begin(9600); tft.begin(); tft.setRotation(1); } void loop() { tft.fillScreen(ILI9341_BLUE); }
Sorry for my lack of electronics knowledge. What is the most common way to add/flash code in electronics. Do you use USB or have dedicated pins? How is it done?
Hello,
I'm looking for the SVD file for the Cortex-M33 but have been unable to find it so far. Typically, I’ve had no issues finding SVD files for specific devices, but it seems that ARM does not provide SVD files for their Cortex families?
Has anyone been able to find the SVD file for the Cortex-M33 (or any other Cortex)? If so, where did you find it?
Hi guys, I'm a little upset because I got called a "leecher" on the OpenWRT forum for asking for advice on what kind of programming approach to take. Here is the link (if you're interested): https://forum.openwrt.org/t/application-development-for-iot-gateway-userspace-or-kernelspace/223248 . The post that I'm referring to is this:
> You should not take a project from a well known freelancer site, with a budget of 100 bucks and expect others to do your job here for free. One more "leecher" here.
and a follow up:
> I regularly check relevant freelancer sites for interesting small projects, I might bid for. And to see, what actually is requested quite often. Yes, it regularly happens, that such projects are taken for lowest price, and then consultation for free is requested here. I even once had the unpleasant case, that I bid too high on a project, lost and the winner asked here for free advice
which left me furious because I am genuinely inexperienced in Embedded Linux and was asking for advice (not code, not libraries - just insight from people who I think I can gain valuable insight from because the area is pretty niche). Isn't that literally what forums (even this one) are for? I have ZERO clue what post/freelancing gig this A-hole is referring to lmao. I don't mind answers that tell me that I haven't done enough research (which I try my best to do and articulate) - its humbling but part of the learning process and in the long run I do learn something (even if out of spite). But this interaction left a really bad taste in my mouth and left me wondering about what I can and cannot ask on professional forums. Why does this guy get to be so confident in his prejudice, baselessly accuse me of something so random, insult me and basically gatekeep advice because of a supposed bad experience he had with someone else? Do let me know if you feel like I'm in the wrong because stuff like this is more discouraging than I'd like to admit :(
I'm trying the flash the nrf52840 dongle with nRF Sniffer for Bluetooth. Here the steps that I'm following
**Problem is the that the "Write" option is greyed out.**
Setup details:
Anyone run across this issue? Anything else I can check?
Hello everyone,
I’m currently learning GStreamer and would like to stream my Jetson screen to my PC. I’ve managed to achieve this using UDP, but I’m encountering some challenges with TCP and RTSP. Here’s what I’ve done so far:
UDP Setup
Server-side command:
gst-launch-1.0 ximagesrc ! "video/x-raw" ! nvvidconv ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! nvv4l2h264enc maxperf-enable=1 bitrate=32000000 ! h264parse ! rtph264pay ! udpsink host=192.168.100.4 port=8554 -e
Client side:
gst-launch-1.0 udpsrc port=8554 ! application/x-rtp ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink
However, when using UDP, I experience a lot of artifacts when moving windows around.
Trying TCP: I attempted to switch to TCP by replacing the sink and source elements with tcpserversink and tcpclientsrc. Here’s what I used:
Server-side command:
gst-launch-1.0 ximagesrc ! "video/x-raw" ! nvvidconv ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)NV12, framerate=(fraction)30/1' ! nvv4l2h264enc maxperf-enable=1 bitrate=32000000 ! h264parse ! rtph264pay ! tcpserversink host=0.0.0.0 port=8554 -e
Client-side command:
gst-launch-1.0 tcpclientsrc host=192.168.100.20 port=8554 ! application/x-rtp, encoding-name=H264, payload=96 ! rtph264depay ! avdec_h264 ! videoconvert ! autovideosink
However, on the client side, I get the following error:
Setting pipeline to PAUSED ... Pipeline is PREROLLING ... ERROR: from element /GstPipeline:pipeline0/GstTCPClientSrc:tcpclientsrc0: Internal data stream error. Additional debug info: ../libs/gst/base/gstbasesrc.c(3177): gst_base_src_loop (): /GstPipeline:pipeline0/GstTCPClientSrc:tcpclientsrc0: streaming stopped, reason error (-5) ERROR: pipeline doesn't want to preroll. Setting pipeline to NULL ... Freeing pipeline ...
I also attempted to use RTSP, referencing this post: https://community.hailo.ai/t/sending-gstreamer-pipeline-output-over-rtsp/135 , but I couldn’t get it to work with the provided examples. I’ve also checked other forums, such as the NVIDIA developer forums, but the solutions I found didn’t help much.
Question: Is there a way to stream the Jetson screen to my second PC using TCP or RTSP? If so, could someone guide me on how to set up the pipelines correctly? Any suggestions or examples would be greatly appreciated!
Additional Question:
On the Jetson, I’ve used NVIDIA HW-accelerated encoding and managed to achieve around 100ms latency. Without hardware acceleration, the latency was around 300ms. I don’t have much experience with video encoding and decoding (yes I know that wifi latency has an impact, I got 100/80 dow/up speed and my ping is stable on 4ms), but is this level of performance expected when using hardware acceleration? On my PC I didn't (not yet :| )setup the HW-accelerated decoding.
For reference, my PC has an Intel i7-14th Gen CPU and an NVIDIA RTX 4060 Mobile GPU.
Thank you in advance for your help!
I'm using cyw20822 with EZ-serial firmware (from infineon). When I tried to switch from legacy to extended based on their documentation, the device disappeared from the scan list. This is what I did
/CAX #stop adv
SACP,P=1,M=1,T=6 #P=1 (enable ext adv), M=1 (discoverable), T=6 (Undirected connectable)
/CA #start adv
When I get adv parameters, it shows that it's in ext adv mode
GACP #get adv parameters
@R,0065,GACP,0000,P=01,M=01,T=06,H=00,I=0030,C=07,L=00,O=0000,F=00,A=000000000000,Y=00,E=00,S=00,D=00,N=0018
I played around with other parameters as well, but as long as I changed P=1 (ext) and T = 6 to A (adv types), the device disppeared
Appreciate any help/suggestion!
I have a simple software based digital audio modem. This modem is meant to run on any common PCs/mobile phones with a soundcard, and a mic & speakers. I would like to extend it's range by legally connecting it to a radio (this was actually the main reason why I started developing it). The radios, I and people I would like to test this with are using, have separate mono audio jacks for connecting external mic and speakers to the radio. I want to make this process as smooth as possible, so it's easy for other people to test it out.
The simplest option is to use just the audio jack ports, but I am facing these problems:
- Immediately after connecting the audio jack to the device the radio starts transmitting even though the device didn't send any sound.
- Connecting the audio jack causes on most devices their OS to redirect any sounds to this port. Which is of course undesirable.
Therefore I have gave up on this idea, since it seems I need some more logic that would be able to disconnect the audio cable from the radio if no audio signals are being sent and that is also able to change the way the OS identifies it, so it can make sure that only the audio modem app itself will be able to use this interface.
I was thinking about using the USB port as an alternative. Since it's digital, I would need an external soundcard on the USB device. The ones you can buy usually have the plug-and-play feature, which again, causes the OS to redirect all the default audio stream to it. But at least it's in a more controlled manner which gives me hope that maybe this could be the way to go.
My questions are:
- Is it possible to override the way a USB device identifies itself when being connected? I need to make sure that the OS doesn't assign it to itself, because I am trying to access it from a website and it only allows access to those USB devices that are not already assigned to something else (for example this repository tries to fix this exact problem for Arduino: https://webusb.github.io/arduino/ ).
- What are the options to prevent the radio from transmitting empty noise and blocking the radio channel when I am actually not playing any modulated audio wave?
I would really appreciate any advice on this topic. Thanks :-)
I have two old Direct TV decoders:
I was just wondering, is there a way to re use those devices? Installing Adroid TV, fashing them, installing Linux, something useful?? Has someone tried??
I intend to meet embedded developers in person and learn about embedded TLS.
I am fascinated by how cryptography requires extra care to preserve system resources.
What in-person embedded security conferences would you recommend I attend?
I recently noticed that TLS libraries exist that are specialized for embedded devices. Such libraries exist since other more popular TLS libraries (e.g. OpenSSL) have too large a footprint to be suitable for use in embedded devices that have low system resources.
I found this article explaining some differences between MbedTLS and WolfSSL--which seem to be major embedded TLS libraries used in the industry.
I was wondering if anyone here has first-hand experience using TLS libraries designed for embedded devices such as WolfSSL, MbedTLS, SharkSSL, BearSSL, etc.
Why did you start using them?
What were common problems you noticed using these embedded TLS libraries?
i tried very many things on this thing but i encouter this problem very much, a few days ago it stopped working (my computer dosen't detect it) but the light on the boards lights up, i tried other cables, other computers and nothing works, does it mean my raspberry pi pico fried?, i used this cable before and it worked perfecly, i don't know what to do.
I've been reading recently about various Chinese initiatives to develop their own OSs for their domestic vehicles, such as HarmonyOS by Huawei, SkyOS by NIO, or AliOS by Alibaba. Different OEMs are using them, so I was wondering if they keep the original OS for cars exported abroad or use a mainstream one like QNX or AAOS?
What is middleware? For example, why is FreeRTOS listed as middleware in STM32CubeIDE?
So in your embedded dev life, working with uCs did you have a chance to add an FPGA to the project to accelerate/delegate tasks? How did you implement it?
I am trying to visualize some data that are serially printed through the RTT of the black magic probe from nRF52832. the serially sent data are just accelerometer values from BMI323 with a sampling rate of around 50HZ. the problem is that there is a big delay (~ 5 seconds) between any action and the associated printed data.
as shown in the image, I just shake the accelerometer in both x, y-axis and after stopping, it stills shows the plots till like 5 seconds later:
I didn't know what the value of 'Baud rate' shall be so I set it with any number (I tried to change it to different values but nothing changed since there is nothing called Baud Rate in RTT, I think). is this normal?
EDIT: I tried to Serially print it and it prints in real-time, I don't know if there is anything to adjust more output rate on the serial plotter or not.
I have been reading about embedded linux devices, specifically SoCs with built in memory like the F1C100s, which have RGB interfaces for LCDs and have been wondering if it is possible or feasible to convert this into an HDMI output, even if its at a low resolution. Basically what this project here does using an HDMI transmitter chip.
Are there any recommended resources for learning how to go about doing this and how to select the right chip? Is sending a parallel RGB signal through an HDMI transmitter even the right way to go about doing this?
Thank you in advance to anyone who takes time to respond.
i have a ft232h+eeprom device, it is perfectly recognized as a jtag device on windows, but fails on ubuntu (24.04). i find the reason it cannot be recognized on ubuntu is that ft232h cannot be configured as mpsse mode.. i think the hardware itself should be fine because it is the same setup running on windows.
i use either libmpsse_spi.h or ftd2xx.h to configure it into mpsse mode but all failed. The device itself can be found and the device info can be read. A ft_handler can also be generated but it will fail at configure to mpsse mode step..
the log for libmpsse_spi method is below, the fail status is 4, which i dont know what it is. ''' Number of available SPI channels: 1 MPSSE channel opened successfully. Handle: 0x0x5cda758f7e20 Channel 0 Information: Flags: 0x3 Type: 0x8 ID: 0x4036014 LocId: 0x10e SerialNumber: B1744B38ABCD Description: Digilent USB Device ftHandle: 0x0x5cda758f7e20
ChannelConfig: ClockRate: 100000 LatencyTimer: 255 configOptions: 0x0
Failed to initialize MPSSE channel: 4 Handle after Fail: 0x0x5cda758f7e20 ''' the log for ftd2xx.h is below,.the fail code is 1, and according to d2xx program guide, it seems an error of invalid handler.. but then i have no idea..
it is also very strange when using ftd2xx method, the handler changes from 780 to 700. i dont know why
" Number of available FTDI devices: 1 Device handle before opening: 0x(nil) Device handle after opening: 0x0x5dd0838e4780 Device handle after getting device info: 0x0x5dd0838e4700 Device Information: Description: Digilent USB Device Type: 0x8 ID: 0x4036014 LocId: 0x34373142 Failed to enter MPSSE mode: 1 Device handle after failure: 0x0x5dd0838e4700 "
is there any idea? many thanks in advance..
Hi, Im working on some project and Im struggling to choose the Best mcu. I need to have:
Since i would be working on AT Commands in uart so thougth about writing in c++. I only have experience in C but i guess i will figure it out. I thout about picking esp32s3 with esp-idf at c++. I have experience with esp-idf in c. But maybe you have better sollution? Smalleer mcu or library for managing strings in c? I do not need any ble or wifi etc. Im open to suggestions :)