/r/embedded

Photograph via snooOG

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!

Description

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."

FAQ

The FAQ is in the wiki.

On topic subjects

  • Hardware design that includes a micro
  • Low level software (e.g., C, assembly)
  • Homework help; but make it clear it's homework

Off topic subjects

Rules

  1. Be civil: do not insult; no all-caps, no excessive "!" and "?", please.
  2. Submissions must be on topic
  3. If asking a question, ask the actual question, fully yet concisely, right in the title
  4. No spam; no commercial posts, links to commercial pages (including crowd funding sites), no employment ads (job offers and requests go to the weekly thread), no self-promotion (*)
  5. No memes (pictures with superimposed text), shit posts

(*) 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/

Link flairs

After posting a submission, please select a flair:

  • General: not a question, yet on topic
  • Tech question
  • General question: any question that is not technical
  • Off-topic

After your question is answered, please change the flair to "Resolved".

Related sub-reddits:

/r/embedded

191,285 Subscribers

4

Curious about the serialization implementation on ESP32 product. Basically they are flashing the firmware first, and then serialize each unit? And where serial might be stored - in flash or eeprom?

5 Comments
2024/12/20
18:46 UTC

1

Anyone using Andonstar scopes and encounter uSD card corruption?

May not be the best spot, but embedded OS and a tool often used in embedded work...

Looking for others using Andonstar scopes that have encountered file system corruption on their SD card recordings. Twice I've encountered uSD corruption while recording and seems like a firmware/OS issue when recording when disk space is nearly exhausted.

I've got the AD249S, which is a decent 10" screen budget scope, the image is pretty good. But corrupting the SD card a real problem. I often record work/rework in the event I need to review my work. When the system detects the disk is full recording stops with a message that there's no space for recording. The system knows there's no space. But it may not handle this condition well.

Taking the card to a windows system (the sd card is FAT32). I've found the disk file system is partially intact. The normal directory structure is:

\DCIM\Photo

\DCIM\Movie

When corruption happens I've seen the movie folder either disappear or turned into a file of 64K (assuming min block size for 32gb card). Simple tools like windows disk check are unable to "fix" the structure. The files are all intact and can be recovered with recovery tools but the filesystem is bad and would need a format to get to a good state.

Andonstar support is kicking the can, blaming everything but their software. I'm currently testing other 32gb cards to see if the pack-in card was defective. If others have seen the same, please share because I'd to provide them feedback if others have the same problems. Thanks.

https://preview.redd.it/aol7xhnef18e1.png?width=1225&format=png&auto=webp&s=1f9f5b199938b89396b95b92d58d750fc6a92fd3

4 Comments
2024/12/20
17:22 UTC

4

Communication with the qectel lc29h(ba) module

Hello guys I am trying to sends comands to an lc29h gps module. It works when i use the QCOM v1.6 provided by qectel, but when i am trying to send a command using tera term or puty I receive no response. I want to mention that the setial port is configured cirrectly. The photo is a dev board. Has anyone encountered this issue?

3 Comments
2024/12/20
16:33 UTC

1

Application Trying To Access Out-of-Range RAM Location ONLY After Bootloader Jump

Yet another issue in the saga of my project: I have a Cortex M0+-based project that implements a bootloader and an application (Note: M0+ has a VTOR). I have modified the linker scripts for each of these to place them at the appropriate address in FLASH (bootloader starting at 0x00, after the SP) and the application starting at 0x6000. These two use the same RAM region; I did not segregate the RAM between bootloader and app.

When jumping to the app from the bootloader, the application is hitting a Hard Fault at runtime after a short time. After debugging, it appears the application is trying to access a RAM address beyond the max RAM size of the device (the correct RAM size is in the linker script, as well as the map file). When running the app naked, all works fine.

I am not sure how to debug this further to figure out where it's getting this RAM address. Thoughts?

11 Comments
2024/12/20
16:15 UTC

0

Guide for a beginner

So i am interested in the embedded world.I have a adruino uno and i started to program on it.However programming on adruino ide doesn't feel like i am learning anything at all.Every function is given there so.I know some basic c and c++ and I have looked into baremetal programming and it seems interesting . So i am confused whether should i directly jump into it (concerned if it would be too much to take for a beginner)or should i first learn adruino ide first .

2 Comments
2024/12/20
15:47 UTC

2

Laptop hangs while working on ble

Hello, i would like to know if anyone ever encountered this and solved it. This is my general setup :

  • A Ti simplelink sensortag as the peripheral (and target)
  • A nrf52840 as sniffer
  • my laptop hci0 or my phone as central

Now that i need to send arbitry packets to the peripheral, i have to use my laptop as central. I work with whad. The matter is whenever something goes wrong on the sending part, the whole laptop hangs. I can no longer launch gui apps, control my terminal, i even have to shut it down manually.

This spoils my work and wastes my time. Just in case, im using fedora.

Thank you

2 Comments
2024/12/20
15:02 UTC

4

What you struggle on your daily basis that you wish should be fixed with a new tool or technology?

Hello all! Ive been working as an embedded systems / IoT developer for the past year. I'm loving it, and I'm seeing that we still lack a bunch of solutions to scale both techwise and on the business side. I'm on my way to make a decision on what to reserach on this field, so for that if you can give me some advices on what type of struggles you face on your daily basis that you think could be solved, that would make your life and job easier but there arent really any tool to solve it, please let me know. Thanks

22 Comments
2024/12/20
14:41 UTC

0

What is the easiest way to use these screens, such as SPI TFT?

10 Comments
2024/12/20
12:30 UTC

2

Programming an Intel Atom CPU on a PC104 standard SBC

I’ve got a PCM3365 single board computer which I wish to download a linux distro such as arch or lubuntu which possesses very minimal ram and storage requirements. I am very new to programming on linux based systems and wish to know if there is any documentation that can assist with programming on Intel Atom CPUs using linux, and how to effectively interface with various peripherals like the ISA bus or even gpio for that matter through C.

There seems to be less than minimal documentation of PC104 architecture and the such which is annoying so I’m hoping anyone has either had experience and willing to help or can lead me in the right direction.

5 Comments
2024/12/20
11:30 UTC

7

Overcoming bad documentations in embedded systems

Hi everyone, I apologize in advance for asking a kinda surface level question about a career in embedded systems.

I'm a CS major who's on the fence about whether I should pursue a career in embedded systems. After reading a bit about embedded systems, it seems that the biggest problem that an embedded systems engineer has to deal with is horrendous documentation. There's some nightmare stories of how example code from manufacturer doesn't work, problems with doxygen generated documentations, how most documentation are never enough for you to teach yourself off of, etc. Basically, you're expected to complete xyz tasks with some hardware, but are given little/no help from manufacturer's documentations/the internet when you encounter a problem, essentially having to somehow figure it out on your own.

I don't know how that is even possible. At this point I'm guessing that you guys just spend hours tinkering/sandboxing in hopes of running into some solution by luck, since documentations are bad and you start off with a knowledgebase that's full of holes.

Overall, I'm wandering if what I just said is really the case, whether the problem I've just wrote about is really as common as I think it is? And if it is, how do you guys learn in spite of terrible documentations?

Thank you so much, I'd really appreciate detailed insights/advice!

21 Comments
2024/12/20
11:25 UTC

2

SOM Compared to Designing Own SBC?

When do you move from an SOM based design to designing your own bespoke SBC around a microprocessor? Obviously, an SOM based system is easier from a PCB design perspective, but what are design/technicals advantages that a custom SBC systems brings compared to using something commercial like a Pi Compute module with a self designed carrier board?

13 Comments
2024/12/20
06:39 UTC

0

Guidance needed: Help with TIVA series C launchpad TM4C123GH6PM interfacing with LCD

Hi, im fairly new to embedding programming and am really struggling with a project.

I am trying to connect the SPLC780D LCD to my tiva launchpad (in 4 bit mode) but am unable to initialise it. I tried using someone else's code but then when i ran it, every time i press the reset button on the launchpad, a cursor appears in a new place and the contrast is also messed up (shows straight lines).

I also don't know much about systick and clock timings so maybe that might be the issue but im clueless as to how to fix it.

It's hard to explain in a post but if anyone is experienced with using the tiva launchpad and is willing to spare me some time to talk in private and explain some fundamentals to get me going and answer some questions, you would genuinely save my life.

regards,
a struggling engineering student

https://preview.redd.it/okr87mv99w7e1.jpg?width=2886&format=pjpg&auto=webp&s=edd00229371f2f8adac09e9cffcc1d2c91b12054

4 Comments
2024/12/19
23:59 UTC

26

Good alternatives to OpenCV

Hey I was going to do an Object detection project with a stm32, ultrasonic sensor and a camera module.

I’ve used OpenCV in the past with CPP and Java(horribly slow) either way and was wondering if there’s good alternatives to this lib or if it’s proficient enough running on an embedded device.

20 Comments
2024/12/19
23:59 UTC

1

Atmel-ICE and openocd failing where J-Link works just fine.

Okay, so I have a firmware/flash management scripting harness so I can transparently switch out which toolset I'm using. I've been using my Microchip J-32 Debug Probe, but that is now needed by another engineer, so I'm pivotting to my Atmel-ICE and openocd as my toolset. Problem is, it's not working. Everything I've checked in my scripts and system tells me it should be.

Every script that touches the target starts with a command called PROG_DETECT so see if the target is even accessible. If it returns true, the script continues. If it returns false, the script aborts with an error message. Okay, cool. What is PROG_DETECT doing to get its job done?

$ openocd --file scripts/openocd.cfg <<SCRIPT
> Power on
> Connect
> exit
> SCRIPT

Basicly, that. I just want to see the target powered on and that I can connect to it, and then I bounce. What does that produce when I do it manually?

Open On-Chip Debugger 0.12.0
Licensed under GNU GPL v2
For bug reports, read
http://openocd.org/doc/doxygen/bugs.html
Info : auto-selecting first available session transport "swd". To override use 'transport select <transport>'.
Info : Listening on port 6666 for tcl connections
Info : Listening on port 4444 for telnet connections
Info : CMSIS-DAP: SWD supported
Info : CMSIS-DAP: FW Version = 03.25.01B6
Info : CMSIS-DAP: Serial# = ATML2419102700004808
Info : CMSIS-DAP: Interface Initialised (SWD)
Info : SWCLK/TCK = 1 SWDIO/TMS = 1 TDI = 1 TDO = 1 nTRST = 0 nRESET = 1
Info : CMSIS-DAP: Interface ready
Info : clock speed 400 kHz
Error: Error connecting DP: cannot read IDR

That. That's all I can get with openocd and the Atmel-ICE. To head off the usual questions, the programming cable goes from the CORTEX DEBUG header on my Xplained Pro dev board to the SAM socket on the Atmel-ICE, and the Atmel-ICE is showing the red power LED for the programmer itself, and the green power LED for the target. Everything's 5x5.

One odd ball detail, in that output, it says the Serial# is ATML2419102700004808, except:

$ lsusb -v 2>/dev/null | grep -A 1 "Atmel-ICE CMSIS-DAP" | grep iSerial | tr -s ' ' | cut -f 4 -d ' '
J42700017875

that's not what USB says.

So, what has my brainrot missed? Why am I not connecting? I know I've used this exact toolset, and probably to this exact board in the past.

9 Comments
2024/12/19
23:11 UTC

2

Labview Real-Time and VXWorks

I'm new with working with RTOS technology and am asked to help design a RTOS system. We were thinking of using either:

  1. LabVIEW PC (host GUI) communicating with a VxWorks chassis (and use C++, etc.) or
  2. LabVIEW PC (host GUI) communicating with a LabVIEW Real-Time (and use the LabVIEW Real-Time module)

Has anyone have experienced with either? If so, would you mind sharing your opinions on which you prefer, ease of use, learning curve, etc.?

Thanks in advance.

4 Comments
2024/12/19
21:31 UTC

0

General STM/micro question

working on a project, and need a micro capable of 4 CANbus networks connected at once.

i wanted to use an stm32 chip. like an f4 or even an h7. however all of their chips top out at only 3 CAN networks.

does anyone know why that is?

another question, does anyone have any recommendations for micro's capable of four CAN networks?
i found the PIC32MK line of micro's. been looking at specifically PIC32MK1024MCM064
however, it is quite different architecturally than the STM stuff. MIPS versus ARM Cortex, LL drivers vs HAL, etc

ideally i would like to find a micro which is largely compatible with STM32 firmwares as i will be using a stm32f4 device for proof of concept / prototyping

thanks!

5 Comments
2024/12/19
20:40 UTC

5

Zephyr RTOS for Intel Atom E3825

As the name implies im looking to get zephyr rtos running on an intel atom e3825 processor. The exact board im using is an rtd cma24btd1330hr, which zephyr currently does not have a bsp for. Will I have to start from scratch or is there an easy way to get started. If anyone can point me to a how to go guide for this particular processer that would be awesome. If there isnt then it would also be awesome to let me know.

2 Comments
2024/12/19
20:03 UTC

4

Stm32 and round display

I want to connect a 40-pin st7701s driven 2.1 inch round touch display to stm32f407vet6. I didnt actually buy any of these, because i dont know if that is possible. If yes, how? If not, which stm32 mcu is capable of doing that?

3 Comments
2024/12/19
19:58 UTC

12

Simultaneously download code to Microcontroller

I am currently working on a project involving multiple LuckFox Pico boards, where I have written Python code that runs on startup. For each device, I need to make specific changes (e.g., setting a unique Ethernet IP address). Instead of manually deploying the code and settings to each device one by one, I am looking for a way to automate and simultaneously deploy these changes to multiple devices.

This use case is similar to managing a fleet of devices, such as shipping batches of 20 IoT devices like drones, ESP32-based systems, or other microcontrollers.

I came across Mender.io, which seems to support OTA updates, but I’m not sure how to get started with it. Are there any other open-source tools or frameworks for automating such deployments in the embedded systems world?

Additionally, what is this process of managing deployments to multiple devices called in the embedded/IoT field? Any guidance or recommendations would be highly appreciated.

13 Comments
2024/12/19
17:03 UTC

4

I2C Clock Synchronization

  • Hello everyone, I'm a bit confused about something in the I2C protocol while studying. In multi-master mode, for instance, when we have two masters that want to send data to the same slave device, I understand that if they transmit their data bits simultaneously, arbitration on the SDA line occurs. The SCL line is also affected because the I2C pins are connected, forming a logical AND configuration; thus, the slower clock rate controls the SCL line as well.
  • Here’s where my confusion arises: suppose Master 1 sends a '0' at the same time Master 2 sends a '1'. In this case, Master 1 wins the arbitration by controlling the SDA line, while Master 2 loses and backs off, waiting for Master 1 to send a stop condition. If Master 2 has a slower clock rate than Master 1, it seems that Master 1 would end up sending the data using Master 2’s clock rate. This situation puzzles me.
  • Can someone clarify this for me? Thank you!
2 Comments
2024/12/19
14:21 UTC

1

Error: Serial Bluetooth not available or not enabled. It is only available for the ESP32 chip.

MCU: ESP32-WROOM-32E

Hello,

My goal is to have two ESP32s communicate via Bluetooth. I am using this master and slave code from GitHub to allow communication, but the two MCUs never connect.

To determine if the devices could be detected, I ran the bt_classic_device_discovery built-in example. When running it on the ESP32 that connects to COM5, the program runs successfully and I am able to detect my ESP32_SLAVE device. However, when running the program on the ESP32 connected to COM3, I get the following error:

#3error Serial Bluetooth not available or not enabled. It is only available for the ESP32 chip.

Both devices have Bluetooth enabled because when either one connects to COM5, I do not get the above error, but when they connect to COM3, I do.

I was wondering what steps I should take to debug.

Thanks.

0 Comments
2024/12/19
14:08 UTC

2

E ink Display not working

https://preview.redd.it/zyfnh8wmns7e1.png?width=1065&format=png&auto=webp&s=3f396a81991a0aebc60727bad652bffeb3bf826f

I have been using this circuit to drive an e ink display, the circuit is taken from https://www.waveshare.com/w/upload/8/80/E-Paper_ESP32_Driver_Board_Schematic.pdf
The voltages on PREVGH and PREVGL are not going up, idk if the boost circuit is not working or the circuit is wrong alltogether. Please help

2 Comments
2024/12/19
11:55 UTC

0

How can it be that my embedded Linux unexpectedly "undeleted" / un-overwrites files? (Corrupted flash / filesystem?)

Help me understand how my embedded Linux reverted some files (that should have been overwritten to a newer state) back to their original state after a few weeks.

Story time: I have a device that is based on a 32 bit ARM SOM with onboard flash. It is running embedded Linux and there are some text files (i.e. config settings with hundrets of values) stored on the home directory that are accessed by the application. These files are created and overwritten several times in the lab before the complete device is shipped out into the field. All of the intermediary files are archived at the lab (important later). The filesystem is normally write protected and functions exist to unlock / lock the file system. This mechanism is used at the lab but not accessible to the user.

This one particular device was verified to have the correct settings before shipping. Out in the field it performed as expected for ~2 weeks. Then it startet behaving in a weird way which ended in the device being shipped back to my desk. Now the first thing I checked was the state of the settings files. They were not the same settings as the device was shipped with. Moreover, the MD5 hash of the files matched the intermediary files from the archive (about 1 week older than the shipping state).

Something happened out in the field, because the device was initially working with the correct settings but then reverted to the old settings. It is impossible that someone out in the field changed these settings - firstly because the Linux is not accessible and secondly because all of the files' checksums matched to something in the archive at the lab. The files were reverted to a state before the overwrite. How can this be explained?

My attempt at explaining the behaviour would include a bug or corrupted flash that reverted the file system journal to an old state. Does anyone have experience with this or a different explanation?

A few more details: The device may be power cycled several times a day. There is a firmware update process that includes updating the Linux but the files in question are not updated because they are device specific. Such a firmware update in the field is likely.

Edit: The devices I am talking about have been in production for a few years. Something like this has never occurred (or been detected). There is documentaion with logs evidencing that this device had the newer settings both before shipping as well as in the field (not just hearsay from people). There are several ramdisk partitions, the affected files are not on there. The files survived several reboots across a few weeks, they were definitely stored nonvolatile - something must have corrupted the nonvolatile part of the file system.

13 Comments
2024/12/19
07:48 UTC

19

Arduino IDE to bare metal

I’ve tinkered with the ESP32 using the Arduino IDE, and it’s the only microcontroller I currently have. Now, I want to take my skills further and teach myself bare-metal programming with the ESP32 in C. Does anyone have a structured roadmap or recommendations to help me become proficient in bare-metal development? Also, if anyone is interested in learning together and transitioning from Arduino IDE to bare-metal programming, that would be great!

26 Comments
2024/12/19
07:18 UTC

0

Did anyone here worked on SIM800L GSM/GPRS module with websocket connection?

Basically my application is I want to send data to mongodb database using websocket with the help of SIM800L and Arduino Uno

Any suggestions will be appreciated.

5 Comments
2024/12/19
05:34 UTC

1

Sata to IDE molex 4 Pin male PCB header help

I’ve got a Sata power to IDE molex 4 pin header that I need to interface with on a custom backplane pcb. Except I can’t seem to find an appropriate wire to board header that fits my needs. Does anyone have any part numbers that can allow for this to be interfaces with similar to how ATX PSUs can be interfaced with motherboard peripherals?

2 Comments
2024/12/19
05:13 UTC

5

Jetson Nano Orion Super just came out, anything cool to make for learning purposes?

Earlier this year I worked on a class project using the 2GB Jetson Nano Dev Kit. I used a Yocto image from Tegra that in Clyde’s Docker, YOLO, Deepstream, and some Nvidia libraries. The biggest pain was getting things to work but with the new Devkit that came out, is there any cool projects someone here can recommend?

I’d like to dive more into the kernel and driver stuff. But the local LLMs also seem cool. My interest are pretty broad so open to hearing what others have to say.

1 Comment
2024/12/19
03:04 UTC

0

Most used board in electrical engineering

Which development board is the most reliable and popular among electrical engineers, especially in the automation field? I was told maybe the STM32 Nucleo but not sure

11 Comments
2024/12/19
02:58 UTC

1

OLED Breakout for Breadboard

Hi there,

I am trying to breadboard test a design involving an OLED WEO006432AWPP3N00000. However, I have not been able to find a through hole connector specifically for the said model OLED's FPC (Flexible Printed Circuit).

Here are the dimensions and pitch information from the datasheet:

https://preview.redd.it/1hp32le6so7e1.png?width=433&format=png&auto=webp&s=e99f8a0694c430ddc073054a19057f65a458965c

As I understand from the above diagram, the width of the cable is 12 mm at the terminal point and the pitch is 0.7 mm. I have been unsuccessful in locating a connector for these specifications.

Kindly advise a suitable connector or an alternative approach.

Cheers.

2 Comments
2024/12/18
22:52 UTC

Back To Top