DevHeads IoT Integration Server

DII

DevHeads IoT Integration Server

The DevHeads IoT Integration Server accelerates technology engineering by helping pro devs learn, share and collaborate.

Join

seeking-collabs

firmware-and-baremetal

middleware-and-os

edge-networking

pcb-and-analog

jobs

iot-cloud

code-review

devheads-feed

general-dev-chat

ESP32 Camera Module Initialization Failure in Image Recognition System for Tissue Samples

Hey guys , am working on an image recognition system that can analyze images of tissue samples, identify malignancies, and predict possible symptoms and causes. The system will utilize a camera sensor for image capture, an ESP32 for processing, and a machine learning model for image analysis. My aim is to set up the ESP32 with the camera module to capture images, How can i interface the camera module with the microcontroller to capture clear images? Am getting the error Camera initialization failed Here's my code...

Arduino IDE Not Detecting Ports for STM32 Blue Pill on macOS with ST-Link V2

I am using the Arduino IDE to program an STM32 Blue Pill via an ST-Link V2. After following several manuals, I successfully uploaded the blink example to pin C13.Although I can compile and upload code without any issues, the Arduino IDE doesn’t recognize any ports, preventing me from using the Serial Monitor. The following message is displayed: "Not connected. Select a board and port automatically." Despite trying different configurations (e.g., checking board types, and drivers), the software still fails to detect the connection, even though the macOS system report recognizes the ST-Link V2. Has anyone encountered this issue, and is there an alternative way to view the serial output from the STM32? Any tips on troubleshooting this would be greatly appreciated....

Unexpected Memory Value Fluctuations in GDB While Debugging Pointer in x86-64 C Program

In my last question, I misunderstood how GDB interprets memory when using different formats like x/d and x/1wd. After some digging, I realized the issue was related to GDB displaying the same memory contents as both signed and unsigned integers. That cleared up the confusion about the "flipping" values. Funny how I am facing a different issue with pointer manipulation and register inspection. I’m debugging a simple C program where $rbx is pointing to dynamically allocated memory. Here's the setup in my main.c file When I inspect $rbx in GDB, I expect it to point to the buffer and show the correct values as 28 and -5604 for ptr[0] and ptr[1]. When I execute these commands, I get some strange behavior which I logged in bash.txt . Been making use of x86-64, GDB version 10.1...
attachment 0

Securing Firmware Updates on Arduino

Hi all! When designing an Arduino-based embedded system, how can secure firmware updates be ensured to prevent unauthorized modifications or potential exploits? Discuss methods for securely updating firmware on Arduino devices, considering the limited resources available....

what are different ways to maximize the range of esp32 c3 chip on a custom board ?

what are different ways to maximize the range of esp32 c3 chip on a custom board ?

How to prevent ADC interrupt from affecting LCD display on AVR MCU?

I am working with an AVR MCU and have encountered an issue with an interrupt routine affecting my LCD display. Specifically, I have an analog potentiometer connected to an analog pin, and the interrupt associated with the ADC conversion seems to be interfering with the LCD_display method. I need to ensure that interrupts are paused while executing the LCD update code to avoid conflicts. I used cli() to disable interrupts before updating the LCD and sei() to re-enable interrupts after the update is complete. This prevents the ADC interrupt from interfering with the LCD display operations. Is there a better way to manage interrupt handling without affecting the LCD display? my code snippet is in the attached file....
Solution:
Hey man, If you want to effectively handle interrupts without impacting your LCD display, You could try a few things like ; Using atomic blocks for critical sections management & making sure that the updates of your LCD screen happen in the main loop only by flagging them with an ADC interrupt. I hope this helps @Dtynin...
attachment 0

How do NVIC and DMA interact in STM32 Blue Pill?

I’m working with the STM32 Blue Pill and have a question about the relationship between the NVIC (Nested Vectored Interrupt Controller) and DMA (Direct Memory Access). I understand that the NVIC handles interrupts, while the DMA manages direct memory transfers without CPU intervention. However, I’m curious to learn more about how these two components interact. For example, when I set up a DMA transfer in my project, I assume the NVIC might be responsible for handling DMA interrupts. Is there a specific way NVIC and DMA work together in such a scenario, or are they completely independent? Could you clarify how they interact or whether NVIC has any role in managing DMA-related events?...
Solution:
@Sterling Well, the DMA actually kinda handles the data transfers, the NVIC manages the interrupts generated by the DMA. So they more or less work literally in tandem to ensure smooth, efficient data handling without burdening the CPU.

Why does enabling SPI peripheral in STM32 Nucleo L476RG change the master bit to 0?

Guys I'm trying to implement the SPI in my stm32 Nucleo l476RG without hal drivers. I have have implemented the spi configuration using spi_init function then when it ready for the communication i enable the SPE: SPI enable using a seprate function which is...

Why is my BMP280 sensor value calculation incorrect on AtMega32?

I’m working with the BMP280 sensor on an AtMega32 microcontroller, aiming to convert sensor data from raw readings to a human-readable format. Specifically, I need to read calibration values from the sensor’s registers and combine them to get meaningful numbers. I’m able to read most of the calibration values correctly, but one particular value is being miscalculated. The process involves reading the LSB (Least Significant Byte) and MSB (Most Significant Byte) from the sensor, then combining these bytes into a single value. Below is my implementation: ``` uint8_t cmd[2] = {0xD0, 0}; uint8_t msb1 = 0;...

Does anyone know how to add DFU in an stm32 bootloader?

does anyone know how to add DFU in an stm32 bootloader?

Issues with STM32L476RG Nucleo Board Not Detected in CubeIDE on Ubuntu

Some time ago, I developed basic firmware for STM32 using CubeIDE on Windows. However, I have since switched to Ubuntu and recently downloaded version 21.04 of the operating system. Upon purchasing a new STM32L476RG Nucleo board, I proceeded to install CubeIDE version 1.6.1 onto my Ubuntu operating system platform. Following the creation of an uncomplicated LED blink program using said software application, I attempted to debug its execution by pressing F11 but was met with an error message: "No ST-Link found." This occurs because at that point in time there was no physical connection between the aforementioned STM32 Nucleo board and my USB port present. Subsequently after remedying this issue through their union and initiating debugging once more; while each preceding programming step completed successfully during compilation as well build phases respectively - finalization instead failed due in part to resultant errors received containing verbiage identical or similar-to=the following: ...
Solution:
Hey @Sterling check the USB Permissions first , you need to ensure that your user has permission to access USB devices, so add your user to the dialout group Run this command in the terminal ``` sudo usermod -aG dialout $USER...
attachment 0

Resolving I2C Timeout Error When Updating STM32G4 Firmware with ESP32

Hi guys i'm trying to use an ESP32 to update the firmware on an STM32G4 over I2C, but I'm getting an I2C timeout error when trying to initiate the update. I've connected the SDA and SCL pins, and I'm controlling the BOOT0 and RESET pins on the STM32G4. My ESP32 is running a custom Arduino sketch for I2C communication, and the STM32G4 has a minimal bootloader expecting I2C programming mode. ESP32 I2C Connection Code : ``` Wire.begin();...

How to Interface an LDR with ESP32 and BeagleBone Black for Light Monitoring System?

Hello, I’m working on a light intensity monitoring system using BeagleBone Black and a Esp32. I’m interfacing an LDR (Light Dependent Resistor) through the Esp32 with a 4-digit 7-segment display to show light levels. Could you guys guide me through the setup, For instance how do I connect the LDR properly to the Esp32 and interface it with BeagleBone Black? This is my code below, the issue is am getting no reading from my Esp32 ```c int sensorValue = 0;...

Compile-Time Check for Node Limit in Custom Communication Function for PIC16F84A

Hey everyone, I’m working in Microchip Studio to create a custom communication function for a few PIC16F84A microcontrollers. I know there are built-in options like SPI, but I’m going the DIY route to learn more about the nitty-gritty of how this all works. Here’s what I’ve come up with so far:
void sendMessage(uint8_t node, uint8_t data);
void sendMessage(uint8_t node, uint8_t data);
Now, my setup only supports up to 4 nodes, so I want to make sure the node parameter doesn’t go above 4. Right now, I just have a simple runtime check:...

Issues with Configuring ITM Output in Atollic TrueSTUDIO for STM32L4

Currently, I am utilizing the Atollic Truestudio IDE (which is based on Eclipse) to create firmware for different STM32L4 Nucleo boards. To date, my approach has involved employing printf through a Virtual COM port linked with UART. I now intend to transition towards utilizing printf alongside STM32 ITM. My focus is on the Nucleo-L4A6ZG board, which utilizes a gdb server for debugging purposes....
attachment 0

Tensor Allocation Issue in TinyML Deployment on Arduino Nano 33 BLE Sense

I'm working on a TinyML project using an Arduino Nano 33 BLE Sense microcontroller with a built-in 9-axis inertial measurement unit (IMU) sensor (LSM9DS1). My goal is to deploy a gesture recognition model using TensorFlow Lite for Microcontrollers. I have followed the steps to collect data, train the model|, and deploy` it onto the microcontroller, but I am encountering an error during inference. here's my code ```cpp #include <Arduino.h> #include <TensorFlowLite.h>...
Solution:
And you would notice that static_interpreter is being used, but it's not properly initialized. use the tflite::MicroInterpreter the right way. Correct the initialization of the interpreter. Instead of static_interpreter, use something more like ``` static tflite::MicroInterpreter static_interpreter(model, resolver, tensor_arena, kTensorArenaSize);...

RTC Date and Time Display Issues on Tera Term with Format and Pointer Errors

Good day everyone, my aim is to showcase the RTC date and time on Tera Term; however, I am facing errors that are explained in the code below. Furthermore, no information is appearing on Tera Term. My approach involves using pointers according to SetDate and GetDate declarations. Nonetheless, there have been warnings such as: 1. format '%d' expects a matching 'int' argument [-Wformat=] 2. passing argument 2 of 'HAL_RTC_GetDate' from incompatible pointer type [-Wincompatible-pointer-types] 3. passing argument 2 of 'HAL_RTC_SetDate' from incompatible pointer type [-Wincompatible-pointer-types]...

Troubleshooting SPI Communication Between STM32G431RB Master and F446RE Slave Boards

I am trying to establish communication between two Nucleo boards (STM32G431RB as master and Nucleo F446RE as slave). I used the example codes from the STM32 GitHub page (NUCLEO-G431RB/Examples/SPI/SPI_FullDuplex_ComPolling_Master and STM32F411RE-Nucleo/Examples_MIX/SPI/SPI_FullDuplex_ComPolling). I made some changes to the slave code, including GPIO settings, but the communication still doesn't work. I chose NSS as [ hspi1.Init.NSS = SPI_NSS_SOFT; ]. The codes also include LED configurations as mentioned in the README files, which indicate an error based on the LED status.I know I have an error acording to led 2 but I don't know the problem. LED2 toggles slowly when there is a timeout or an error in transmission/reception process....
attachment 0

How to Safely Modify .byte Values in x86_64 Assembly Without Segmentation Faults

I need to modify specific .byte values using the inc instruction in a small x86 64 asm project . I want to increment the values of .byte 0x0d and .byte 0x04 in my code to change them to .byte 0x0f and .byte 0x05, respectively. I expect to increment the .byte values by using inc byte ptr [rip+offset] to modify the bytes at the correct memory offsets. So when I run the code, I encounter a SIGSEGV, a segmentation fault at the inc instructions, even though I verified the offsets using objdump and confirmed that they are correct I also tried using: ``` lea r11, [_start]...
Solution:
You're getting a SIGSEGV because .byte values are in the code section, which is read-only. You cannot modify them directly with inc. store them in a writable data section like .data or .bss, then modify them using the correct addressing mode.
attachment 0

How to Manually Program an Interrupt Service Routine (ISR) for STM32F4 MCU Without Using Libraries?

Good day everyone, I have gone through the Datasheet and User Manual for my STM32F4 Microcontroller Unit (MCU) in great detail, including PM0214 for STM32F4xx MCUs. Additionally, I have searched various online resources that provide information on programming interrupts without using a library but didn't find much guidance. My question is if NVIC's integration with hardware essentials makes it difficult to program an interrupt manually by specifying ISR address and function without relying on any libraries? Everywhere I look there are functions like: Enable IRQn using NVIC. ...