embedded

OpenGL Extensions on Tegra 3 devices

爱⌒轻易说出口 提交于 2019-12-04 04:59:35
问题 I wonder what new OpenGL ES extensions are on the new Tegra 3 devices? Anyone care to post their device name, OpenGL version and a list of extensions (Tegra 3 devices only, please)? I think other developers could use that too. On Android, you can do: String oglVersion = GLES20.glGetString(GLES20.GL_VERSION); String deviceName = GLES20.glGetString(GLES20.GL_RENDERER); String extensions = GLES20.glGetString(GLES20.GL_EXTENSIONS); Also, is there any real chance that the value of GL_MAX_VERTEX

Cross-Compiling for an embedded ARM-based Linux system

拈花ヽ惹草 提交于 2019-12-04 04:21:59
I try to compile some C code for an embedded (custom) ARM-based Linux system. I set up an Ubuntu VM with a cross-compiler named arm-linux-gnueabi-gcc-4.4 because it looked like what I needed. Now when I compile my code with this gcc, it produces a binary like this: $ file test1 test1: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.31, BuildID[sha1]=0x51b8d560584735be87adbfb60008d33b11fe5f07, not stripped When I try to run this binary on the embedded Linux, I get $ ./test1 -sh: ./test1: not found Permissions are sufficient. I can only

Does C provide a way to declare an extern variable as 'read-only', but define it as writeable?

左心房为你撑大大i 提交于 2019-12-04 04:21:30
问题 I'm developing a hardware abstraction library for an embedded product using GCC C. Within the library there is a variable that should be read-only to the application that links the library, but can be modified from within the compilation unit that defines it. Is there a standard, acceptable way to declare the integer (in the library header file) that will allow the application to read the value in the variable, but tell the compiler to generate an error if any attempt is made to generate code

How to use a variable as a parameter in a function that only suports constant expresssion

僤鯓⒐⒋嵵緔 提交于 2019-12-04 04:14:32
问题 I'm using this function: __delay_cycles(var); and I get the following error: Argument to _delay_cycles must be a constant expression Fair enough! But how can I bypass this? I have to delay my program with a different value every time. I receive my data from RS232 and I sore it in an int variable. I have to use this function and I can't modify its structure. I'm using AtMega16. 回答1: One suggestion that immediately springs to mind is to call __delay_cycles() with a constant argument, but do it

When do I use xdata?

孤者浪人 提交于 2019-12-04 03:59:52
I am new at embedded system programming. I am working on a device that uses an 8051 chipset. I have noticed in the sample programs that when defining variables, sometimes they use the keyword xdata. like this... static unsigned char xdata PatternSize; while other times the xdata keyword is omitted. My understanding is that the xdata keyword instructs the compiler that that variable is to be stored in external, flash, memory. In what cases should I store variables externally with xdata? Accessing those variables takes longer, right? Values stored using xdata do not remain after a hard reset of

Using C headers in C++ code in GNU. Error including inline assembly: impossible constraint in 'asm'

ⅰ亾dé卋堺 提交于 2019-12-04 03:45:57
问题 I have a weird one. I'm working on an embedded system, using the vendors header files. I'm compiling the files using GCC 4.6.3. I want to use C++ for my code, I have error I can't figure out. I'm running a vendor example program, and all I've done is changed the name of the main.c file to main.cpp. As a result, I assume, the header files are being interpreted by the C++ compiler. One of them contains the following lines: __attribute__((naked)) static return_type signature \ { \ __asm( \ "svc

Enabling external aborts on an ARM CPU

只谈情不闲聊 提交于 2019-12-04 03:42:01
问题 From the Cortex-R reference manual, probably not Cortex-R specific Asynchronous abort masking The nature of asynchronous aborts means that they can occur while the processor is handling a different abort. If an asynchronous abort generates a new exception in such a situation, the r14_abt and SPSR_abt values are overwritten. If this occurs before the data is pushed to the stack in memory, the state information about the first abort is lost. To prevent this from happening, the CPSR contains a

Prevent C++11 removal of endless loops

痴心易碎 提交于 2019-12-04 03:13:43
问题 As discussed in this question, C++11 optimizes endless loops away. However, in embedded devices which have a single purpose, endless loops make sense and are actually quite often used. Even a completely empty while(1); is useful for a watchdog-assisted reset. Terminating but empty loops can also be useful in embedded development. Is there an elegant way to specifically tell the compiler to not remove empty or endless loops, without disabling optimization altogether? 回答1: One of the

Does “static/extern uint8_t array[2] = {0};” conform to the ANSI C specification?

限于喜欢 提交于 2019-12-04 03:07:13
I've a question regarding the following code: #include "all_needed.h" static uint8_t array[2] = {0}; void main(void) { ... } Is a (module) global array allowed to be initialized as above for having each member set to zero while being ANSI C conform? I've got a problem in Code Composer 5 (MSP430 Project) where I had to change it into static uint8_t array[2] = {0, 0}; for a correct initialization of the 2nd member of the array. Yes, this is allowed, and should initialize the array to zero. C99, §6.7.8 p10: If an object that has static storage duration is not initialized explicitly, then: — if it

Call tree for embedded software [closed]

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-04 03:02:30
Closed. This question is off-topic. It is not currently accepting answers. Learn more . Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 months ago . Does anyone know some tools to create a call tree for C application that will run on a microcontroller (Cortex-M3)? It could be generated from source code (not ideal), object code (prefered solution), or at runtime (acceptable). I've looked at gprof, but there's still a lot missing to get it to work on an embedded system. An added bonus would be that the tool also gives the maximum stack depth.