embedded

C/C++ HTTP Client Library for Embedded Projects [closed]

人盡茶涼 提交于 2019-11-26 18:54:36
问题 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 . So I have trawled through pages and pages of search results on StackOverflow and Google and I have come across very few C/C++ HTTP client libraries suitable for a resource-constrained, embedded environment (e.g. an ARM). I have however come across quite a few that are suitable for desktop-class applications.

Using Haskell for sizable real-time systems: how (if?)?

社会主义新天地 提交于 2019-11-26 18:51:19
问题 I've been curious to understand if it is possible to apply the power of Haskell to embedded realtime world, and in googling have found the Atom package. I'd assume that in the complex case the code might have all the classical C bugs - crashes, memory corruptions, etc, which would then need to be traced to the original Haskell code that caused them. So, this is the first part of the question: "If you had the experience with Atom, how did you deal with the task of debugging the low-level bugs

Is it safe to share a volatile variable between the main program and an ISR in C?

橙三吉。 提交于 2019-11-26 18:40:17
问题 Is it safe to share an aligned integer variable, not bigger than the processor natural word, with volatile qualifier, between the main program and an ISR in C? Is it guaranteed that no torn reads or writes may happen? 回答1: The volatile keyword does not imply atomicity - that simply ensures that a variable is explicitly read and not assumed not to have changed. For safe shared access without any other protection mechanism the variable must be both atomic and declared volatile . The compiler

Algorithm to pick values from array that sum closest to a target value?

送分小仙女□ 提交于 2019-11-26 18:36:00
问题 I have an array of nearly sorted values 28 elements long. I need to find the set of values that sums to a target value provided to the algorithm (or if exact sum cannot be found, the closest sum Below the target value). I currently have a simple algorithm that does the job but it doesn't always find the best match. It works under ideal circumstances with a specific set of values, but I need a more robust and accurate solution that can handle a wider variety of data sets. The algorithm must be

How to determine maximum stack usage?

假装没事ソ 提交于 2019-11-26 18:30:39
What methods are available for determining the optimum stack size for embedded/memory constrained system? If it's too big then memory is wasted that could be used elsewhere. However, if it is too small then we get this website's namesake... To try to jump start things: Jack Ganssle states in The Art of Designing Embedded Systems that, "With experience, one learns the standard, scientific way to compute the proper size for a stack: Pick a size at random and hope." Can anyone do better than that? A more specific example was requested. So, how about a C program targeting an MSP430 MCU with 2 kB

Process for reducing the size of an executable

不打扰是莪最后的温柔 提交于 2019-11-26 18:03:25
问题 I'm producing a hex file to run on an ARM processor which I want to keep below 32K. It's currently a lot larger than that and I wondered if someone might have some advice on what's the best approach to slim it down? Here's what I've done so far So I've run 'size' on it to determine how big the hex file is. Then 'size' again to see how big each of the object files are that link to create the hex files. It seems the majority of the size comes from external libraries. Then I used 'readelf' to

Explaination of ARM (especifically mobile) Peripherals Addressing and Bus architecture?

六月ゝ 毕业季﹏ 提交于 2019-11-26 17:46:39
问题 I will first say that I'm not expert in the field and my question might contain misunderstanding, in which case, I'll be glad if you correct me and attach resources so I can learn further details. I'm trying to figure out the way that the system bus and how the various devices that appear in a mobile device (such as sensors chips, wifi/BT SoC, touch panel, etc.) are addressed by the CPU (and by other MCUs). In the PC world we have the bus arbitrator that route the commands/data to the devices

Simple serial point-to-point communication protocol

北慕城南 提交于 2019-11-26 17:00:14
I need a simple communication protocol between two devices (a PC and a microcontroller). The PC must send some commands and parameters to the micro. The micro must transmit an array of bytes (data from sensor). The data must be noise protected (besides parity checking, I think I need some other data correction method). Is there any standard solution to do this? (I need only an idea, not the complete solution). P.S. Any advice is appreciated. P.P.S Sorry for any grammar mistakes, I hope you understand. Edit 1. I have not decided whether it will be master/slave protocol or both sides can

Cycle counter on ARM Cortex M4 (or M3)?

断了今生、忘了曾经 提交于 2019-11-26 16:09:08
问题 I'm trying to profile a C function (which is called from an interrupt, but I can extract it and profile it elsewhere) on a Cortex M4. What are the possibilities to count the number of cycles typically used in this function ? Function shall run in ~4000 cycles top, so RTC isn't an option I guess, and manually counting cycles from disassembly can be painful - and only useful if averaged because I'd like to profile on a typical stream with typical flash / memory usage pattern. I have heard about

Multiple assignment in one line

你说的曾经没有我的故事 提交于 2019-11-26 16:07:18
问题 I just come across the statement in embedded c (dsPIC33) sample1 = sample2 = 0; Would this mean sample1 = 0; sample2 = 0; Why do they type it this way? Is this good or bad coding? 回答1: Remember that assignment is done right to left, and that they are normal expressions. So from the compilers perspective the line sample1 = sample2 = 0; is the same as sample1 = (sample2 = 0); which is the same as sample2 = 0; sample1 = sample2; That is, sample2 is assigned zero, then sample1 is assigned the