embedded

How to specify a memory location at which function will get stored?

我怕爱的太早我们不能终老 提交于 2019-12-06 14:36:34
Can anyone please let me know what are the possible ways in which we can store a function(in C) at a fixed memory location. I am using IAR IDE for ARM cortex m3 core. How functions and data can be placed in memory is described in section "Controlling data and function placement in memory" of the IAR manual "IAR C/C++ Development Guide". The only way I see to place a specific function at a specific address is to define a section in memory where to place this and only this function. Example: void MyFunction( void ) @ "MyFunctionsSection" { ... } In the linker file you have to define the section

COM port detection in Linux

安稳与你 提交于 2019-12-06 14:29:15
问题 Please let me know if there is any API, system call, function (in Linux) which I can use my C program to detect a COM port dynamically, i.e., whenever a USB modem dongle is inserted in the port I will be able to detect that COM port using the API, or system call, or function in my C program. 回答1: Depending on your modem, USB serial port device may show up as /dev/ttyUSBn or /dev/ttyACMn , where n is some number starting from 0 . You can configure udev rule to automatically react on device

variable redefinition, embedded c

霸气de小男生 提交于 2019-12-06 13:47:57
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 the #ifndef _GLOBAL_VARS_H_ #define... #endif, I get redefinition errors for all the global variables.

Access Memory Mapped I/O

我只是一个虾纸丫 提交于 2019-12-06 13:14:45
I am very new to embedded system programming, I just need to learn how to manipulate the given via c++ code. Given: Motor 1 is mapped to 0x60000000 Motor 2 is mapped to 0x50000000 the following are the definitions of current 32-bit registers REGISTER NAME | BYTE OFFSET | NOTES ---------------------------------------------------------------------- motor_interrupt 0x00 service interrupts motor_status 0x01 enable on demand access to status elements motor_command 0x02 enable command of the motor REGISTER NAME | NAME | BITS | ACCESS TYPE | DESC ------------------------------------------------------

What is “Super Loop” in Embedded C programming language?

≯℡__Kan透↙ 提交于 2019-12-06 11:51:19
What is Super Loop in Embedded C programming language? This refers to the eternal loop usually located in main() of a "bare metal" system (no OS), since such systems can never return from main. A typical bare metal embedded system looks like this: void main (void) { // various initializations for(;;) // "super loop" or "main loop" { // do stuff } } MCU is device which runs continuously or better, it executes instructions when power is on (in general). So while loop is here to force MCU to do something, even if loop is empty, it will just circle around. But it must do something as it is not the

Guarantee TCP Packet Size

99封情书 提交于 2019-12-06 11:37:35
问题 We use an embedded device to send packets from a serial port over a serial-to-Ethernet converter to a server. One manufacturer we use, Moxa, will always send the packets in the same manner which they are constructed. Meaning, if we construct a packet size of 255, it will always send the packet in a 255 length. The other manufacturer, Tibbo, if we send the packet size 255, it will break the packet up if it is greater than 128. This is the answer I received from the Tibbo engineers at the time:

Contiki UDP packet transmission duration with CC2538

自古美人都是妖i 提交于 2019-12-06 10:46:06
Could someone explain me what is going on within the Contiki-OS when it transmits an UDP packet? Here is the current consumption of my device in details running with the CC2538 chip: My question is: why it takes so long to transmit an UDP broadcast packet (about 250ms) knowing that theoretically at 250kbps the packet of 408 bits length should be transmitted in approximately 2ms? I'd understand if the transmission last lets say ten milliseconds but here the difference is huge. I use the example in contiki/examples/ipv6/simple-udp-rpl/broadcast-example.c Does anyone have an idea? By default,

How do I calculate distance between GPS co-ordinates on a processor with poor floating point support?

为君一笑 提交于 2019-12-06 10:18:38
问题 I need to calculate the distance between GPS co-ordinates to calculate distance traveled. I've tried both the Haversine and Vincenty algorithms, which work fine on my desktop PC, but when I port the code to the dsPIC, they return 0 for points that are close (within several meters) due to a lack of floating point precision and poor implementations of sin and cos. For my use case, my points will be no more than 10 meters apart and will all fall within 10km of each other. I've tried the

Where to find information on Embedded C++?

丶灬走出姿态 提交于 2019-12-06 08:20:32
问题 I want to find information on "C++ programming in an embedded platfrom". I googled it but I was unable to find sufficient information on that topic. What exactly I want to find is How exactly C++ is useful in an embedded environment with detailed description and examples (if they are available) Can anyone please suggest any links or any free ebook downloads if I can get ? 回答1: I would recommend reading books related to embedded C, for example Embedded C by Michael J.Pont, 2002 or Programming

Install ssh server on embedded device

依然范特西╮ 提交于 2019-12-06 07:04:19
I'm trying to connect to an embedded device through ssh . However, when trying to connect, I always get a connection refused message even when I try changing the port number. I've tried everything to resolve this issue, from changing the file in /etc/ssh/ to accept the specific port number, to sudo iptables -A INPUT -p tcp --dport ssh -j ACCEPT . After reading some comments, it came to me that maybe one of the problems is that I don't have ssh installed on my embedded device. So, how do I infact install ssh on an embedded device? I'm working with a FOX G20 V board with an ATMEL AT91SAM9G20. I