embedded

using serial port RS-232 in android?

独自空忆成欢 提交于 2019-11-26 15:57:58
问题 I want to send signals via serial port using the JavaComm API classes on an Android device, and here is how I imagine it: 1- the Android device would be: Archos 3.2 which has android 2.2 and USB host mode. 2- include RxTx lib package with my Android app. and include RxTx native code using Android NDK. 3- a short cable which is usb-->serial. Could you explain to me where I might face problems? 回答1: I just ported the JavaCOMM ( GNU RXTX ) library to the Android. Here is the link http://v-lad

How to determine maximum stack usage in embedded system with gcc?

穿精又带淫゛_ 提交于 2019-11-26 15:20:53
问题 I'm writing the startup code for an embedded system -- the code that loads the initial stack pointer before jumping to the main() function -- and I need to tell it how many bytes of stack my application will use (or some larger, conservative estimate). I've been told the gcc compiler now has a -fstack-usage option and -fcallgraph-info option that can somehow be used to statically calculates the exact "Maximum Stack Usage" for me. ( "Compile-time stack requirements analysis with GCC" by

What are the available interactive languages that run in tiny memory? [closed]

大憨熊 提交于 2019-11-26 14:59:10
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed last year . I am looking for general purpose programming languages that have an interactive (live coding) prompt work in 32 KB of RAM by itself or 8 KB when the compiler is hosted on a separate machine run on a microcontroller with as little as 8-32 KB RAM total (without an MMU). Below is my

Looking for 16-bit x86 compiler

风格不统一 提交于 2019-11-26 13:53:05
问题 I am working on an embedded systems project and have run into an issue of the compiler being programatically embedded in the Paradigm C++ IDE. I would like to be able to automate building. The processor is the AMD186ES. I am not working with the OS - just baremetal stuff. I need to generate real-mode 16-bit 8086 machine code from C++. My googling indicates that G++ can build such code. My questions are: Can g++ be configured to build this machine code? Are there other C++ compilers that can

Why are global variables bad, in a single threaded, non-os, embedded application

落爺英雄遲暮 提交于 2019-11-26 13:06:33
问题 Most of the objections I see to using global variables make sense since they refer to issues of multiple threads, thread safety, etc. But in a small, single threaded, non-OS, case, what objections do you have? In my case, I\'m writing my embedded system in \"C\", if it matters. I\'m also the only developer on the product. Why would eliminating global variables make my code better? (After reading several responses, I realize I also should have pointed out that this system has no dynamic memory

implementation of rand()

假装没事ソ 提交于 2019-11-26 12:09:36
问题 I am writing some embedded code in C and need to use the rand() function. Unfortunately, rand() is not supported in the library for the controller. I need a simple implementation that is fast, but more importantly has little space overhead, that produces relatively high-quality random numbers. Does anyone know which algorithm to use or sample code? EDIT: It\'s for image processing, so \"relatively high quality\" means decent cycle length and good uniform properties. 回答1: Check out this

Direct Memory Access in Linux

﹥>﹥吖頭↗ 提交于 2019-11-26 11:56:52
问题 I\'m trying to access physical memory directly for an embedded Linux project, but I\'m not sure how I can best designate memory for my use. If I boot my device regularly, and access /dev/mem, I can easily read and write to just about anywhere I want. However, in this, I\'m accessing memory that can easily be allocated to any process; which I don\'t want to do My code for /dev/mem is (all error checking, etc. removed): mem_fd = open(\"/dev/mem\", O_RDWR)); mem_p = malloc(SIZE + (PAGE_SIZE - 1)

Embedded C++ : to use STL or not?

混江龙づ霸主 提交于 2019-11-26 11:53:58
问题 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 using STL in

Is there any reason to use C instead of C++ for embedded development?

末鹿安然 提交于 2019-11-26 11:48:08
问题 Question I have two compilers on my hardware C++ and C89 I\'m thinking about using C++ with classes but without polymorphism (to avoid vtables). The main reasons I’d like to use C++ are: I prefer to use “inline” functions instead of macro definitions. I’d like to use namespaces as I prefixes clutter the code. I see C++ a bit type safer mainly because of templates, and verbose casting. I really like overloaded functions and constructors (used for automatic casting). Do you see any reason to

What is a jump table?

半城伤御伤魂 提交于 2019-11-26 10:34:36
问题 Can someone explain the mechanics of a jump table and why is would be needed in embedded systems? 回答1: A jump table can be either an array of pointers to functions or an array of machine code jump instructions. If you have a relatively static set of functions (such as system calls or virtual functions for a class) then you can create this table once and call the functions using a simple index into the array. This would mean retrieving the pointer and calling a function or jumping to the