embedded

Create a build environment for “C” project to dynamically select folders during compile time

点点圈 提交于 2019-12-12 04:40:40
问题 Lets say my folder structure is something like this .. +-- Application | +-- MICRO_CONTROLLER_1 | +-- MICRO_CONTROLLER_2 | +-- MICRO_CONTROLLER_3 and i have a compile switch ( SELECT_MICRO) set to #define SELECT_MICRO == MICRO_CONTROLLER_1 , then my project should build application with driver files in MICRO_CONTROLLER_1 , similarly if #define SELECT_MICRO == MICRO_CONTROLLER_2 , then application should build application with driver files in MICRO_CONTROLLER_2 Please let me know if there

CPPUTEST: How to ignore only one mocked call placed between other ones

孤街浪徒 提交于 2019-12-12 04:14:01
问题 I would like to ignore one call placed between other ones that I want to call under the same case test. If I use ignoreothercalls I have not clear if the rest of the calls, following this, will be called. I need the rest, after ignored call, will be called. Or at least, to find the way of stopping ignoreothercalls effect before the end of the test case. TEST(group, test1){ ... mock().expectOneCall("HAL_AS393x_CommandStrobes").withParameter("cCommandCode",AS393X_CMD_CALIB_RCO_LC); /*----------

how to write code for transfer data from internal memory via SPI Master to 2 slave

不羁岁月 提交于 2019-12-12 04:06:55
问题 I receive data from USB to the internal memory of Atxmega 128A1 if ( (SWITCHPORTL.IN & PIN1_bm) == 0 ) { j = 0; while (j < NUM_BYTES) { // Wait till there is unread data in the receive buffer while((USART.STATUS & USART_RXCIF_bm) == 0 ){}; // Read out the received data __far_mem_write(j+SDRAM_ADDR, USART.DATA); if (j == (NUM_BYTES-1)) { // Toggle LED 1 LEDPORT.OUTTGL = PIN1_bm; } j++; } } How to write code for transfer data from internal memory via SPI Master to two slaves such that odd and

Microcontroller and flash memory chip programming development and simulation

一个人想着一个人 提交于 2019-12-12 03:30:08
问题 I just started to learn micro-controller programming and I seem to have a lot of trouble getting started, particularly the simulation part. This is an application I need to program: I need to store a few wave files in a flash memory chip, and use a Cortex-M0 to read in the music from the flash memory, and play them in combination, or run some basic signal processing on them. I am looking for an IDE that supports the end-to-end simulation on this. I looked at CoIDE (because if I google free

Turning a bash script into a busybox script

点点圈 提交于 2019-12-12 03:30:05
问题 I am working on a device that only has busybox (ash?) and does not support bash. However, I need to run the bash script below on it. Is it possible or busybox simply does not support scripts? #!/bin/bash domain="mydomain.com" record="11019653" api_key="key1234" ip="$(curl http://ipecho.net/plain)" echo content="$(curl \ -k \ -H "Authorization: Bearer $api_key" \ -H "Content-Type: application/json" \ -d '{"data": "'"$ip"'"}' \ -X PUT "https://api.digitalocean.com/v2/domains/$domain/records/

Does anybody know an embedded software library or embedded software development framework? [closed]

我怕爱的太早我们不能终老 提交于 2019-12-12 03:22:42
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . My company is about to replace the 8 bit microcontrollers in all our embedded devices with ARM Cortex-M controllers (32 bit). We will need to redesign and clean up considerable parts of the existing firmware, because it is in pretty bad shape and cannot easily be ported to a different processor. We do now plan

C interp: unknown symbol name 'inetstatShow'

梦想的初衷 提交于 2019-12-12 02:49:51
问题 I have some Vxworks embedded os and I want to check the netstat . This is what I tried: -> inetstatShow And the output is: C interp: unknown symbol name 'inetstatShow'. How can I have netstat command in this? 回答1: inetstatShow is provided by netShow library - you need to be sure that your OS configuration includes netShow, or you can dynamically load it using ld. The lkup function can be used to list symbols that are available to the shell. Try lkup "Show" to list all symbols that include the

How can bool variable be not equal to both True and False?

本小妞迷上赌 提交于 2019-12-12 02:45:19
问题 According to accepted answer of this question What is the benefit of terminating if … else if constructs with an else clause? There is a corruption case (in embedded system) that can cause a bool variable (which is 1 bit) differ to both True and False , it means the else path in this code could be covered instead of be a dead code. if (g_str.bool_variable == True) { ... } else if (g_str.bool_variable == False) { ... } else { //handle error } I try to find out but there's still no clue for it.

How do I represent a pointer to the beginning of my address space?

北慕城南 提交于 2019-12-12 02:41:59
问题 Let's consider some strange hypothetical embedded system where I need to produce and use a pointer that points to, or might point to, the first byte of my address space. That is, a pointer equal to zero. Not a NULL pointer, but a perfectly valid zero pointer, which might get dereferenced or incremented or treated as an array just like any other pointer. How would I do this in languages that treat a NULL pointer as special, but don't have a real NULL type? 回答1: The whole "NULL pointer having a

serial communication with arm microcontroller

早过忘川 提交于 2019-12-12 02:09:41
问题 I am trying to send data from the arm cortrx m4 microcontroller to pc through usb. There is a program written in C++ language in codeblocks ide. Basically the program sets the serial communication settings and read data using ReadFile function. The problem is I am getting garbage values at the output even if the baud rate in pc proogram and microcontroller is same. How can I solve this problem? The pc program is shown below. #include <Windows.h> #include <stdio.h> int main(void) { HANDLE