/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
I saw that FastBit courses on Udemy are well recommended, so I was wondering which of there 11 courses are recommended. Is each course a somewhat different topic, or would all of them be encompassed in a good embedded book?
As the title says. Got started a few weeks ago on an STM32 project (wanting to make a morse code emitter from the terminal), but honestly the lack of updated resources/load of topics at once has made this so frustrating. Especially when you're pointed to datasheets that are dense/difficult to read, and it feels like there's never any tangible feedback loop. I'm on the end of giving up and just going to do full-stack or something. Anyone else feel the same?
Title question. My experience is with M core microcontrollers and I was just wondering what the options are with A class processors. Is it just Linux or can I run an RTOS
Hello community do you guys have any links of project on guthub or elsewhere for bare metal fw dev on nvidia jetson nano thanks
I just ordered these cables for a project, Im connecting UART thru 2 microcontrollers and i thought it be clean and neat if I use these. Im worried that it might not work because of polarity, are they good for UART?
https://www.amazon.com/dp/B0B5DFWVC5?ref=ppx_yo2ov_dt_b_fed_asin_title
Hi everyone, I've a company and how do I get support from Rockchip? Eval kits, SDK etc. I want to develop handled ai product using RK3588 but I dont want to use SoM.
Hi all,
I'm working on a project with a PIC32MX57512L, and I'm encountering a strange issue with the UART module. The setup involves sending commands to the MCU via UART from a serial monitor on my PC.
Here’s the issue:
When I send some CLI commands through UART and then disconnect the UART hardware (physically), the system completely freezes. Even the watchdog timer doesn't recover it, which is unusual.
However, if I simply disconnect the UART hardware without sending any commands beforehand, there is no issue – the system continues running as expected.
Another problem I noticed is that when I reconnect the UART, sometimes the system doesn’t respond to any commands, requiring a power cycle to resume normal operation.
Additional Info:
I've confirmed that the system's code and other peripherals are running normally when UART is disconnected without prior CLI commands.
The system's watchdog timer is enabled, but for some reason, it doesn’t recover the system in this specific scenario.
Has anyone encountered a similar issue, or does anyone have insights on what could be causing this? Any help would be greatly appreciated!
Thanks in advance for your time and suggestions.
Hello dear community members, kindly helpe to debug this issue with ESP32-C3. So I am trying to program the custom board using Arduino IDE. Here is the screen shot of the error. I have googled this error and somebody suggested to change the upload speed to 115200 which I did but still getting this error. The tools settings are as follows: USB CDC ON BOOT: Enabled CPU FREQUENCY: 160MHz Core debug level: "Verbose" Erase all flash before sketch upload:"Disable" Flash frequency: "40MHz" Flash Mode:"QIO" Flash size: "2MB(16Mb)" JTAG Adapter:" Integrated USB JTAG" Partition Scheme:"Minimal(1.3MB APP/700KB SPIFFS)" Upload speed: "115200" Zigbee Mode: "Disabled"
Also does ESP32-C3 has its own inbuilt flash?
I need to flash 8 ARM Cortex M7 MCUs one at a time using a single J-link through SWD. From what I understand, the key pins to focus on are SWDIO, SWDCLK, and nReset, since ground and VCC are shared. Does anyone have suggestions for a low-cost Mux/Demux that could handle this? I’m aware that using three 8-channel analog multiplexers/demultiplexers (like the 74HC4051) would work, but I’m hoping there’s a solution that requires fewer ICs.
I'm using the Nucleo-F429ZI paired with a DWS3000 shield. When running the simple_tx
example project, the device fails to reach the IDLE_RC state after calling reset_DWIC()
and sleeping for 2ms. This causes it to get stuck in the infinite loop where the state is verified.
--> while (!dwt_checkidlerc()) { /* spin */ };
Does someone know how to resolve this issue? Your help would be greatly appreciated!
They have FlexSPI, FlexCAN, flex-builder, FlexTimer and so on. Word "Flex" occurs more that 1000 times in LS1028A-RM.
Good day.
I have a project with STM32F103 MCU. It uses ADC to gather data from sensors, GPIO to fetch status of some pins, and SPI to transmit it to other devices. Architecture is chosen to be interrupt-driven. Hence, ADC and SPI data is acquired through DMA. This makes me use pure HAL as neither mbedos nor zephyr is capable to employ ADC+DMA on my MCU.
The board I use has an external 8MHz oscillator. Clock configuration is like this:
Clock configuration results in the following source code being generated by CubeMX:
RCC_OscInitTypeDef RCC_OscInitStruct;// = {0};
RCC_ClkInitTypeDef RCC_ClkInitStruct;// = {0};
RCC_PeriphCLKInitTypeDef PeriphClkInit;// = {0};
memset(&RCC_OscInitStruct, 0, sizeof(RCC_OscInitStruct));
memset(&RCC_ClkInitStruct, 0, sizeof(RCC_ClkInitStruct));
memset(&PeriphClkInit, 0, sizeof(PeriphClkInit));
/** Initializes the RCC Oscillators according to the specified parameters
* in the RCC_OscInitTypeDef structure.
*/
RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
RCC_OscInitStruct.HSEState = RCC_HSE_ON;
RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV2;
RCC_OscInitStruct.HSIState = RCC_HSI_ON;
RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL14;
if (HAL_RCC_OscConfig(&RCC_OscInitStruct) != HAL_OK)
{
Error_Handler();
}
/** Initializes the CPU, AHB and APB buses clocks
*/
RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
|RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
if (HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2) != HAL_OK)
{
Error_Handler();
}
PeriphClkInit.PeriphClockSelection = RCC_PERIPHCLK_ADC;
PeriphClkInit.AdcClockSelection = RCC_ADCPCLK2_DIV4;
if (HAL_RCCEx_PeriphCLKConfig(&PeriphClkInit) != HAL_OK)
{
Error_Handler();
}
I've put memset instead of `= {0}` as I use C++ and it warns about some fields not being initialized.
Anyway, the software builds fine. After I upload it to the MCU I connect with debugger (openocd + gdb from arm toolchain) and see that the MCU is hangin in an infinite loop of `Default_Handler` and stacktrace says that `signal handler called` from inside of `HAL_RCC_OscInit`. At the same time NVIC's `IABR` registers are all zero which means there was no interrupt triggered.
I can't really understand where I did something wrong with configuration.
Any piece of advice is appreciated.
Sorry for my broken English.
UPDATE: HFSR, CFSR, BFAR, and MMFAR registers are all zeros in these circumstances.
TL:DR; looking for less "prototyping/development" board type of device and more along the lines of finished, production level hardware to be quickly utilized.
I'm looking for a quick and easy way of collecting just a few inputs and relaying them to the cloud for data monitoring purposes.
The number of inputs could be a minimum of 3 but may look for upwards of ~8 later on. The inputs will either be a plain 10k thermistor or a dry contact digital input.
The data connection could be hard-wired ethernet, but wifi could be nice, too. Forgive me for not being more specific with wireless protocols.
The end goal being to get that thermistor value onto a painfully simple graphic or do email alerts. The absolute bare minimum in terms of IoT. Literally "how I can I see this thermistor value while sitting on my couch at home?"
Given the overwhelming number of options for this application, what might be the best way? I looked at Arduino first, but it seems to either be too "solder-y and DIY-y" for the regular stuff or too crazy feature-packed ($$) for the Pro line. I don't need AI or ML.
I also thought about something like a Shelly device, and that is in the right direction in terms of raw simplicity, cost, and price, but would prefer something that relies less on Shelly's IoT platform (app, API, etc) and is more customizable/open.
The environment will be stationary and have constant power.
Emphasis on low cost and ideally a turnkey solution acceptable for light commercial environments.
Thanks!
I have got a MacBook Pro . I want to design a motor control in simulink (matlab) and get the code there on a board.
Dies someone know how I can do that? Sadly all good boards (teensy, raspberry etc) do not support the software extension for simulink on MacOs ..:/
I compiled a linux system for my lichee pi zero board with buildroot, then cross-compiled a linux daemon that I'd written for my system (runs in userland). The performance was way worse than I expected, so I decided to hunt down the performance bottleneck and I was able to narrow it down to slow memcpy() calls. The reason I used memcpy() was because I read online that it's hyperoptimized for copying large buffers around and I was getting very satisfying results from it on my host linux system. The data being moved is RAM to RAM
So I decided to ask, is there a software way to make memcpy() calls faster? Is there any option in buildroot or the kernel config that I can toggle? Is it the fault of the toolchain? What other tools and methods can I use to debug the slowness of memcpy()?
Thanks for your time
Hi. I'm using Adafruit_BNO08x.h lib on ESP32 and I have problem. I'm connecting Adafruit BNO085 sensor via SPI and I'm seeing the following error in my console:
Error:
Rebooting... ets
Jul 29 2019 12:21:46
rst:0xc (SW_CPU_RESET),boot:0x17
(SPI_FAST_FLASH_BOOT)
configsip: 0, SPIWP:0xee
clk_drv:0x00,q_drv:0x00,d_drv:0x00,cs0_drv:0x00,hd_drv:0x
00,wp_drv:0x00
mode:DIO, clock div:2
load:0x3fff0030,len:1184
load:0x40078000,len:13232
load:0x40080400,len:3028
entry 0x400805e4 Adafruit BNO08x test!
assert failed: xQueueSemaphoreTake queue.c:1549
(pxQueue->uxItemSize == 0)
Backtrace: 0x4008344d:0x3ffb1f40 0x400880e1:0x3ffb1f60 0x4008d021:0x3ffb1f80 0x40088e41:0x3ffb20b0 0x400d19d6:0x3ffb20f0 0x400e6889:0x3ffb2120 0x400e68b6:0x3ffb2140 0x400e6943:0x3ffb2160 0x400d1b68:0x3ffb2180 0x400d2ecd:0x3ffb21a0 0x400d2383:0x3ffb21e0 0x400d1bd1:0x3ffb2200 0x400d1c91:0x3ffb2220 0x400d16c0:0x3ffb2240 0x400d5bfa:0x3ffb2290
ELF file SHA256: 3364f8c9536997b6
I'm using the code form this example (with SPI connection): https://learn.adafruit.com/adafruit-9-dof-orientation-imu-fusion-breakout-bno085/arduino
After some investigation, I found that this error occurs during the following method call in Adafruit_BNO08x.h
int sh2_open(sh2_Hal_t *pHal, sh2_EventCallback_t *eventCallback, void *eventCookie)
Can you help me please?
So transformers and digital isolators have isolation rating and working voltages and i am a bit confused.
1 i know that working voltage is the voltage that can be applied continuously but there is the isolation voltage that is probably in some sort of bursts... but for how long and is it a puls or DC or is it AC ?
2 some transforms only display isolation voltage in Vrms is that working voltage or should i assume it is the pulse one? IF it is the pulse what iis a good estimate of the working voltage? half?
3 how is it measured? for insulation the leakage current is measured at 1kV for example then the and the resistance is calculated in Mohm but the isolation is rated in kV fow do you measure that and that is a failure electrically?
leakage more then some amount in a standard or catastrophic failure and dead short ?
4 what is a good resource to learn more ?
5 in a system what would be the best practices to make proper use of component isolation ? I can make some cut outs under transformers and digital isolators in order to increase creapage and keep the same clearance . Should i also remove the solder mask in the isolation border area?
6 Is it wrong to have a footprint for a wire that shorts cross insulation barrier? ( just on prototype phase so that i can have the same scope probing both sides at the same time ( yes i know it is a bit dangerous but i have 1 scope only... , and i hope i dont need to do it but if i need i want to prepare as much as i can )
7 I know people use Y class capacitors to tie the 2 GND nets in order filter out high frequency noise but is there a problem is there is to much of this type of capacitance? i often see 1nF but that is i use 10nF ? can i also omit it?
Hi everyone, I'm studying many microcontrollers with ultra low power consumption. In my project I'll use accelerometers and send data once per hour, with a 1Ah coin cell it should keep working for a year or more. Until now I've found that my options are nrf52/54, apollo3/4 or EFR32BG22, and I want to buy a few for first test but there are many DK options for each and the costs vary a lot. Any recommendations? Is there any better option that I missed?
Also, I already have a prototype with esp32, is any of this options easier to migrate?
I'm designing a mouse, but long story short I need 500ma for a stepper motor (haptic feedback, that's not what the question is about)
How do I get the power from HS (500ma) without having to use an HS PHY/HS MCU with an integrated PHY. I'm trying to save myself the trouble and use an STM32G484, which has the perfect peripheral set, but only USB FS (which is sufficient for a mouse).
Hi everyone,
I’m fairly new to embedded systems and currently diving into the STM32 WB09KE. To be honest, it feels pretty complex!
The example projects provided by ST are massive, and I’m struggling to wrap my head around all the hundreds of different structs and the numerous nested functions they use. I’m specifically working on Bluetooth Low Energy (BLE), but I haven’t found any comprehensive documentation that clearly explains the functions and how to utilize them effectively.
I'm using the nrf52840, and I'm doing a project where the system needs to sleep for a long time, maybe more than 24 hours.
Following this ticket, How to enter System ON sleep in zephyr to go to sleep I just do this:
void deep_sleep_state() {
//uint64_t seconds_to_deep_sleep = imachine_config_get_sleep_time();
uint64_t seconds_to_deep_sleep = 300;
LOG_INF("Deep Sleep State");
LOG_INF("Sleeping for: %llu seconds", seconds_to_deep_sleep);
// Check if necessary
//k_sleep(K_MSEC(3000));
bluetooth_disable();
if( set_rtc_alarm(seconds_to_deep_sleep) != 0 ) {
// TODO: Handle nap error
}
int rc;
const struct device *const console_dev = DEVICE_DT_GET(DT_CHOSEN(zephyr_console));
const struct device *const uart1_dev = DEVICE_DT_GET(DT_NODELABEL(uart1));
const struct device *const sensor_dev = DEVICE_DT_GET_ANY(st_lis2dh);
const struct device *const spi3_dev = DEVICE_DT_GET(DT_NODELABEL(spi3));
rc = pm_device_action_run(console_dev, PM_DEVICE_ACTION_SUSPEND);
rc = pm_device_action_run(uart1_dev, PM_DEVICE_ACTION_SUSPEND);
rc = pm_device_action_run(sensor_dev, PM_DEVICE_ACTION_SUSPEND);
flash_suspend();
rc = pm_device_action_run(spi3_dev, PM_DEVICE_ACTION_SUSPEND);
k_sem_reset(&rtc_alarm_sem);
k_sem_take(&rtc_alarm_sem, K_FOREVER);
rc = pm_device_action_run(console_dev, PM_DEVICE_ACTION_RESUME);
LOG_WRN("Wokend up - Rebooting");
// Check if necessary
//k_sleep(K_MSEC(5000));
sys_reboot(SYS_REBOOT_COLD);
}
And everything was working correctly until I programmed the WDT into the project
int watchdog_init(void)
{
LOG_INF("Watchdog module init");
if (!device_is_ready(wdt))
{
LOG_ERR("Watchdog device not ready");
return ERROR;
}
struct wdt_timeout_cfg wdt_config = {
/* Reset SoC when watchdog timer expires. */
.flags = WDT_FLAG_RESET_SOC,
/* Expire watchdog after max window */
.window.min = WDT_MIN_WINDOW,
.window.max = WDT_MAX_WINDOW,
};
// The watchdog pauses its operation during sleep and HALT
uint8_t options = WDT_OPT_PAUSE_IN_SLEEP | WDT_OPT_PAUSE_HALTED_BY_DBG;
#if WDT_ALLOW_CALLBACK
/* Set up watchdog callback. */
wdt_config.callback = watchdog_internal_callback;
#endif /* WDT_ALLOW_CALLBACK */
wdt_channel_id = wdt_install_timeout(wdt, &wdt_config);
if (wdt_channel_id < 0) {
LOG_ERR("Watchdog install error");
return ERROR;
}
if (wdt_setup(wdt, options) != SUCCESS) {
LOG_ERR("Watchdog setup error");
return ERROR;
}
LOG_INF("Watchdog Configuration: SUCCESS");
return SUCCESS;
}
From what I understood, wdt would not work during sleep, but in my tests here they are working and resetting the system. Since this isn't working as it should, could you show me how to do it? I didn't find an example like that.
I am studying Control System course currently, having an exercise of simulating PID controller using Arduino in Proteus, and the motor system in Simulink, most exciting part is designing the GUI using MATLAB AppDesigner to help communicating between platform via virtual serial ports!
Here is the showcasing video, hope you guys like it! If there is any issue or improvement, feel free to comment so that we can discuss together, I will be very appreciated. Thank you very much!
Hello guys, what are the good starting points/ resources if I would like to work on a project dedicating to scheduling of dataflow applications on RTOS(Zephyr)?
I'm working on a personal sampler/synth/sequencer project and I'm currently using the arduino Giga R1 board. The code doesn't use any Arduino/MbedOS functions except for 2-3 threads running in main using Mbed RTOS. I want to ditch the arduino/Mbed framework completely because it just complicates things when I want to set up DMA and specific compiler options and debugging etc.
So I want to try and use stm32 HAL, and freeRTOS instead and get a nucleo board.
the Giga R1 board has two 12 bit dacs which I've been using but it would be nice to get 16 bit dacs for the nucleo board.
The reason I want to stay away from teensy etc is that I want learn to do it on a lower level, but maybe I'm in the wrong here.
Can you reccomend a powerful nucleo board (M7) and 16 bits dacs (preferably i2s) I could get with it?
I will eventually need to have stereo inputs and outputs, a lcd screen, sd card and some uart midi in/out. All hardware controls like knobs/faders/encoders/buttons are currently handle by the M4 core on the Giga board and communicates them to the M7 core. If I get a nucleo I will probably just have the Giga communicate hardware controls over UART to the nucleo for now and later switch out the Giga to something smaller handling the hardware inputs and leds.
Thanks!
I successfully built AOSP for my Pixel device, but I’m not sure how to properly debug it when I change some source files. I found some guides online for debugging emulator builds, but building separately for the emulator and device takes a significant amount of time, and emulator and device builds may have differences. I also need to debug both Java and C/C++ files (native libraries). I’m familiar with strace
, but I’d prefer to use an IDE (like IntelliJ IDEA or Android Studio) for a more traditional and convenient debugging experience.
I am trying to design a pair of smart glasses that are discrete. Ideally I need a board that has very little (<10mm) width and very little height, but it can be slightly longer. Additionally, it needs bluetooth/ANT+/WiFi with at least 1 port for I/O (camera).
Any suggestions? Thanks.
The 10 cm uncertainty usually quoted doesn't give enough information. I have two TDOA RXTXs 60cm apart. Any external obstructions slowing down the microwave is attenuated because the path traveled is the same. Would I still get the full +-10cm uncertainty from both recievers? Because that would really mess up the AoA calculations.
ToF: time of flight TDOA: time difference of arrival RXTX: receiver transmitter AoA: angle of arrival
Im working on a flight controller and there are lots of integration, filters and number crunching going on. Im starting to think about how much clock speed do i need to pull this off.
Im working with teensy 4.1 which is arm cortex m7 600mhz. It will be more than enough for sure but still want to know how to measure it since i can reduce the cost of mcu if its overkill.