embedded

Is volatile needed when variable is only read during interrupt

六月ゝ 毕业季﹏ 提交于 2019-12-10 12:45:25
问题 The C standard states that the volatile keyword should be used in the definition of a variable when there's a chance that the variable's value could change outside the normal flow of execution of the program. If a global variable is changed (written) during normal execution flow and only read outside this normal flow (in an interrupt). Does this variable need to be volatile ? And why ? 回答1: If a global variable is changed (written) during normal execution flow and only read outside this

Writing a C program to call another program without using any built-in libraries

流过昼夜 提交于 2019-12-10 12:25:59
问题 I am trying to write a simple 'go-command' for boot-loader that takes me to specific address in RAM say 0x18000000 and it should execute a program that blinks led. I have two .c files say led.c and go.c in which led.c blinks two leds. But I am wondering and don't know that how can I pass a control/invoke its main() to this go.c file to go to that address and start blinking leds? But it should be done without including other header files, libraries, etc. Kindly help me!! Thanks in advance.

1wire problem in detail

北慕城南 提交于 2019-12-10 12:19:15
问题 I have defined these functions below, and when I ask Device_ID function for example of the family code, I only get FF (should be 28), acctually I get both the family code, 48-bit serial, and the crc 8 bit to be all "ones". It seems like the detect slave device function works as it should.... If i connect the slave he say's I am here, and if i take it away... no device present. I also have a 5kohm pull-up at the 1wire. And I dont have a clue why my Device_ID dont work, so my question is why

“Section type conflict” in arm embedded, what is it?

馋奶兔 提交于 2019-12-10 12:18:31
问题 I am getting an error for this: Can any one guide me on this? What sort of error is this. What are some generic possible errors causes for this. I am asking about Section type conflict. What I find on Google is the people saying different things about their specific platforms, compilers. I am using GCC, STM32F429I, and VSTAR OS (RTOS). C:\Users\munullah\eclipseworkspace\onsvr\vstar_os\applications\sample\gen \STM32F429I\GNU\Os_Lcfg.c:530:58: error: Os_IsrCAT1PlatformConfig causes a section

Repeat an instruction a certain number of times without a “loop”?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 11:50:00
问题 I've used PICs before and now I'm using with STM32F415. On a time-critical part of my code I need to put a very exact delay to adjust the period of the DAC-DMA that are working together to create a periodic analog signal. The delay I want to add goes from 0 to 63 clock cycles (If I were able to do 10-63 clock cycles it would be OK aswell). In PIC24F assembly, there's the instruction "REPEAT" which allows me to repeat the next instruction a certain number of times. That would work great for me

variable redefinition, embedded c

99封情书 提交于 2019-12-10 10:45:00
问题 I'm working on an embedded c project and am having issues with global variable redefinition. I've split up the function declarations and definitions into a handful of .h and .c files. Many of these functions need access to global variables, which are defined in global_vars.h. Therefore, at the beginning of the header files, inside the #ifndef, #define section, "global_vars.h". If I don't, as you might imagine I get a bunch of undefined variable errors. However, even though global_vars.h has

C++ disable destructors for static variables

大兔子大兔子 提交于 2019-12-10 09:22:43
问题 I have a general purpose class which is used in different contexts - sometime as static variable, and sometime as a normal variable on the stack/heap. When it is used as a normal variable the destructor must be called when it goes out of scope - as normal. The executable is used in an embedded target where flash is a limited resource and which will never exit, and for this I would like this "exit" code to be disabled. Following is an example to illustrate the problem. A is the class where the

GCC C++ (ARM) and const pointer to struct field

淺唱寂寞╮ 提交于 2019-12-10 08:09:15
问题 Let's say there is a simple test code typedef struct { int first; int second; int third; } type_t; #define ADDRESS 0x12345678 #define REGISTER ((type_t*)ADDRESS) const int data = (int)(&REGISTER->second)*2; int main(void) { volatile int data_copy; data_copy = data; while(1) {}; } Which is compiled in CodeSourcery G++ (gcc 4.3.2) for bare metal ARM. It also has a very standard linker script. When compiled in C (as main.c) the object "data" goes into Flash, as expected. When compiled in C++ (as

Can I install .NET Framework 4 on Windows XP Embedded?

ⅰ亾dé卋堺 提交于 2019-12-10 02:29:03
问题 I can't test it but I need to know if it real , because I started working on project for it with .NET 4 so I must to be sure I can install it there. So can I install .NET Framework 4 on Windows XP Embedded ? Thank you. 回答1: Based on the wiki entry for Windows XP Embedded: Windows XP Embedded, commonly abbreviated "XPe", is a componentized version of the Professional edition of Windows XP. So I'd say yes, because .NET Framework 4 is compatible with Windows XP Professional. 回答2: .NET 4.0

Measure static memory usage for C++ ported to embedded platform

£可爱£侵袭症+ 提交于 2019-12-10 02:27:09
问题 I have created a small program as a proof-of-concept for a system which are to be implemented on an embedded platform. The program is written in C++11 with use of std and compiled to run on a laptop. The final program which should be implemented later is an embedded system. We do not have access to the compiler of the embedded platform. I would like to know if there is a way to determine a programs static memory (the size of the compiled binaries) in a sensible and comparable way when it