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

How can I use the machine learning library MicroML to perform simple inference on an ESP32?

Hello guys, how can I use the machine learning library MicroML to perform simple inference on an ESP32? My goal is to predict a simple numerical outcome based on a set of sensor readings, I was able to generate the c code prediction but unsure on what step to take next can anyone help me ```python from sklearn.linear_model import LinearRegression import numpy as np...
Solution:
Hello @Enthernet Code , after Creating a c code of the model and include it into your ESP32 project as model.h. In your Arduino sketch, read from sensors, then call the function for prediction from the generated code, This project tutorial will guide you https://dev.to/tkeyo/tinyml-machine-learning-on-esp32-with-micropython-38a6...

Resolving Guru Meditation Error in ESP32-Wroom TasksQueue

I'm developing an ESP32-Wroom project in Arduino C++. My TasksQueue class queues and runs tasks on a specific core, but the code sometimes stops working after a reset and displays the following error message in the Serial Monitor:
Guru Meditation Error: Core 1 panic'ed (Cache enabled but cached memory region accessed)
Guru Meditation Error: Core 1 panic'ed (Cache enabled but cached memory region accessed)
...
Solution:
@Sterling this is often related to issues with memory allocation, access, or synchronization when working with dual-core processors like the ESP32. To solve this, ensure that a task is pinned to a core and the memory access are handled properly

Does a hypervisor manage VMs for safety, Linux for infotainment, for isolation and security?

Modern automotive systems use an RTOS at the base. Does a hypervisor manage VMs, e.g., AUTOSAR for safety, Linux for infotainment, for isolation and security? How do containers differ from VMs in this context? Are containers ever preferable within VMs? @Middleware & OS...
Solution:
Actually, hypervisor does manage the VMs @Dtynin

Can I use an idle hook function in FreeRTOS to perform low-priority tasks?

@Middleware & OS Hello, can I use an idle hook function in FreeRTOS to perform low-priority tasks? My idle hook isn't being executed. Here's my configuration: ```c void vApplicationIdleHook(void) { // Perform low-priority task...
Solution:
@Boss lady If your idle hook isn't being executed, check that the idle hook is enabled in your FreeRTOSConfig.h file by setting configUSE_IDLE_HOOK to 1.
#define configUSE_IDLE_HOOK 1
#define configUSE_IDLE_HOOK 1
, check that your idle hook function is correctly implemented and matches the expected function signature....

Has anyone here had experience interfacing the ZCU216 with a PCIe host using these FMC connectors?

@Middleware & OS I'm trying to interface a Xilinx ZCU216 board with an x86 host via PCIe. I've successfully done this before with a ZCU106 board using its dedicated PCIe slot. The ZCU216 documentation mentions the GTY transceivers needed for PCIe Gen 3x4 and also has FPGA Mezzanine Connectors FMC. However, it lacks a dedicated PCIe slot. Are there any specific FMC modules or PCIe expansion cards that could connect the ZCU216 to the host motherboard using an external cable? Has anyone here had experience interfacing the ZCU216 with a PCIe host using these FMC connectors? ...
Solution:
There is a few options...i recommend VadaTech FMC250

Looking to build a simple preemptive RTOS for fun!

Hey guys, I'm Looking to build a simple preemptive RTOS for fun! Any resources to get started on the core concepts of task switching between two threads, besides "Simple Real-Time Operating Systems"? @Middleware & OS...
Solution:
@Dtynin Try to implement a preemptive scheduler that can interrupt lower-priority tasks to run higher-priority tasks. This scheduler Will ensure that the critical tasks are executed in a timely manner. Then, apply a kernel that manages the tasks and their execution. Check these points out,I believe it will be helpful to your project....

How can I manage communication between tasks using queues in FreeRTOS?

How can I manage communication between tasks using queues in FreeRTOS? My queue data seems to be getting lost, and I'm encountering the error: "Queue send failed". Here's my queue creation and send code: ``` xQueue = xQueueCreate(10, sizeof(int)); int value = 42; xQueueSend(xQueue, &value, portMAX_DELAY);...
Solution:
@ZacckOsiemo It's been resolved and my code works better now after adding the function that confirms if the queue was actually created, regarding d syntax error seems I didn't add a ; were it was required, this little error caused me almost a day of headache, thanks for the help guys, @everyone This is my code now 👇...

How to Handle Time-Critical Sensor Data Interrupts Efficiently in FreeRTOS on STM32F4?

I'm using FreeRTOS on an STM32F4 microcontroller to handle temperature sensor data. The sensor triggers an interrupt, and I need to process the data as quickly as possible within 10 microseconds. I thought creating a new task within the ISR using xTaskCreate would be efficient for memory management cus during testing, I encountered an error during runtime that halted my system. While the exact error message didn't clearly state "attempted to create a task from ISR," it indicated a function call failure. What's the recommended approach for handling time-critical sensor data interrupts in FreeRTOS while maintaining efficient memory management? @Middleware & OS @Helper...
Solution:
Hmmm, I wouldn't be able to help you with your specific issue, as that would amount to doing it. Here is the thing, you don't want to do anything lengthy, or expensive in an ISR. Basically you want to do stuff, like RX data, Indicate RX, Ack RX. This is for ISRs in general RTOS or not. Ok thats the first part. The next thing is since you have this awareness, whenever you have some task arriving by ISR or Event you should be ready to handle it. So in your case you know some sensor data is going to come in by ISR, and you should be ready to handle it. Outside of the ISR remember. ...

I would like to create variables to call stepper motor sequences in my program

Hello community 🙂, I have a small question. I would like to create variables to call stepper motor sequences in my program. For now, I have written some sequences for 3 motors that are triggered by touch buttons on my HMI. But I realize that this will be very, very long. 😔 So I want to create sequences and save them under a name. I imagine that's what you call a variable??? So that I only have to call the names I gave to the sequences afterward. I am using the AccelStepper library. What type of variable should I use? Const int? Const char? Const float?...
Solution:
Use an integer array (int[]) or a struct with integer members to store stepper motor sequences. For sequence names, use an enumeration (enum) or a string array (char[] or String[]). This will allow you to easily access and call the sequences by their index or name.

How to Manage Priority and Determine Node Count for CAN Bus Using Arduino Uno and MCP2515?

hello guys need Help, i have a project of realizing CAN bus, to achieve it i use two Arduinos uno and two CAN modules, every arduino is attached to MCP2515 , i did the communication like pressing a push-up button in the transmitter side to control a led in the receiver side. i need help on managing the priority (like ABS has priority than any action like windshield wiper) how much Nodes(MCP2515) do I need? and how can I manage the priority of actions? @Middleware & OS...

How do I optimize memory usage for a neural network running on an ARM Cortex-M4 using CMSIS-NN?

@Middleware & OS How do I optimize memory usage for a neural network running on an ARM Cortex-M4 using CMSIS-NN? My current model runs out of memory. Here's my code: ```cpp #include "arm_nnfunctions.h" ...
Solution:
Did you consider reuse buffers for intermediate and output data

How can I debug this communication issue to ensure ControlTask always reads the latest data?

@Middleware & OS I'm working on a robotic arm controlled by FreeRTOS with two tasks; SensorTask which continuously reads joint angles and stores them in a shared variable (a global array), and ControlTask which retrieves sensor data and calculates motor commands every 10ms. ControlTask sometimes reads outdated data, causing jittery movements. I've verified SensorTask updates the variable correctly. Error Message:
Error: ControlTask - Inconsistency detected between expected and actual sensor value
Error: ControlTask - Inconsistency detected between expected and actual sensor value
How can I debug this communication issue to ensure ControlTask always reads the latest data?...
Solution:
If you must use a global variable try a semaphore to protect the shared variable during access. The sensor task acquires the semaphore before updating the variable , and the control task acquires it before reading the variable all these are so you can make only one task access the variable at a time. @Marvee Amasi

Is it safe to cast the osThreadId pointer to a 32-bit integer for a unique thread ID across platform

Hey friends, Porting a product to a CMSIS RTOS. We need a 32-bit integer representing the thread ID. While
osThreadId
osThreadId
is opaque, comments suggest it's a pointer. Is it safe to cast the
osThreadId
osThreadId
pointer to a 32-bit integer for a unique thread ID across platforms? Why or why not? @Middleware & OS...
Solution:
Hi @Dtynin , Casting a osThreadId pointer to a 32-bit integer is generally not safe and should be avoided, instead you can try maintain a mapping or using a 64-bit Integer. this is how your code should look like for maintaining a map 👇 ```c...

How do I set and manage interrupt priorities in FreeRTOS?

@Middleware & OS How do I set and manage interrupt priorities in FreeRTOS? My higher priority interrupts are not preempting lower priority ones. Here's my NVIC configuration: ``` HAL_NVIC_SetPriority(EXTI0_IRQn, 5, 0); HAL_NVIC_EnableIRQ(EXTI0_IRQn);...
Solution:
Hi @Boss lady , you can try this ```cpp #include "FreeRTOSConfig.h" #include "stm32f4xx_hal.h" ...

If I write a Python program with a GUI, can I launch it from the Linux CLI and still get the GUI?

I'm expecting the answer to be no, but I want to confirm. If I write a Python program with a GUI, can I launch it from the Linux CLI and still get the GUI? I'm exploring whether I can build an embedded Linux system while excluding all unnecessary components. This device will function like a kiosk, so all I need is my Python GUI. @Middleware & OS
Solution:
It depends.... You need a display in order to show the GUI. With the right configuration, you could launch a graphical app from the command line....

What are the benefits of using 64 priority levels in ThreadX with CMSIS-RTOS?

Good day everyone, I am trying to use ThreadX with CMSIS RTOS in a project. The cmsis_os2.c file specifies a maximum priority level of 64, but I want to optimize RAM usage by limiting it to 32. What are the benefits of using 64 priority levels in ThreadX with CMSIS-RTOS? Moreover, would there be an issue implementing only 32 priorities instead? Here's the code guys:
c #define osRtxConfig_MaxPriority (configMAX_PRIORITIES) ///< define maxmium number of supported Priority levels #if ((osRtxConfig_MaxPriority < 1) || (osRtxConfig_MaxPriority > smax(ev3_te8))) #error "RTX Error: Invalid 'osRtxConfig_Max.Priority' configuration!" #endif
c #define osRtxConfig_MaxPriority (configMAX_PRIORITIES) ///< define maxmium number of supported Priority levels #if ((osRtxConfig_MaxPriority < 1) || (osRtxConfig_MaxPriority > smax(ev3_te8))) #error "RTX Error: Invalid 'osRtxConfig_Max.Priority' configuration!" #endif
@Middleware & OS...
Solution:
Hey man @Sterling if you can reduce the number of priority levels from 64 to 32 in ThreadX with CMSIS-RTOS to save ur RAM usage

Has anyone here encountered UML being used in your firmware development experience?

@Middleware & OS I have found this UML diagrams, sequence diagrams and class diagrams in particular, to be valuable tools for designing, understanding, and debugging firmware. They help me surface design bugs that might otherwise be missed. While I wouldn't use UML for detailed specifications, I find it useful for modeling interesting parts of the software architecture. I haven't seen many other firmware developers use UML in their workflow. Greetings Devs, Has anyone here encountered UML being used in your firmware development experience? ...
Solution:
By "street uml", I mean untidy uml which doesn't follow the rules but gets the job done and has extra freedom to cater to specific situations. Like, I have my own symbols for different channel topologies (broadcast, mpsc, mpmc, etc.)

how to fix gdb server error in stm32 cube ide

how to fix gdb server error in stm32 cube ide

Why Isn't the Touch Screen Working on My Qt Application Deployed to BeagleBone Black?

@Middleware & OS Hello guys I configured a Qt development environment to develop applications for ARM based Embedded Linux platform, I am using a Ubuntu 12.04 (64bit) host system and beaglebone black ARM hardware platform. I have created a simple hello world program with a button which I have deployed to the Embedded Linux device (BBB) but the touch screen is not working. Below is the code. ```cpp #include <QApplication> #include <QPushButton>...
Solution:
@Boss lady The touch screen not working on your BeagleBone Black (BBB) could be due to several reasons. you can try troubleshooting by making sure the touchscreen drivers are properly installed on the BBB. You can check this by running:
dmesg | grep touch

dmesg | grep touch

...

Comparing ISR Handling in FreeRTOS, ChibiOS, and CooCox CoOS for ARM Cortex-M Projects?

Hey guys, I'm evaluating open-source RTOS options for an ARM Cortex-M project. While FreeRTOS, ChibiOS, and CooCox CoOS seem to offer similar features, I'm curious about real-world experiences. Specifically, how do these RTOS handle ISR interactions e.g., ChibiOS's
chSysLockFromIsr
chSysLockFromIsr
vs. CooCox CoOS's preemptable service request queue? Any insights on these or other open-source RTOS options for ARM Cortex-M would be greatly appreciated!...
Solution:
Here's a brief summary: - FreeRTOS: Uses software timers and a widely-used API, with a large community. - ChibiOS: Offers a lightweight, flexible approach with hybrid scheduling. - CooCox CoOS: Provides a simple API and low power consumption....