Embedded - Reddit – Telegram
Embedded - Reddit
17 subscribers
1.23K photos
111 videos
1 file
20K links
News and discussion for the Embedded world

Subreddit: https://www.reddit.com/r/embedded
Powered by : @r_channels & @reddit2telegram
Download Telegram
ESP32 SD Card Module Not Mounting Card

I am trying to get a MicroSD card adapter to work with my ESP32 DevKit-V1, but I can't happen to get it working. I've gotten the same module to work with an Arduino Uno on 5V, but I cannot get it to work with my ESP32. Code is below, but here are my troubleshooting steps.

I'm using a cheap HW-125 SD card adapter with my ESP32 DevKit-V1 with the following pinout:

* CS - D5
* SCK - D18
* MOSI - D23
* MISO - D19
* VCC - 3.3V
* GND - GND

Troubleshooting steps I've tried

* I tried a second HW-125 to ensure I didn't burn the first one
* Re-formatted the 8GB SD card to FAT32 using official SD formatter tool
* Tried connecting VCC to a 5V source instead of the 3.3V (with a common ground)
* Tried changing the GPIO pins
* Tried changing the card speed in the code from 4MHz to 7.5 MHz to 0.4 MHz
* Ensure my card appears when plugged into a computer

Only other think I can think of is running all wires through a level shifter to 5V. I'm completely lost and appreciate any help.

In addition to this code, I've also tried the example code in the Arduino IDE library.

#include "FS.h"
#include "SD.h"
#include "SPI.h"


#define SD_CS 5 // This is the correct CS pin for VSPI on DevKit-V1


// Create an SPI class instance on the VSPI bus (default for your board)
SPIClass spi = SPIClass(VSPI);


void setup() {
  Serial.begin(115200);
  delay(2000);
  Serial.println("=== Testing with Default VSPI Pins ===");


  // Initialize SPI bus. Use -1 for the hardware SS pin.
  // SCK=18, MISO=19, MOSI=23, SS=-1 (not used)
  spi.begin(18, 19, 23, -1);


  // Initialize SD card with the defined CS pin
  if(!SD.begin(SD_CS, spi, 7500000)) {
    Serial.println("Card Mount Failed");
    return;
  }
  Serial.println("SUCCESS: Card initialized.");
 
  // Optional: List root directory to confirm communication
  listDir(SD, "/", 0);
}


void loop() {
  // Nothing here
}


// Helper function to list directory contents (optional)
void listDir(fs::FS &fs, const char * dirname, uint8_t levels){
    Serial.printf("Listing directory: %s\n", dirname);
    File root = fs.open(dirname);
    if(!root){
        Serial.println("Failed to open directory");
        return;
    }
    if(!root.isDirectory()){
        Serial.println("Not a directory");
        return;
    }
    File file = root.openNextFile();
    while(file){
        if(file.isDirectory()){
            Serial.print("  DIR : ");
            Serial.println(file.name());
            if(levels){
                listDir(fs, file.name(), levels -1);
            }
        } else {
            Serial.print("  FILE: ");
            Serial.print(file.name());
            Serial.print("  SIZE: ");
            Serial.println(file.size());
        }
        file = root.openNextFile();
    }
}

https://redd.it/1pz6nc0
@r_embedded
Emulating EEPROM on STM32 when using Simulink hardware support

https://preview.redd.it/fny5c8sj29ag1.png?width=2878&format=png&auto=webp&s=37544cfc8318ba2948fa3d36f8d9cd6e9e96b538

To make vehicle control unit (VCU) development more accessible to people who are not embedded programmers, we decided to use Simulink STM32 hardware support.

One limitation of Simulink is that you don’t have much control over low-level memory operations. Because of that, I had to write custom C functions and import them as Simulink blocks to emulate EEPROM using the last sector of the STM32 flash memory.

This implementation is used to latch error flags and store them persistently:

* Each error is written to the next available bit
* The flash sector is only erased when it becomes full, minimizing erase cycles
* Errors remain stored across power cycles until the memory is cleared

If anyone is facing a similar issue with Simulink + STM32 and needs non-volatile storage, I’ve put a working example on my [GitHub](https://github.com/Sdeslo/EEPROM-emulation-for-STM32).

Feedback and improvements are welcome!

https://redd.it/1pz5px4
@r_embedded
Chording keyboard project like MicroWriter of 80s

I am researching on MCUs alot in order to make meself a chording keyboard. I want to work using C and make a copy of microwriter MW4 and make it able to edit on the windows.
I need help on getting started for this project. From firmware to Hw and driver for this... I really need help and i am unable to find on the internet so please mention sources if possible too

https://redd.it/1pz8la3
@r_embedded
Issue reading data using CAN communication

I am student ,building E go karts in university along with my team , we need to keep a display to see operating voltage ,temperature of mosfet and motor ,soc ,speed of the vehicle in display ,which will be mounted below steering for driver. so the issue here is neither of them worked in CAN communication , so we are a bit clueless where to start.
my motor controller has an dedicated 4 pin can jsd port (5v,gnd,can_high,can_lo) and also has usb port as well and my battery also has can wires coming out of the casing(just 2 wires not marked).

As far as i searched online first ,am i supposed to read dbc file from controller and battery seperately in my laptop ? , then write code acc to display them in a display . Now to read data in laptop which software i should use Pcan or canalyser or vesc ?( my controller vendor suggested pcan, but i hv no idea of that and i use to vesc to tune my motor),now what hardware i might require to read from my controller and battery , like can to usb modules?, or can transeiver or something else . Even with wiring part i just now that can bus should be truncated with 120 ohm, is there anything i should know?
so can u guys share your thoughts, ideas and knowledge on this

https://redd.it/1pza99r
@r_embedded
STM32F042 USB-C Module — Schematic Review Before PCB Layout (2-Layer)
https://redd.it/1pzeyvx
@r_embedded
STM32U5 OctoSPI Quad Mode (IO4–IO7) + W25Q128 works, but XIP memory-mapped mode doesn’t

I’m using STM32U5 OctoSPI with Winbond W25Q128 QSPI NOR.

Setup:
OctoSPI in Quad mode
IO0–IO3 remapped to IO4–IO7
Indirect mode works fine:
JEDEC ID read OK
Read / write / erase OK

Problem:
Memory-mapped mode (XIP) doesn’t work
Invalid data / faults when trying to execute or read via mapped address

Looking for:
How to properly configure memory-mapped mode on STM32U5?

Any tutorials, app notes, or example projects
Any known gotchas when using Quad mode on IO4–IO7 for XIP.

Is XIP officially supported in this configuration, and are there any special settings (dummy cycles, opcode, cache/MPU config, etc.) I should be aware of?

Thanks!

https://redd.it/1pzj852
@r_embedded
where/how do you get small quantities of chips for new projects without shipping being the majority cost?

just that, any little project I look at doing now, I start to go , why bother, when amazon has the entire thing built for much cheaper. and the chips for a custom board, well then that's a different more expensive path.

I miss the cheap digikey days, with samples..or even free shipping aliexpress. I'm not one to plan for bulk orders

https://redd.it/1pzn375
@r_embedded
Very Confused about this module

Guys I recently i bought this ADC the datasheet of the AD7606 of Analog and the ADC module is different which makes me very confused , I surfed throught i only find the parallel connection only. If some used this module help me through it ,if you find this module schematic or any tutorial or you already used help out guys.

https://redd.it/1pzod7m
@r_embedded
Designed and assembled a camera controller board based on ESP32-P4 with PoE support (50x60mm). Also, optional edge TPU support. How does it look?



Note: I have to correct those solder blobs in the ESP32-P4 chip.

Note: Will correct those solder blobs in the ESP32-P4 chip.

https://redd.it/1pzw666
@r_embedded
Looking for a tool to measure overall consumption, inrush & peak currents and multiple analog voltages

Hey everyone,

I’m working on embedded/smart products with lots of on/off loads, soft starting, and switching rails, and I’m looking for a measurement tool that can help me with a few key things:

Measure overall power consumption (voltage + current)
High enough sample rate to capture inrush and peak currents accurately
Multiple (3+) analog inputs so I can monitor several voltage rails ramping up at the same time
Synchronous data (so voltage and current are aligned on the same timeline)

I’ve come across the Joulescope JS220, which is great, excellent current accuracy and sampling rate, but it only has one analog voltage input, which isn’t enough for my use case.

Do you have any other measurement tools you would recommend that are similar to Joulescope JS220 but with more analog input?


Thanks!

https://redd.it/1pzvkgi
@r_embedded
Foreign Computer engineer

Hi everyone,

I am moving soon to the US and I will be a green card holder so I won’t be needing a work visa. I have a degree in computer engineering from the Middle East and was wondering how hard it is to find a job at the US, if possible at all?

what process do foreign engineers follow in order to get a job?

https://redd.it/1pzy0yx
@r_embedded
SoM for wearable applications
https://redd.it/1q00oof
@r_embedded
Embedded Languages

What are all the programming languages that we can use to program a Embedded systems other than C/C++ ? I know Cpp and PY, did you use any other languages than C/C++ ?

https://redd.it/1q03hj9
@r_embedded
RPi 4 (4GB) edge face recognition (RTSP Hikvision, C++ + NCNN RetinaFace+ArcFace) @720p, sustainable for 24/7 retail deployments?

Hi everyone. I’m architecting a distributed security grid for a client with 30+ retail locations. Current edge stack is Raspberry Pi 4 (4GB) processing RTSP streams from Hikvision cameras using C++ and NCNN (RetinaFace + ArcFace).

We run fully on-edge (no cloud inference) for privacy/bandwidth reasons. I’ve already optimized the pipeline with:

Frame skipping
Motion gate (background subtraction) to reduce inference load

However, at 720p, we’re pushing CPU to its limits while trying to keep end-to-end latency < 500ms.

# Question for senior engineers

In your experience, is the RPi 4 hardware ceiling simply too low for a robust commercial 24/7 deployment with distinct face recognition?

Should we migrate to Jetson Nano/Orin for the GPU advantage?
Or is a highly optimized CPU-only NCNN pipeline on RPi 4 actually sustainable long-term (thermal stability, throttling, memory pressure, reliability over months, etc.)?

Important constraint / budget reality: moving to Jetson Nano/Orin significantly increases BOM cost, and that may make the project non-viable. So if there’s a path to make Pi 4 work reliably, we want to push that route as far as it can reasonably go.

Looking for real-world feedback on long-term stability and practical hardware limits.

https://redd.it/1q050vd
@r_embedded
How to implement my own custom sizeof operator in C ?

Earlier I was interviewing for Embedded Software Engineer position and he asked me this question and I still can't figure out how to do it since sizeof is a macro and not some C function and compiler calculates it at compile time.


https://redd.it/1q08hvj
@r_embedded
How do I use AI to ramp-up to a new SDK without engaging in a ton of bad practices?

I'm still a student and I recently got my hands on an nRF52 and am trying to learn the nRF connect SDK. I bought it to miniaturize a project I'd made before, and I've never used the SDK for this chip so I often use Gemini to explain things like say, creating a BLE service, or understanding how to dynamically register a service for this SDK. I'm also working in C which I haven't done in a minute.


I have no idea if what it recommends is considered 'good practice', and I don't know how to check. I seriously doubt anyone cares cause no employer is gonna read my github + this is just about the least impressive thing on my resu me but I don't want to teach myself rubbish yk?

https://redd.it/1q08vyk
@r_embedded
How do I learn nRF Connect SDK and Zephyr?

I've started a project working on a custom board with the nRF52820 chip. I'm developing using nRF Connect SDK because I'll need bluetooth as well, and it supposedly has good sipport. It's somewhat a pain, but I'm working through it.

I'm looking for some help with learning more about Zephyr and nRF Connect. I'm currently going through the devacademy Nordic provides, but if anyone has any additional resources, it would be much appreciated.

Thank you!

https://redd.it/1q09pb4
@r_embedded
How to install linux on an Allwinner A31 tablet?

How to install linux on an Allwinner A31 tablet?

https://redd.it/1q0blf1
@r_embedded
I have ~3 YOE and my major skills are Shell noscripting, linux, yocto framework and C. I want to switch companies using above skills and if need learn additional skills and make good use of it. Please guide me how to start preparing for job switching and searching.

Hello everyone,

I have almost 3 years of experience in a product based company. I work in a security operations team, majorly on yocto framework, shell noscripting, linux and C.

Now that I'm accumulating 3 years of experience, I would like to find better opportunities and switch from current workplace.

Please guide me how to prepare for interviews, if I need to learn any new skills or certifications. I'm learning data structures and algorithms, system design. Will that help me in looking for any job opportunities?

Please guide me.

Thank you and wishing everyone a happy new year.

https://redd.it/1q0cp6w
@r_embedded
Simple & cheap Eval-Board (with AI Accelerator Hardware) to learn Embedded Linux (Yocto)

I am looking for a simple and cheap evaluation board to learn Embedded Linux (Yocto) where the CPU has accelerator hardware for neural networks. It would be beneficial if the board also has a few sensors which I can use to feed a dummy neural network. The goal is more or less to show this on my GitHub and improve my market value as an embedded software developer.

https://redd.it/1q0ci9s
@r_embedded
Global synchronization time implementation

Hello everyone,


I'm working on a project, and was able to find an algorithm somewhere online where it synchronizes multiple devices over UDP. After implementing this algorithm on C using a linux microcontroller, and obtained the desired global clock(stored as a variable), I didn't know how to proceed with this. Is there like a command where I can replace the microcontrollers clock with this clock or is there something safer where I can have a virtual clock or something like that?

I'm new to this and would appreciate your help.



Thanks a lot :)



https://redd.it/1q0f0n6
@r_embedded