embedded

What is the role of .s files in a C project?

最后都变了- 提交于 2019-11-28 19:04:22
问题 I am working with an ARM Cortex M3 chip (STM32F2) and ST provides a "standard peripheral library". It has some useful .c and .h files. It also has .s files. What is the purpose of these .s files in the context of a C project? How do I get my compiler/linker/? to take them into account? 回答1: The .s extension is the convention used by GNU and many other tool-chains for assembler files. Last I looked the STM32 Standard Peripheral Library itself contains no assembler files, however the CMSIS

Use the right tool for the job: embedded programming

醉酒当歌 提交于 2019-11-28 17:41:24
问题 I'm interested in programming languages well suited for embedded programming. In particular: Is it possible to program embedded systems in C++? Or is it better to use pure C? Or is C++ OK only if some features of the language (e.g. RTTI, exceptions and templates) are excluded? What about Java in this domain? Thanks. 回答1: Is it possible to program embedded systems in C++? Yes, of course, even on 8bit systems. C++ only has a slightly different run-time initialisation requirements than C, that

AOSP repo sync takes too long

本秂侑毒 提交于 2019-11-28 17:06:26
I'm trying to learn Embedded Android from the book with the same name. And the author suggested working with AOSP gingerbread branch. So I followed to download the source: $ repo init -u https://android.googlesource.com/platform/manifest.git -b gingerbread $ repo sync But it's taking too long. Also from the output, it seems to me like it's also downloading source code from other branches (I see android-5.....) which is not what I want. I'm wondering if that's the reason why it takes so long. Has anybody had the same problem? Please give me a suggestion! Thanks! AOSP is a multi-gigabyte

Writing firmware: assembly or high level?

喜欢而已 提交于 2019-11-28 17:05:38
Related to: Testing firmware starting a microcontroller simulator/emulator Interpreting assembly code If you are writing code for a microcontroller is there a real difference if you write in assembly or C or some other high level language? If you wrote C code, how would you compile it? Thanks Several comments: 1) Absolutely not assembly unless performance or optimization constraints warrant it. The following metrics go through the roof with assembly: time to code it time to debug it time to test it time to document it time to figure out (1 year later) what it was you were doing when you coded

How does Linux determine the order of module init calls?

自闭症网瘾萝莉.ら 提交于 2019-11-28 17:04:14
I have a device with SPI flash storage I'd like to use an UBIFS filesystem on that flash device as my rootfs. The problem I'm facing is that the UBI module initializes before the SPI module initializes. Because of this, when UBI loads, it cannot attach to the UBI device that I've told it to (via the kernel command line), so there is no rootfs. The console output below illustrates this. I've been diving into the source enough to see that init/main.c has a do_initcalls() function that simply calls a list of function pointers. Those function pointers point to the all the module_init() functions

Power Efficient Software Coding

流过昼夜 提交于 2019-11-28 17:01:40
问题 In a typical handheld/portable embedded system device Battery life is a major concern in design of H/W, S/W and the features the device can support. From the Software programming perspective, one is aware of MIPS, Memory(Data and Program) optimized code. I am aware of the H/W Deep sleep mode, Standby mode that are used to clock the hardware at lower Cycles or turn of the clock entirel to some unused circutis to save power, but i am looking for some ideas from that point of view: Wherein my

Compact decompression library for embedded use

若如初见. 提交于 2019-11-28 16:45:11
We're currently creating a device for a customer that will get a block of data (like, say, 5-10KB) from a PC application. This is a bit simplified, so assume that the data must be passed and uncompressed a lot, not just once a year. The communication channel is really, really slow, so we'd like to compress the data beforehand, pass to the device and let it uncompress the data to its internal flash. The device itself, however, runs on a micro controller that is not really fast and does not have a lot of memory. It has enough flash memory to store the result, and can uncompress the data block as

GUI-Library for microcontroller [closed]

跟風遠走 提交于 2019-11-28 16:43:32
I want to create a GUI driven application for a micro-controller ( Atmel XMEGA ) that is connected to a 128x64 dots graphics LCD ( EA DOGL128-6 ) and 4 buttons for navigation. Controlling the display itself (e.g. drawing pixels and characters) is no problem but in order to prevent me from reinventing the wheel I was googling for a GUI-Library/-Toolkit that is written in c, includes its source code, will run on a 32 MHz 8-bit micro-controller and provides at least the following controls: panel (to group elements) menu (scrollable) icon label button line-graph (optional) But I didn't find any

Pimpl idiom without using dynamic memory allocation

孤人 提交于 2019-11-28 16:43:11
we want to use pimpl idiom for certain parts of our project. These parts of the project also happen to be parts where dynamic memory allocation is forbidden and this decision is not in our control. So what i am asking is, is there a clean and nice way of implementing pimpl idiom without dynamic memory allocation? Edit Here are some other limitations: Embedded platform, Standard C++98, no external libraries, no templates. Warning: the code here only showcases the storage aspect, it is a skeleton, no dynamic aspect (construction, copy, move, destruction) has been taken into account. I would

Embedded C++ : to use exceptions or not?

人走茶凉 提交于 2019-11-28 16:31:26
I realize this may be subjective, so will ask a concrete question, but first, background: I have always been an embedded software engineer, but usually at Layer 3 or 2 of the OSI stack. I am not really a hardware guy. I have generally always done telecoms products, usually hand/cell-phones, which generally means something like an ARM 7 processor. Now I find myself in a more generic embedded world, in a small start-up, where I might move to "not so powerful" processors (there's the subjective bit) - I cannot predict which. I have read quite a bit about debate about exception handling in C++ in